From fcb8f07020292288a840d6ca40ad1b8a23ba6e34 Mon Sep 17 00:00:00 2001 From: tiye Date: Wed, 7 Aug 2024 01:12:15 +0800 Subject: [PATCH 01/11] make UI mobile friendly --- .github/workflows/upload.yaml | 2 +- assets/manifest.json | 15 ++ calcit.cirru | 220 +++++++++++++++------- compact.cirru | 49 +++-- index.html | 1 + package.json | 4 +- yarn.lock | 342 +++++++++++++++++----------------- 7 files changed, 372 insertions(+), 261 deletions(-) create mode 100644 assets/manifest.json diff --git a/.github/workflows/upload.yaml b/.github/workflows/upload.yaml index efea9f8..7d3a2f1 100644 --- a/.github/workflows/upload.yaml +++ b/.github/workflows/upload.yaml @@ -19,7 +19,7 @@ jobs: - uses: calcit-lang/setup-cr@0.0.3 with: - version: '0.9.0-a1' + version: '0.9.1' - name: "compiles to js" run: > diff --git a/assets/manifest.json b/assets/manifest.json new file mode 100644 index 0000000..c174c98 --- /dev/null +++ b/assets/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "Msg Gemini", + "name": "Msg Gemini", + "icons": [ + { + "src": "https://uxwing.com/wp-content/themes/uxwing/download/brands-and-social-media/google-gemini-icon.png", + "sizes": "512x512" + } + ], + "start_url": "/Termina/msg-buffer/index.html", + "display": "standalone", + "orientation": "portrait", + "background_color": "#8a47de", + "theme_color": "#ffffff" +} \ No newline at end of file diff --git a/calcit.cirru b/calcit.cirru index e93e511..1273fc7 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -65,14 +65,10 @@ |r $ %{} :Expr (:at 1584780901014) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1584780901408) (:by |rJG4IHzWf) (:text |{}) - |j $ %{} :Expr (:at 1584780901741) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1584780906050) (:by |rJG4IHzWf) (:text |:content) - |j $ %{} :Leaf (:at 1584780907617) (:by |rJG4IHzWf) (:text "|\"") |n $ %{} :Expr (:at 1722410778719) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722410779405) (:by |rJG4IHzWf) (:text |:answer) - |b $ %{} :Leaf (:at 1722410782233) (:by |rJG4IHzWf) (:text |nil) + |b $ %{} :Leaf (:at 1722963878976) (:by |rJG4IHzWf) (:text |nil) |q $ %{} :Expr (:at 1722425532566) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722425536183) (:by |rJG4IHzWf) (:text |:loading?) @@ -95,19 +91,10 @@ |T $ %{} :Leaf (:at 1695659808341) (:by |rJG4IHzWf) (:text |str-spaced) |b $ %{} :Leaf (:at 1701711029710) (:by |rJG4IHzWf) (:text |css/preset) |j $ %{} :Leaf (:at 1695659810151) (:by |rJG4IHzWf) (:text |css/global) - |r $ %{} :Leaf (:at 1695659811823) (:by |rJG4IHzWf) (:text |css/row) - |t $ %{} :Leaf (:at 1722411319222) (:by |rJG4IHzWf) (:text |css/fullscreen) + |r $ %{} :Leaf (:at 1722963014322) (:by |rJG4IHzWf) (:text |css/column) + |s $ %{} :Leaf (:at 1722963532093) (:by |rJG4IHzWf) (:text |css/fullscreen) |u $ %{} :Leaf (:at 1722445873663) (:by |rJG4IHzWf) (:text |css/gap8) - |n $ %{} :Expr (:at 1722425776469) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722425778013) (:by |rJG4IHzWf) (:text |:style) - |b $ %{} :Expr (:at 1722425778276) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722425778580) (:by |rJG4IHzWf) (:text |{}) - |b $ %{} :Expr (:at 1722425778784) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722425780294) (:by |rJG4IHzWf) (:text |:padding) - |b $ %{} :Leaf (:at 1722445844636) (:by |rJG4IHzWf) (:text "|\"8px 8px") + |v $ %{} :Leaf (:at 1722963063278) (:by |rJG4IHzWf) (:text |style-app-global) |l $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |div) @@ -132,6 +119,18 @@ :data $ {} |T $ %{} :Leaf (:at 1722445848855) (:by |rJG4IHzWf) (:text |:padding) |b $ %{} :Leaf (:at 1722445912821) (:by |rJG4IHzWf) (:text "|\"40px 16px 200px 16px") + |l $ %{} :Expr (:at 1722963741928) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963741928) (:by |rJG4IHzWf) (:text |:width) + |b $ %{} :Leaf (:at 1722963741928) (:by |rJG4IHzWf) (:text "|\"100%") + |q $ %{} :Expr (:at 1722963569534) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963569534) (:by |rJG4IHzWf) (:text |:max-width) + |b $ %{} :Leaf (:at 1722963569534) (:by |rJG4IHzWf) (:text |1200) + |s $ %{} :Expr (:at 1722963569534) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963569534) (:by |rJG4IHzWf) (:text |:margin) + |b $ %{} :Leaf (:at 1722963569534) (:by |rJG4IHzWf) (:text |:auto) |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |if) @@ -355,7 +354,29 @@ :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |str-spaced) |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/center) - |h $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/flex) + |l $ %{} :Leaf (:at 1722963242805) (:by |rJG4IHzWf) (:text |style-message-box) + |h $ %{} :Expr (:at 1722963593976) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1722963595329) (:by |rJG4IHzWf) (:text |:style) + |T $ %{} :Expr (:at 1722963592731) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963592731) (:by |rJG4IHzWf) (:text |{}) + |l $ %{} :Expr (:at 1722963592731) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963592731) (:by |rJG4IHzWf) (:text |:max-width) + |b $ %{} :Leaf (:at 1722963592731) (:by |rJG4IHzWf) (:text |1200) + |m $ %{} :Expr (:at 1722963708864) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963710075) (:by |rJG4IHzWf) (:text |:width) + |b $ %{} :Leaf (:at 1722963712837) (:by |rJG4IHzWf) (:text "|\"100%") + |n $ %{} :Expr (:at 1722963780723) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963783181) (:by |rJG4IHzWf) (:text |:padding) + |b $ %{} :Leaf (:at 1722963785563) (:by |rJG4IHzWf) (:text "|\"8px") + |o $ %{} :Expr (:at 1722963592731) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963592731) (:by |rJG4IHzWf) (:text |:margin) + |b $ %{} :Leaf (:at 1722963592731) (:by |rJG4IHzWf) (:text |:auto) |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |textarea) @@ -455,70 +476,48 @@ |h $ %{} :Leaf (:at 1722536427678) (:by |rJG4IHzWf) (:text |d!) |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |div) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |button) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |{}) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:class-name) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/row-parted) - |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:style) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + |b $ %{} :Expr (:at 1722963277244) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |{}) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:padding) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text "|\"8px 2px") - |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |span) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1722963281394) (:by |rJG4IHzWf) (:text |str-spaced) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/button) + |b $ %{} :Leaf (:at 1722963290998) (:by |rJG4IHzWf) (:text |style-submit) + |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |{}) - |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |button) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:inner-text) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text "|\"Ask") + |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |{}) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:on-click) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:class-name) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/button) - |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:inner-text) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text "|\"Ask") - |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:on-click) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |fn) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |fn) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |e) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |d!) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |e) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |d!) + |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |;) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |println) |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |;) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |println) - |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:content) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |state) - |l $ %{} :Expr (:at 1722536434666) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:content) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |state) + |l $ %{} :Expr (:at 1722536434666) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |on-submit) + |b $ %{} :Expr (:at 1722536434666) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |on-submit) - |b $ %{} :Expr (:at 1722536434666) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |:content) - |b $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |state) - |h $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |d!) + |T $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |:content) + |b $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |d!) |get-gemini-key! $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722448309409) (:by |rJG4IHzWf) :data $ {} @@ -545,11 +544,25 @@ :data $ {} |T $ %{} :Leaf (:at 1722448325686) (:by |rJG4IHzWf) (:text |blank?) |b $ %{} :Leaf (:at 1722448326631) (:by |rJG4IHzWf) (:text |key) - |h $ %{} :Expr (:at 1722448328093) (:by |rJG4IHzWf) + |h $ %{} :Expr (:at 1722963915060) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722448331004) (:by |rJG4IHzWf) (:text |js/alert) - |b $ %{} :Leaf (:at 1722448341536) (:by |rJG4IHzWf) (:text "|\"Required gemini-key in localStorage") - |b $ %{} :Leaf (:at 1722448319448) (:by |rJG4IHzWf) (:text |key) + |D $ %{} :Leaf (:at 1722963915812) (:by |rJG4IHzWf) (:text |let) + |T $ %{} :Expr (:at 1722963916720) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Expr (:at 1722963916864) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1722963917432) (:by |rJG4IHzWf) (:text |v) + |T $ %{} :Expr (:at 1722448328093) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963913549) (:by |rJG4IHzWf) (:text |js/prompt) + |b $ %{} :Leaf (:at 1722448341536) (:by |rJG4IHzWf) (:text "|\"Required gemini-key in localStorage") + |X $ %{} :Expr (:at 1722963927392) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963929685) (:by |rJG4IHzWf) (:text |js/localStorage.setItem) + |b $ %{} :Leaf (:at 1722963927392) (:by |rJG4IHzWf) (:text "|\"gemini-key") + |h $ %{} :Leaf (:at 1722963931640) (:by |rJG4IHzWf) (:text |v) + |b $ %{} :Leaf (:at 1722963919289) (:by |rJG4IHzWf) (:text |v) + |l $ %{} :Leaf (:at 1722963922770) (:by |rJG4IHzWf) (:text |key) |pattern-spaced-code $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722483516034) (:by |rJG4IHzWf) :data $ {} @@ -575,6 +588,46 @@ |D $ %{} :Leaf (:at 1722480836949) (:by |rJG4IHzWf) (:text |get-env) |L $ %{} :Leaf (:at 1722480838937) (:by |rJG4IHzWf) (:text "|\"model") |T $ %{} :Leaf (:at 1722480820908) (:by |rJG4IHzWf) (:text "|\"gemini-1.5-flash") + |style-app-global $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1722963063687) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963065771) (:by |rJG4IHzWf) (:text |defstyle) + |b $ %{} :Leaf (:at 1722963063687) (:by |rJG4IHzWf) (:text |style-app-global) + |h $ %{} :Expr (:at 1722963063687) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963066913) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1722963067424) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Expr (:at 1722963173613) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1722963174416) (:by |rJG4IHzWf) (:text |str) + |T $ %{} :Leaf (:at 1722963179783) (:by |rJG4IHzWf) (:text "|\"& .") + |b $ %{} :Leaf (:at 1722963177715) (:by |rJG4IHzWf) (:text |style-code-block) + |b $ %{} :Expr (:at 1722963069383) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963069700) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1722963197653) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963199934) (:by |rJG4IHzWf) (:text |:max-width) + |b $ %{} :Leaf (:at 1722963203380) (:by |rJG4IHzWf) (:text "|\"90vw") + |style-message-box $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1722963245314) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963247833) (:by |rJG4IHzWf) (:text |defstyle) + |b $ %{} :Leaf (:at 1722963245314) (:by |rJG4IHzWf) (:text |style-message-box) + |h $ %{} :Expr (:at 1722963248720) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963249995) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1722963250446) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963251567) (:by |rJG4IHzWf) (:text "|\"&") + |b $ %{} :Expr (:at 1722963251834) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963252154) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1722963253603) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963255664) (:by |rJG4IHzWf) (:text |:position) + |b $ %{} :Leaf (:at 1722963257811) (:by |rJG4IHzWf) (:text |:relative) |style-more $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722448082591) (:by |rJG4IHzWf) :data $ {} @@ -610,6 +663,32 @@ :data $ {} |T $ %{} :Leaf (:at 1722448159438) (:by |rJG4IHzWf) (:text |:margin) |b $ %{} :Leaf (:at 1722448164453) (:by |rJG4IHzWf) (:text |16) + |style-submit $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1722963291408) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963293102) (:by |rJG4IHzWf) (:text |defstyle) + |b $ %{} :Leaf (:at 1722963291408) (:by |rJG4IHzWf) (:text |style-submit) + |h $ %{} :Expr (:at 1722963291408) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963294216) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1722963294514) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963295831) (:by |rJG4IHzWf) (:text "|\"&") + |b $ %{} :Expr (:at 1722963296150) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963296464) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1722963297722) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963298890) (:by |rJG4IHzWf) (:text |:position) + |b $ %{} :Leaf (:at 1722963303008) (:by |rJG4IHzWf) (:text |:absolute) + |h $ %{} :Expr (:at 1722963303602) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963434218) (:by |rJG4IHzWf) (:text |:top) + |b $ %{} :Leaf (:at 1722963795189) (:by |rJG4IHzWf) (:text |-24) + |l $ %{} :Expr (:at 1722963303602) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722963394752) (:by |rJG4IHzWf) (:text |:right) + |b $ %{} :Leaf (:at 1722963390376) (:by |rJG4IHzWf) (:text |8) |submit-message! $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722409346610) (:by |rJG4IHzWf) :data $ {} @@ -1059,6 +1138,7 @@ |h $ %{} :Expr (:at 1722425486739) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722425491341) (:by |rJG4IHzWf) (:text |comp-md-block) + |b $ %{} :Leaf (:at 1722963155292) (:by |rJG4IHzWf) (:text |style-code-block) |zY $ %{} :Expr (:at 1722481920058) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722481923050) (:by |rJG4IHzWf) (:text |respo-ui.comp) diff --git a/compact.cirru b/compact.cirru index 85b6ff4..e36268f 100644 --- a/compact.cirru +++ b/compact.cirru @@ -16,14 +16,12 @@ states $ :states store cursor $ or (:cursor states) ([]) state $ or (:data states) - {} (:content "\"") (:answer nil) (:loading? false) (:done? false) + {} (:answer nil) (:loading? false) (:done? false) div - {} - :class-name $ str-spaced css/preset css/global css/row css/fullscreen css/gap8 - :style $ {} (:padding "\"8px 8px") + {} $ :class-name (str-spaced css/preset css/global css/column css/fullscreen css/gap8 style-app-global) div {} (:class-name css/expand) - :style $ {} (:flex 2) (:padding "\"40px 16px 200px 16px") + :style $ {} (:flex 2) (:padding "\"40px 16px 200px 16px") (:width "\"100%") (:max-width 1200) (:margin :auto) if (:loading? state) div ({}) (<> "\"loading..." css/font-fancy) if @@ -56,7 +54,9 @@ state $ either (:data states) {} $ :content "\"" div - {} $ :class-name (str-spaced css/center css/flex) + {} + :class-name $ str-spaced css/center style-message-box + :style $ {} (:max-width 1200) (:width "\"100%") (:padding "\"8px") (:margin :auto) textarea $ {} :value $ :content state :placeholder "\"Content" @@ -70,26 +70,37 @@ = 13 $ :keycode e :meta? e on-submit (:content state) d! - div - {} (:class-name css/row-parted) - :style $ {} (:padding "\"8px 2px") - span $ {} - button $ {} (:class-name css/button) (:inner-text "\"Ask") - :on-click $ fn (e d!) - ; println $ :content state - on-submit (:content state) d! + button $ {} + :class-name $ str-spaced css/button style-submit + :inner-text "\"Ask" + :on-click $ fn (e d!) + ; println $ :content state + on-submit (:content state) d! |get-gemini-key! $ %{} :CodeEntry (:doc |) :code $ quote defn get-gemini-key! () $ let key $ js/localStorage.getItem "\"gemini-key" - if (blank? key) (js/alert "\"Required gemini-key in localStorage") - , key + if (blank? key) + let + v $ js/prompt "\"Required gemini-key in localStorage" + js/localStorage.setItem "\"gemini-key" v + , v + , key |pattern-spaced-code $ %{} :CodeEntry (:doc |) :code $ quote def pattern-spaced-code $ noted "\"temp fix of nested code block" (&raw-code "\"/\\n\\s+```/g") |pick-model $ %{} :CodeEntry (:doc |) :code $ quote defn pick-model () $ get-env "\"model" "\"gemini-1.5-flash" + |style-app-global $ %{} :CodeEntry (:doc |) + :code $ quote + defstyle style-app-global $ {} + str "\"& ." style-code-block + {} $ :max-width "\"90vw" + |style-message-box $ %{} :CodeEntry (:doc |) + :code $ quote + defstyle style-message-box $ {} + "\"&" $ {} (:position :relative) |style-more $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-more $ {} @@ -97,6 +108,10 @@ :background-color $ hsl 0 0 90 :border-radius 12 :margin 16 + |style-submit $ %{} :CodeEntry (:doc |) + :code $ quote + defstyle style-submit $ {} + "\"&" $ {} (:position :absolute) (:top -24) (:right 8) |submit-message! $ %{} :CodeEntry (:doc |) :code $ quote defn submit-message! (cursor state prompt-test d!) (hint-fn async) @@ -155,7 +170,7 @@ reel.comp.reel :refer $ comp-reel app.config :refer $ dev? "\"axios" :default axios - respo-md.comp.md :refer $ comp-md-block + respo-md.comp.md :refer $ comp-md-block style-code-block respo-ui.comp :refer $ comp-copy |app.config $ %{} :FileEntry :defs $ {} diff --git a/index.html b/index.html index f6ca222..eca3b2b 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ Gemini Msg + diff --git a/package.json b/package.json index d95cf0b..6e52b9c 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "dependencies": { - "@calcit/procs": "^0.9.0", + "@calcit/procs": "^0.9.1", "@google/generative-ai": "^0.16.0", - "axios": "^1.7.2", + "axios": "^1.7.3", "cirru-color": "^0.2.4", "copy-text-to-clipboard": "^3.2.0" }, diff --git a/yarn.lock b/yarn.lock index 615f61e..3ec746d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@calcit/procs@^0.9.0": - version "0.9.0" - resolved "https://registry.npmmirror.com/@calcit/procs/-/procs-0.9.0.tgz#aed52fa61fa2a07c13507b56d72ee31af364e0cf" - integrity sha512-uxlyXHa5+nY1xDVyp65capcFovidrmYK27sStszgz3olGo0p7piaZmE46jCbsjbvZj1DuHQhJ+Zqkgx98ErnOg== +"@calcit/procs@^0.9.1": + version "0.9.1" + resolved "https://registry.yarnpkg.com/@calcit/procs/-/procs-0.9.1.tgz#29fb84464f22f4e222499fa768e52fb1a1c5b344" + integrity sha512-YqHU01Mu3DSqElU7+tWOniZkCpzgltJtJ/oI+m3BbHX/dJG3oB9qtprtkKMXpvLukmloS9PEyhLBmY5NSSwRLw== dependencies: "@calcit/ternary-tree" "0.0.24" "@cirru/parser.ts" "^0.0.6" @@ -13,233 +13,233 @@ "@calcit/ternary-tree@0.0.24": version "0.0.24" - resolved "https://registry.npmmirror.com/@calcit/ternary-tree/-/ternary-tree-0.0.24.tgz#9b58cf9f76c08c3995b98b59c71b85e1da32385c" + resolved "https://registry.yarnpkg.com/@calcit/ternary-tree/-/ternary-tree-0.0.24.tgz#9b58cf9f76c08c3995b98b59c71b85e1da32385c" integrity sha512-IGs+VNYIrIF2bI3/cnQe2lFmZYaJe3+A0LArDloGbNaEzUTRoyba37FTZ8K9C+XRpUAO9K0q61sKY2vb4teWAA== "@cirru/parser.ts@^0.0.6": version "0.0.6" - resolved "https://registry.npmmirror.com/@cirru/parser.ts/-/parser.ts-0.0.6.tgz#b95a84e02273fcbd71ff100925782b6f86410234" + resolved "https://registry.yarnpkg.com/@cirru/parser.ts/-/parser.ts-0.0.6.tgz#b95a84e02273fcbd71ff100925782b6f86410234" integrity sha512-qpDNPq+IuuwYjQFI+wzpd3ntbF7lwJs90v1XWyLQbL9Ru4ld4aHxVGwW/9F/QOu5mEGCMXtagCoYDf0HtOpDZg== "@cirru/writer.ts@^0.1.5": version "0.1.5" - resolved "https://registry.npmmirror.com/@cirru/writer.ts/-/writer.ts-0.1.5.tgz#890d96cd4a69609f1682932dad5d2d467abb327e" + resolved "https://registry.yarnpkg.com/@cirru/writer.ts/-/writer.ts-0.1.5.tgz#890d96cd4a69609f1682932dad5d2d467abb327e" integrity sha512-QQVFJAOIdUtVJZwT23THZOzumSDXCLMQ0yFz5DzIGlWGXPNBuB7BwUvGtRuiQrzM2XV7ALOWmNsVC7vEOjObQQ== "@esbuild/aix-ppc64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz#c7184a326533fcdf1b8ee0733e21c713b975575f" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz#c7184a326533fcdf1b8ee0733e21c713b975575f" integrity sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ== "@esbuild/android-arm64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz#09d9b4357780da9ea3a7dfb833a1f1ff439b4052" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz#09d9b4357780da9ea3a7dfb833a1f1ff439b4052" integrity sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A== "@esbuild/android-arm@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.21.5.tgz#9b04384fb771926dfa6d7ad04324ecb2ab9b2e28" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.21.5.tgz#9b04384fb771926dfa6d7ad04324ecb2ab9b2e28" integrity sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg== "@esbuild/android-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.21.5.tgz#29918ec2db754cedcb6c1b04de8cd6547af6461e" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.21.5.tgz#29918ec2db754cedcb6c1b04de8cd6547af6461e" integrity sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA== "@esbuild/darwin-arm64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz#e495b539660e51690f3928af50a76fb0a6ccff2a" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz#e495b539660e51690f3928af50a76fb0a6ccff2a" integrity sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ== "@esbuild/darwin-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz#c13838fa57372839abdddc91d71542ceea2e1e22" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz#c13838fa57372839abdddc91d71542ceea2e1e22" integrity sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw== "@esbuild/freebsd-arm64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz#646b989aa20bf89fd071dd5dbfad69a3542e550e" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz#646b989aa20bf89fd071dd5dbfad69a3542e550e" integrity sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g== "@esbuild/freebsd-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz#aa615cfc80af954d3458906e38ca22c18cf5c261" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz#aa615cfc80af954d3458906e38ca22c18cf5c261" integrity sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ== "@esbuild/linux-arm64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz#70ac6fa14f5cb7e1f7f887bcffb680ad09922b5b" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz#70ac6fa14f5cb7e1f7f887bcffb680ad09922b5b" integrity sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q== "@esbuild/linux-arm@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz#fc6fd11a8aca56c1f6f3894f2bea0479f8f626b9" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz#fc6fd11a8aca56c1f6f3894f2bea0479f8f626b9" integrity sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA== "@esbuild/linux-ia32@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz#3271f53b3f93e3d093d518d1649d6d68d346ede2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz#3271f53b3f93e3d093d518d1649d6d68d346ede2" integrity sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg== "@esbuild/linux-loong64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz#ed62e04238c57026aea831c5a130b73c0f9f26df" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz#ed62e04238c57026aea831c5a130b73c0f9f26df" integrity sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg== "@esbuild/linux-mips64el@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz#e79b8eb48bf3b106fadec1ac8240fb97b4e64cbe" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz#e79b8eb48bf3b106fadec1ac8240fb97b4e64cbe" integrity sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg== "@esbuild/linux-ppc64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz#5f2203860a143b9919d383ef7573521fb154c3e4" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz#5f2203860a143b9919d383ef7573521fb154c3e4" integrity sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w== "@esbuild/linux-riscv64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz#07bcafd99322d5af62f618cb9e6a9b7f4bb825dc" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz#07bcafd99322d5af62f618cb9e6a9b7f4bb825dc" integrity sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA== "@esbuild/linux-s390x@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz#b7ccf686751d6a3e44b8627ababc8be3ef62d8de" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz#b7ccf686751d6a3e44b8627ababc8be3ef62d8de" integrity sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A== "@esbuild/linux-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz#6d8f0c768e070e64309af8004bb94e68ab2bb3b0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz#6d8f0c768e070e64309af8004bb94e68ab2bb3b0" integrity sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ== "@esbuild/netbsd-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz#bbe430f60d378ecb88decb219c602667387a6047" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz#bbe430f60d378ecb88decb219c602667387a6047" integrity sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg== "@esbuild/openbsd-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz#99d1cf2937279560d2104821f5ccce220cb2af70" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz#99d1cf2937279560d2104821f5ccce220cb2af70" integrity sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow== "@esbuild/sunos-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz#08741512c10d529566baba837b4fe052c8f3487b" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz#08741512c10d529566baba837b4fe052c8f3487b" integrity sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg== "@esbuild/win32-arm64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz#675b7385398411240735016144ab2e99a60fc75d" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz#675b7385398411240735016144ab2e99a60fc75d" integrity sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A== "@esbuild/win32-ia32@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz#1bfc3ce98aa6ca9a0969e4d2af72144c59c1193b" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz#1bfc3ce98aa6ca9a0969e4d2af72144c59c1193b" integrity sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA== "@esbuild/win32-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz#acad351d582d157bb145535db2a6ff53dd514b5c" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz#acad351d582d157bb145535db2a6ff53dd514b5c" integrity sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw== "@google/generative-ai@^0.16.0": version "0.16.0" - resolved "https://registry.npmmirror.com/@google/generative-ai/-/generative-ai-0.16.0.tgz#3d8cea2faf08dd8c249fa0726c9c7c460f65bb5f" + resolved "https://registry.yarnpkg.com/@google/generative-ai/-/generative-ai-0.16.0.tgz#3d8cea2faf08dd8c249fa0726c9c7c460f65bb5f" integrity sha512-doB5ZNxS6m+jUZqaLCeYXfBZCdq6Ho0ibkq5/17xe1qAUZpCLWlvCDGtqFPqqO+yezNmvGatS0KhV22yiOT3DA== -"@rollup/rollup-android-arm-eabi@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.1.tgz#7746deb85e4a8fb54fbfda8ac5c102692f102476" - integrity sha512-XzqSg714++M+FXhHfXpS1tDnNZNpgxxuGZWlRG/jSj+VEPmZ0yg6jV4E0AL3uyBKxO8mO3xtOsP5mQ+XLfrlww== - -"@rollup/rollup-android-arm64@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.1.tgz#93de4d867709d3313794723b5afd91e1e174f906" - integrity sha512-thFUbkHteM20BGShD6P08aungq4irbIZKUNbG70LN8RkO7YztcGPiKTTGZS7Kw+x5h8hOXs0i4OaHwFxlpQN6A== - -"@rollup/rollup-darwin-arm64@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.1.tgz#e41e6a81673260ab196e0f59462b9940a6ac03cd" - integrity sha512-8o6eqeFZzVLia2hKPUZk4jdE3zW7LCcZr+MD18tXkgBBid3lssGVAYuox8x6YHoEPDdDa9ixTaStcmx88lio5Q== - -"@rollup/rollup-darwin-x64@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.1.tgz#2b0a0aef6e8c5317d494cfc9076d7a16b099bdcb" - integrity sha512-4T42heKsnbjkn7ovYiAdDVRRWZLU9Kmhdt6HafZxFcUdpjlBlxj4wDrt1yFWLk7G4+E+8p2C9tcmSu0KA6auGA== - -"@rollup/rollup-linux-arm-gnueabihf@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.1.tgz#e22319deb5367384ef315e66bc6de80d2bf2b3ae" - integrity sha512-MXg1xp+e5GhZ3Vit1gGEyoC+dyQUBy2JgVQ+3hUrD9wZMkUw/ywgkpK7oZgnB6kPpGrxJ41clkPPnsknuD6M2Q== - -"@rollup/rollup-linux-arm-musleabihf@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.1.tgz#d5dd68f5d7ae21b345a5c87208c94e5c813f54b8" - integrity sha512-DZNLwIY4ftPSRVkJEaxYkq7u2zel7aah57HESuNkUnz+3bZHxwkCUkrfS2IWC1sxK6F2QNIR0Qr/YXw7nkF3Pw== - -"@rollup/rollup-linux-arm64-gnu@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.1.tgz#1703d3a418d33f8f025acaf93f39ca1efcd5b645" - integrity sha512-C7evongnjyxdngSDRRSQv5GvyfISizgtk9RM+z2biV5kY6S/NF/wta7K+DanmktC5DkuaJQgoKGf7KUDmA7RUw== - -"@rollup/rollup-linux-arm64-musl@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.1.tgz#3f59c2c6e60f75ce8b1090bd841c555e3bb01f0e" - integrity sha512-89tFWqxfxLLHkAthAcrTs9etAoBFRduNfWdl2xUs/yLV+7XDrJ5yuXMHptNqf1Zw0UCA3cAutkAiAokYCkaPtw== - -"@rollup/rollup-linux-powerpc64le-gnu@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.1.tgz#3f99a0921596a6f539121a312df29af52a205f15" - integrity sha512-PromGeV50sq+YfaisG8W3fd+Cl6mnOOiNv2qKKqKCpiiEke2KiKVyDqG/Mb9GWKbYMHj5a01fq/qlUR28PFhCQ== - -"@rollup/rollup-linux-riscv64-gnu@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.1.tgz#c08fb3e629d50d2eac31329347cfc559a1cf81d1" - integrity sha512-/1BmHYh+iz0cNCP0oHCuF8CSiNj0JOGf0jRlSo3L/FAyZyG2rGBuKpkZVH9YF+x58r1jgWxvm1aRg3DHrLDt6A== - -"@rollup/rollup-linux-s390x-gnu@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.1.tgz#173722cd745779d730d4b24d21386185e0e12de8" - integrity sha512-0cYP5rGkQWRZKy9/HtsWVStLXzCF3cCBTRI+qRL8Z+wkYlqN7zrSYm6FuY5Kd5ysS5aH0q5lVgb/WbG4jqXN1Q== - -"@rollup/rollup-linux-x64-gnu@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.1.tgz#0af2b6541ab0f4954d2c4f96bcdc7947420dd28c" - integrity sha512-XUXeI9eM8rMP8aGvii/aOOiMvTs7xlCosq9xCjcqI9+5hBxtjDpD+7Abm1ZhVIFE1J2h2VIg0t2DX/gjespC2Q== - -"@rollup/rollup-linux-x64-musl@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.1.tgz#f973f9552744764b221128f7c3629222216ace69" - integrity sha512-V7cBw/cKXMfEVhpSvVZhC+iGifD6U1zJ4tbibjjN+Xi3blSXaj/rJynAkCFFQfoG6VZrAiP7uGVzL440Q6Me2Q== - -"@rollup/rollup-win32-arm64-msvc@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.1.tgz#21ac5ed84d914bc31821fec3dd909f7257cfb17b" - integrity sha512-88brja2vldW/76jWATlBqHEoGjJLRnP0WOEKAUbMcXaAZnemNhlAHSyj4jIwMoP2T750LE9lblvD4e2jXleZsA== - -"@rollup/rollup-win32-ia32-msvc@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.1.tgz#0cfe740063b35dcd5a62c4e243226631a846ce11" - integrity sha512-LdxxcqRVSXi6k6JUrTah1rHuaupoeuiv38du8Mt4r4IPer3kwlTo+RuvfE8KzZ/tL6BhaPlzJ3835i6CxrFIRQ== - -"@rollup/rollup-win32-x64-msvc@4.19.1": - version "4.19.1" - resolved "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.1.tgz#5f2c40d3f1b53ede80fb4e6964f840c0f8936832" - integrity sha512-2bIrL28PcK3YCqD9anGxDxamxdiJAxA+l7fWIwM5o8UqNy1t3d1NdAweO2XhA0KTDJ5aH1FsuiT5+7VhtHliXg== +"@rollup/rollup-android-arm-eabi@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.20.0.tgz#c3f5660f67030c493a981ac1d34ee9dfe1d8ec0f" + integrity sha512-TSpWzflCc4VGAUJZlPpgAJE1+V60MePDQnBd7PPkpuEmOy8i87aL6tinFGKBFKuEDikYpig72QzdT3QPYIi+oA== + +"@rollup/rollup-android-arm64@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.20.0.tgz#64161f0b67050023a3859e723570af54a82cff5c" + integrity sha512-u00Ro/nok7oGzVuh/FMYfNoGqxU5CPWz1mxV85S2w9LxHR8OoMQBuSk+3BKVIDYgkpeOET5yXkx90OYFc+ytpQ== + +"@rollup/rollup-darwin-arm64@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.20.0.tgz#25f3d57b1da433097cfebc89341b355901615763" + integrity sha512-uFVfvzvsdGtlSLuL0ZlvPJvl6ZmrH4CBwLGEFPe7hUmf7htGAN+aXo43R/V6LATyxlKVC/m6UsLb7jbG+LG39Q== + +"@rollup/rollup-darwin-x64@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.20.0.tgz#d8ddaffb636cc2f59222c50316e27771e48966df" + integrity sha512-xbrMDdlev53vNXexEa6l0LffojxhqDTBeL+VUxuuIXys4x6xyvbKq5XqTXBCEUA8ty8iEJblHvFaWRJTk/icAQ== + +"@rollup/rollup-linux-arm-gnueabihf@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.20.0.tgz#41bd4fcffa20fb84f3dbac6c5071638f46151885" + integrity sha512-jMYvxZwGmoHFBTbr12Xc6wOdc2xA5tF5F2q6t7Rcfab68TT0n+r7dgawD4qhPEvasDsVpQi+MgDzj2faOLsZjA== + +"@rollup/rollup-linux-arm-musleabihf@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.20.0.tgz#842077c5113a747eb5686f19f2f18c33ecc0acc8" + integrity sha512-1asSTl4HKuIHIB1GcdFHNNZhxAYEdqML/MW4QmPS4G0ivbEcBr1JKlFLKsIRqjSwOBkdItn3/ZDlyvZ/N6KPlw== + +"@rollup/rollup-linux-arm64-gnu@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.20.0.tgz#65d1d5b6778848f55b7823958044bf3e8737e5b7" + integrity sha512-COBb8Bkx56KldOYJfMf6wKeYJrtJ9vEgBRAOkfw6Ens0tnmzPqvlpjZiLgkhg6cA3DGzCmLmmd319pmHvKWWlQ== + +"@rollup/rollup-linux-arm64-musl@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.20.0.tgz#50eef7d6e24d0fe3332200bb666cad2be8afcf86" + integrity sha512-+it+mBSyMslVQa8wSPvBx53fYuZK/oLTu5RJoXogjk6x7Q7sz1GNRsXWjn6SwyJm8E/oMjNVwPhmNdIjwP135Q== + +"@rollup/rollup-linux-powerpc64le-gnu@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.20.0.tgz#8837e858f53c84607f05ad0602943e96d104c6b4" + integrity sha512-yAMvqhPfGKsAxHN8I4+jE0CpLWD8cv4z7CK7BMmhjDuz606Q2tFKkWRY8bHR9JQXYcoLfopo5TTqzxgPUjUMfw== + +"@rollup/rollup-linux-riscv64-gnu@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.20.0.tgz#c894ade2300caa447757ddf45787cca246e816a4" + integrity sha512-qmuxFpfmi/2SUkAw95TtNq/w/I7Gpjurx609OOOV7U4vhvUhBcftcmXwl3rqAek+ADBwSjIC4IVNLiszoj3dPA== + +"@rollup/rollup-linux-s390x-gnu@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.20.0.tgz#5841e5390d4c82dd5cdf7b2c95a830e3c2f47dd3" + integrity sha512-I0BtGXddHSHjV1mqTNkgUZLnS3WtsqebAXv11D5BZE/gfw5KoyXSAXVqyJximQXNvNzUo4GKlCK/dIwXlz+jlg== + +"@rollup/rollup-linux-x64-gnu@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.20.0.tgz#cc1f26398bf777807a99226dc13f47eb0f6c720d" + integrity sha512-y+eoL2I3iphUg9tN9GB6ku1FA8kOfmF4oUEWhztDJ4KXJy1agk/9+pejOuZkNFhRwHAOxMsBPLbXPd6mJiCwew== + +"@rollup/rollup-linux-x64-musl@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.20.0.tgz#1507465d9056e0502a590d4c1a00b4d7b1fda370" + integrity sha512-hM3nhW40kBNYUkZb/r9k2FKK+/MnKglX7UYd4ZUy5DJs8/sMsIbqWK2piZtVGE3kcXVNj3B2IrUYROJMMCikNg== + +"@rollup/rollup-win32-arm64-msvc@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.20.0.tgz#86a221f01a2c248104dd0defb4da119f2a73642e" + integrity sha512-psegMvP+Ik/Bg7QRJbv8w8PAytPA7Uo8fpFjXyCRHWm6Nt42L+JtoqH8eDQ5hRP7/XW2UiIriy1Z46jf0Oa1kA== + +"@rollup/rollup-win32-ia32-msvc@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.20.0.tgz#8bc8f77e02760aa664694b4286d6fbea7f1331c5" + integrity sha512-GabekH3w4lgAJpVxkk7hUzUf2hICSQO0a/BLFA11/RMxQT92MabKAqyubzDZmMOC/hcJNlc+rrypzNzYl4Dx7A== + +"@rollup/rollup-win32-x64-msvc@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.20.0.tgz#601fffee719a1e8447f908aca97864eec23b2784" + integrity sha512-aJ1EJSuTdGnM6qbVC4B5DSmozPTqIag9fSzXRNNo+humQLG89XpPgdt16Ia56ORD7s+H8Pmyx44uczDQ0yDzpg== "@types/estree@1.0.5": version "1.0.5" - resolved "https://registry.npmmirror.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== asynckit@^0.4.0: version "0.4.0" - resolved "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -axios@^1.7.2: - version "1.7.2" - resolved "https://registry.npmmirror.com/axios/-/axios-1.7.2.tgz#b625db8a7051fbea61c35a3cbb3a1daa7b9c7621" - integrity sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw== +axios@^1.7.3: + version "1.7.3" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.3.tgz#a1125f2faf702bc8e8f2104ec3a76fab40257d85" + integrity sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw== dependencies: follow-redirects "^1.15.6" form-data "^4.0.0" @@ -247,7 +247,7 @@ axios@^1.7.2: bottom-tip@^0.1.5: version "0.1.5" - resolved "https://registry.npmmirror.com/bottom-tip/-/bottom-tip-0.1.5.tgz#ca81e738fba6ae956a5b4c55a78a127820c9b99e" + resolved "https://registry.yarnpkg.com/bottom-tip/-/bottom-tip-0.1.5.tgz#ca81e738fba6ae956a5b4c55a78a127820c9b99e" integrity sha512-53RCkWg6hY8M7Y9lPgU2f2bAEejQh0H6SCL9B8ufFdYAOAH/cUEwxSsBIH0AcPbOcNaSgdEJr9OhdnTUENe5bA== dependencies: nanoid "^4.0.1" @@ -255,44 +255,44 @@ bottom-tip@^0.1.5: browser-split@0.0.1: version "0.0.1" - resolved "https://registry.npmmirror.com/browser-split/-/browser-split-0.0.1.tgz#7b097574f8e3ead606fb4664e64adfdda2981a93" + resolved "https://registry.yarnpkg.com/browser-split/-/browser-split-0.0.1.tgz#7b097574f8e3ead606fb4664e64adfdda2981a93" integrity sha512-JhvgRb2ihQhsljNda3BI8/UcRHVzrVwo3Q+P8vDtSiyobXuFpuZ9mq+MbRGMnC22CjW3RrfXdg6j6ITX8M+7Ow== camelize@^1.0.0: version "1.0.1" - resolved "https://registry.npmmirror.com/camelize/-/camelize-1.0.1.tgz#89b7e16884056331a35d6b5ad064332c91daa6c3" + resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.1.tgz#89b7e16884056331a35d6b5ad064332c91daa6c3" integrity sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ== cirru-color@^0.2.4: version "0.2.4" - resolved "https://registry.npmmirror.com/cirru-color/-/cirru-color-0.2.4.tgz#19c5cb33cbf45d5bcccf8ecf1e45ef5673962a7a" + resolved "https://registry.yarnpkg.com/cirru-color/-/cirru-color-0.2.4.tgz#19c5cb33cbf45d5bcccf8ecf1e45ef5673962a7a" integrity sha512-2ruNYgSyzrXirizCk2r9LNeu9+BXxEHNQVS1/RE2P7b1xoMjfYRiOpRaX2ecyCu4oF4HJGwYWi8vamiXI8ADEQ== combined-stream@^1.0.8: version "1.0.8" - resolved "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" copy-text-to-clipboard@^3.2.0: version "3.2.0" - resolved "https://registry.npmmirror.com/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz#0202b2d9bdae30a49a53f898626dcc3b49ad960b" + resolved "https://registry.yarnpkg.com/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz#0202b2d9bdae30a49a53f898626dcc3b49ad960b" integrity sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q== delayed-stream@~1.0.0: version "1.0.0" - resolved "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== dom-walk@^0.1.0: version "0.1.2" - resolved "https://registry.npmmirror.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" + resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== error@^4.3.0: version "4.4.0" - resolved "https://registry.npmmirror.com/error/-/error-4.4.0.tgz#bf69ff251fb4a279c19adccdaa6b61e90d9bf12a" + resolved "https://registry.yarnpkg.com/error/-/error-4.4.0.tgz#bf69ff251fb4a279c19adccdaa6b61e90d9bf12a" integrity sha512-SNDKualLUtT4StGFP7xNfuFybL2f6iJujFtrWuvJqGbVQGaN+adE23veqzPz1hjUjTunLi2EnJ+0SJxtbJreKw== dependencies: camelize "^1.0.0" @@ -301,7 +301,7 @@ error@^4.3.0: esbuild@^0.21.3: version "0.21.5" - resolved "https://registry.npmmirror.com/esbuild/-/esbuild-0.21.5.tgz#9ca301b120922959b766360d8ac830da0d02997d" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.21.5.tgz#9ca301b120922959b766360d8ac830da0d02997d" integrity sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw== optionalDependencies: "@esbuild/aix-ppc64" "0.21.5" @@ -330,19 +330,19 @@ esbuild@^0.21.3: ev-store@^7.0.0: version "7.0.0" - resolved "https://registry.npmmirror.com/ev-store/-/ev-store-7.0.0.tgz#1ab0c7f82136505dd74b31d17701cb2be6d26558" + resolved "https://registry.yarnpkg.com/ev-store/-/ev-store-7.0.0.tgz#1ab0c7f82136505dd74b31d17701cb2be6d26558" integrity sha512-otazchNRnGzp2YarBJ+GXKVGvhxVATB1zmaStxJBYet0Dyq7A9VhH8IUEB/gRcL6Ch52lfpgPTRJ2m49epyMsQ== dependencies: individual "^3.0.0" follow-redirects@^1.15.6: version "1.15.6" - resolved "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== form-data@^4.0.0: version "4.0.0" - resolved "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== dependencies: asynckit "^0.4.0" @@ -351,12 +351,12 @@ form-data@^4.0.0: fsevents@~2.3.2, fsevents@~2.3.3: version "2.3.3" - resolved "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== global@^4.3.0: version "4.4.0" - resolved "https://registry.npmmirror.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" + resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== dependencies: min-document "^2.19.0" @@ -364,57 +364,57 @@ global@^4.3.0: individual@^3.0.0: version "3.0.0" - resolved "https://registry.npmmirror.com/individual/-/individual-3.0.0.tgz#e7ca4f85f8957b018734f285750dc22ec2f9862d" + resolved "https://registry.yarnpkg.com/individual/-/individual-3.0.0.tgz#e7ca4f85f8957b018734f285750dc22ec2f9862d" integrity sha512-rUY5vtT748NMRbEMrTNiFfy29BgGZwGXUi2NFUVMWQrogSLzlJvQV9eeMWi+g1aVaQ53tpyLAQtd5x/JH0Nh1g== is-object@^1.0.1: version "1.0.2" - resolved "https://registry.npmmirror.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" + resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== mime-db@1.52.0: version "1.52.0" - resolved "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== mime-types@^2.1.12: version "2.1.35" - resolved "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" min-document@^2.19.0: version "2.19.0" - resolved "https://registry.npmmirror.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" + resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" integrity sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ== dependencies: dom-walk "^0.1.0" nanoid@^3.3.7: version "3.3.7" - resolved "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== nanoid@^4.0.1: version "4.0.2" - resolved "https://registry.npmmirror.com/nanoid/-/nanoid-4.0.2.tgz#140b3c5003959adbebf521c170f282c5e7f9fb9e" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-4.0.2.tgz#140b3c5003959adbebf521c170f282c5e7f9fb9e" integrity sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw== next-tick@^0.2.2: version "0.2.2" - resolved "https://registry.npmmirror.com/next-tick/-/next-tick-0.2.2.tgz#75da4a927ee5887e39065880065b7336413b310d" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-0.2.2.tgz#75da4a927ee5887e39065880065b7336413b310d" integrity sha512-f7h4svPtl+QidoBv4taKXUjJ70G2asaZ8G28nS0OkqaalX8dwwrtWtyxEDPK62AC00ur/+/E0pUwBwY5EPn15Q== picocolors@^1.0.1: version "1.0.1" - resolved "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== postcss@^8.4.39: - version "8.4.40" - resolved "https://registry.npmmirror.com/postcss/-/postcss-8.4.40.tgz#eb81f2a4dd7668ed869a6db25999e02e9ad909d8" - integrity sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q== + version "8.4.41" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.41.tgz#d6104d3ba272d882fe18fc07d15dc2da62fa2681" + integrity sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ== dependencies: nanoid "^3.3.7" picocolors "^1.0.1" @@ -422,52 +422,52 @@ postcss@^8.4.39: process@^0.11.10: version "0.11.10" - resolved "https://registry.npmmirror.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== proxy-from-env@^1.1.0: version "1.1.0" - resolved "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== rollup@^4.13.0: - version "4.19.1" - resolved "https://registry.npmmirror.com/rollup/-/rollup-4.19.1.tgz#21d865cd60d4a325172ce8b082e60caccd97b309" - integrity sha512-K5vziVlg7hTpYfFBI+91zHBEMo6jafYXpkMlqZjg7/zhIG9iHqazBf4xz9AVdjS9BruRn280ROqLI7G3OFRIlw== + version "4.20.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.20.0.tgz#f9d602161d29e178f0bf1d9f35f0a26f83939492" + integrity sha512-6rbWBChcnSGzIlXeIdNIZTopKYad8ZG8ajhl78lGRLsI2rX8IkaotQhVas2Ma+GPxJav19wrSzvRvuiv0YKzWw== dependencies: "@types/estree" "1.0.5" optionalDependencies: - "@rollup/rollup-android-arm-eabi" "4.19.1" - "@rollup/rollup-android-arm64" "4.19.1" - "@rollup/rollup-darwin-arm64" "4.19.1" - "@rollup/rollup-darwin-x64" "4.19.1" - "@rollup/rollup-linux-arm-gnueabihf" "4.19.1" - "@rollup/rollup-linux-arm-musleabihf" "4.19.1" - "@rollup/rollup-linux-arm64-gnu" "4.19.1" - "@rollup/rollup-linux-arm64-musl" "4.19.1" - "@rollup/rollup-linux-powerpc64le-gnu" "4.19.1" - "@rollup/rollup-linux-riscv64-gnu" "4.19.1" - "@rollup/rollup-linux-s390x-gnu" "4.19.1" - "@rollup/rollup-linux-x64-gnu" "4.19.1" - "@rollup/rollup-linux-x64-musl" "4.19.1" - "@rollup/rollup-win32-arm64-msvc" "4.19.1" - "@rollup/rollup-win32-ia32-msvc" "4.19.1" - "@rollup/rollup-win32-x64-msvc" "4.19.1" + "@rollup/rollup-android-arm-eabi" "4.20.0" + "@rollup/rollup-android-arm64" "4.20.0" + "@rollup/rollup-darwin-arm64" "4.20.0" + "@rollup/rollup-darwin-x64" "4.20.0" + "@rollup/rollup-linux-arm-gnueabihf" "4.20.0" + "@rollup/rollup-linux-arm-musleabihf" "4.20.0" + "@rollup/rollup-linux-arm64-gnu" "4.20.0" + "@rollup/rollup-linux-arm64-musl" "4.20.0" + "@rollup/rollup-linux-powerpc64le-gnu" "4.20.0" + "@rollup/rollup-linux-riscv64-gnu" "4.20.0" + "@rollup/rollup-linux-s390x-gnu" "4.20.0" + "@rollup/rollup-linux-x64-gnu" "4.20.0" + "@rollup/rollup-linux-x64-musl" "4.20.0" + "@rollup/rollup-win32-arm64-msvc" "4.20.0" + "@rollup/rollup-win32-ia32-msvc" "4.20.0" + "@rollup/rollup-win32-x64-msvc" "4.20.0" fsevents "~2.3.2" source-map-js@^1.2.0: version "1.2.0" - resolved "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af" integrity sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg== string-template@~0.2.0: version "0.2.1" - resolved "https://registry.npmmirror.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" + resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" integrity sha512-Yptehjogou2xm4UJbxJ4CxgZx12HBfeystp0y3x7s4Dj32ltVVG1Gg8YhKjHZkHicuKpZX/ffilA8505VbUbpw== virtual-dom@^2.1.1: version "2.1.1" - resolved "https://registry.npmmirror.com/virtual-dom/-/virtual-dom-2.1.1.tgz#80eda2d481b9ede0c049118cefcb4a05f21d1375" + resolved "https://registry.yarnpkg.com/virtual-dom/-/virtual-dom-2.1.1.tgz#80eda2d481b9ede0c049118cefcb4a05f21d1375" integrity sha512-wb6Qc9Lbqug0kRqo/iuApfBpJJAq14Sk1faAnSmtqXiwahg7PVTvWMs9L02Z8nNIMqbwsxzBAA90bbtRLbw0zg== dependencies: browser-split "0.0.1" @@ -481,7 +481,7 @@ virtual-dom@^2.1.1: vite@^5.3.5: version "5.3.5" - resolved "https://registry.npmmirror.com/vite/-/vite-5.3.5.tgz#b847f846fb2b6cb6f6f4ed50a830186138cb83d8" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.3.5.tgz#b847f846fb2b6cb6f6f4ed50a830186138cb83d8" integrity sha512-MdjglKR6AQXQb9JGiS7Rc2wC6uMjcm7Go/NHNO63EwiJXfuk9PgqiP/n5IDJCziMkfw9n4Ubp7lttNwz+8ZVKA== dependencies: esbuild "^0.21.3" @@ -492,15 +492,15 @@ vite@^5.3.5: x-is-array@0.1.0: version "0.1.0" - resolved "https://registry.npmmirror.com/x-is-array/-/x-is-array-0.1.0.tgz#de520171d47b3f416f5587d629b89d26b12dc29d" + resolved "https://registry.yarnpkg.com/x-is-array/-/x-is-array-0.1.0.tgz#de520171d47b3f416f5587d629b89d26b12dc29d" integrity sha512-goHPif61oNrr0jJgsXRfc8oqtYzvfiMJpTqwE7Z4y9uH+T3UozkGqQ4d2nX9mB9khvA8U2o/UbPOFjgC7hLWIA== x-is-string@0.1.0: version "0.1.0" - resolved "https://registry.npmmirror.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" + resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" integrity sha512-GojqklwG8gpzOVEVki5KudKNoq7MbbjYZCbyWzEz7tyPA7eleiE0+ePwOWQQRb5fm86rD3S8Tc0tSFf3AOv50w== xtend@~4.0.0: version "4.0.2" - resolved "https://registry.npmmirror.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== From 7d6705c2243277ad278f9d7ca700b838aa7de4a1 Mon Sep 17 00:00:00 2001 From: tiye Date: Wed, 7 Aug 2024 01:38:08 +0800 Subject: [PATCH 02/11] refine style; add clear button --- assets/manifest.json | 2 +- calcit.cirru | 146 +++++++++++++++++++++++++++++++++++++------ compact.cirru | 34 +++++++--- 3 files changed, 151 insertions(+), 31 deletions(-) diff --git a/assets/manifest.json b/assets/manifest.json index c174c98..ceb7d39 100644 --- a/assets/manifest.json +++ b/assets/manifest.json @@ -10,6 +10,6 @@ "start_url": "/Termina/msg-buffer/index.html", "display": "standalone", "orientation": "portrait", - "background_color": "#8a47de", + "background_color": "#ffffff", "theme_color": "#ffffff" } \ No newline at end of file diff --git a/calcit.cirru b/calcit.cirru index 1273fc7..a6b9bab 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -237,16 +237,6 @@ :data $ {} |T $ %{} :Leaf (:at 1722482008623) (:by |rJG4IHzWf) (:text |:answer) |b $ %{} :Leaf (:at 1722482008623) (:by |rJG4IHzWf) (:text |state) - |b $ %{} :Expr (:at 1722482101445) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722482101445) (:by |rJG4IHzWf) (:text |=<) - |b $ %{} :Leaf (:at 1722482101445) (:by |rJG4IHzWf) (:text |2) - |h $ %{} :Leaf (:at 1722482101445) (:by |rJG4IHzWf) (:text |nil) - |h $ %{} :Expr (:at 1722482103855) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722482103855) (:by |rJG4IHzWf) (:text |<>) - |b $ %{} :Leaf (:at 1722482103855) (:by |rJG4IHzWf) (:text "|\"Copy raw") - |h $ %{} :Leaf (:at 1722482103855) (:by |rJG4IHzWf) (:text |css/font-fancy) |h $ %{} :Expr (:at 1722447922037) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722447926334) (:by |rJG4IHzWf) (:text |div) @@ -260,7 +250,7 @@ |h $ %{} :Expr (:at 1722447926334) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722447926334) (:by |rJG4IHzWf) (:text |<>) - |b $ %{} :Leaf (:at 1722448182876) (:by |rJG4IHzWf) (:text "|\"fetching more...") + |b $ %{} :Leaf (:at 1722965452159) (:by |rJG4IHzWf) (:text "|\"Streaming...") |h $ %{} :Expr (:at 1722448074846) (:by |rJG4IHzWf) :data $ {} |D $ %{} :Leaf (:at 1722448078258) (:by |rJG4IHzWf) (:text |str-spaced) @@ -394,6 +384,10 @@ :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:placeholder) |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text "|\"Content") + |j $ %{} :Expr (:at 1722965218570) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965219789) (:by |rJG4IHzWf) (:text |:id) + |b $ %{} :Leaf (:at 1722965223404) (:by |rJG4IHzWf) (:text "|\"message") |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:class-name) @@ -401,6 +395,8 @@ :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |str-spaced) |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/textarea) + |e $ %{} :Leaf (:at 1722964960984) (:by |rJG4IHzWf) (:text |css/font-code!) + |h $ %{} :Leaf (:at 1722964845813) (:by |rJG4IHzWf) (:text |style-textbox) |o $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:style) @@ -491,7 +487,7 @@ |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:inner-text) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text "|\"Ask") + |b $ %{} :Leaf (:at 1722965711522) (:by |rJG4IHzWf) (:text "|\"Generate") |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:on-click) @@ -518,6 +514,59 @@ |T $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |:content) |b $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |state) |h $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |d!) + |o $ %{} :Expr (:at 1722965020043) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965021333) (:by |rJG4IHzWf) (:text |if) + |b $ %{} :Expr (:at 1722965030750) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1722965031352) (:by |rJG4IHzWf) (:text |not) + |T $ %{} :Expr (:at 1722965024623) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1722965028235) (:by |rJG4IHzWf) (:text |blank?) + |T $ %{} :Expr (:at 1722965022922) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965022922) (:by |rJG4IHzWf) (:text |:content) + |b $ %{} :Leaf (:at 1722965022922) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Expr (:at 1722965069081) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965069081) (:by |rJG4IHzWf) (:text |comp-close) + |b $ %{} :Expr (:at 1722965070390) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965071425) (:by |rJG4IHzWf) (:text |{}) + |X $ %{} :Expr (:at 1722965084061) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965087170) (:by |rJG4IHzWf) (:text |:class-name) + |b $ %{} :Leaf (:at 1722965090173) (:by |rJG4IHzWf) (:text |style-clear) + |b $ %{} :Expr (:at 1722965071839) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965075272) (:by |rJG4IHzWf) (:text |:on-click) + |b $ %{} :Expr (:at 1722965075541) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965076006) (:by |rJG4IHzWf) (:text |fn) + |b $ %{} :Expr (:at 1722965076328) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965076541) (:by |rJG4IHzWf) (:text |e) + |b $ %{} :Leaf (:at 1722965077748) (:by |rJG4IHzWf) (:text |d!) + |h $ %{} :Expr (:at 1722965190406) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965191669) (:by |rJG4IHzWf) (:text |d!) + |b $ %{} :Leaf (:at 1722965192894) (:by |rJG4IHzWf) (:text |cursor) + |h $ %{} :Expr (:at 1722965193115) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965195162) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1722965196793) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Leaf (:at 1722965197792) (:by |rJG4IHzWf) (:text |:content) + |l $ %{} :Leaf (:at 1722965198275) (:by |rJG4IHzWf) (:text "|\"") + |l $ %{} :Expr (:at 1722965240723) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1722965241869) (:by |rJG4IHzWf) (:text |->) + |T $ %{} :Expr (:at 1722965226578) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965236898) (:by |rJG4IHzWf) (:text |js/document.querySelector) + |b $ %{} :Leaf (:at 1722965239062) (:by |rJG4IHzWf) (:text "|\"#message") + |b $ %{} :Expr (:at 1722965242717) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965247338) (:by |rJG4IHzWf) (:text |.!focus) |get-gemini-key! $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722448309409) (:by |rJG4IHzWf) :data $ {} @@ -610,6 +659,36 @@ :data $ {} |T $ %{} :Leaf (:at 1722963199934) (:by |rJG4IHzWf) (:text |:max-width) |b $ %{} :Leaf (:at 1722963203380) (:by |rJG4IHzWf) (:text "|\"90vw") + |style-clear $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1722965090807) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965092271) (:by |rJG4IHzWf) (:text |defstyle) + |b $ %{} :Leaf (:at 1722965090807) (:by |rJG4IHzWf) (:text |style-clear) + |h $ %{} :Expr (:at 1722965090807) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965093344) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1722965093978) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965096806) (:by |rJG4IHzWf) (:text "|\"&") + |b $ %{} :Expr (:at 1722965098318) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965098738) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1722965099188) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965102193) (:by |rJG4IHzWf) (:text |:position) + |b $ %{} :Leaf (:at 1722965106099) (:by |rJG4IHzWf) (:text |:absolute) + |h $ %{} :Expr (:at 1722965106982) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965108648) (:by |rJG4IHzWf) (:text |:right) + |b $ %{} :Leaf (:at 1722965154786) (:by |rJG4IHzWf) (:text |16) + |l $ %{} :Expr (:at 1722965112662) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965142049) (:by |rJG4IHzWf) (:text |:top) + |b $ %{} :Leaf (:at 1722965147856) (:by |rJG4IHzWf) (:text |16) + |o $ %{} :Expr (:at 1722965163000) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965169477) (:by |rJG4IHzWf) (:text |:opacity) + |b $ %{} :Leaf (:at 1722965172773) (:by |rJG4IHzWf) (:text |0.4) |style-message-box $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722963245314) (:by |rJG4IHzWf) :data $ {} @@ -645,7 +724,11 @@ |b $ %{} :Expr (:at 1722448089779) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722448103830) (:by |rJG4IHzWf) (:text |:text-align) - |b $ %{} :Leaf (:at 1722448105242) (:by |rJG4IHzWf) (:text |:center) + |b $ %{} :Leaf (:at 1722965423728) (:by |rJG4IHzWf) (:text |:center) + |e $ %{} :Expr (:at 1722965425416) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965427997) (:by |rJG4IHzWf) (:text |:width) + |b $ %{} :Leaf (:at 1722965432490) (:by |rJG4IHzWf) (:text |80) |h $ %{} :Expr (:at 1722448108516) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722448111955) (:by |rJG4IHzWf) (:text |:background-color) @@ -654,15 +737,19 @@ |T $ %{} :Leaf (:at 1722448112471) (:by |rJG4IHzWf) (:text |hsl) |b $ %{} :Leaf (:at 1722448112792) (:by |rJG4IHzWf) (:text |0) |h $ %{} :Leaf (:at 1722448112992) (:by |rJG4IHzWf) (:text |0) - |l $ %{} :Leaf (:at 1722448148883) (:by |rJG4IHzWf) (:text |90) + |l $ %{} :Leaf (:at 1722965470035) (:by |rJG4IHzWf) (:text |94) |l $ %{} :Expr (:at 1722448151431) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722448154884) (:by |rJG4IHzWf) (:text |:border-radius) |b $ %{} :Leaf (:at 1722448172596) (:by |rJG4IHzWf) (:text |12) - |o $ %{} :Expr (:at 1722448158152) (:by |rJG4IHzWf) + |o $ %{} :Expr (:at 1722965459445) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722448159438) (:by |rJG4IHzWf) (:text |:margin) - |b $ %{} :Leaf (:at 1722448164453) (:by |rJG4IHzWf) (:text |16) + |T $ %{} :Leaf (:at 1722965461805) (:by |rJG4IHzWf) (:text |:padding) + |b $ %{} :Leaf (:at 1722965465188) (:by |rJG4IHzWf) (:text "|\"4px 8px") + |q $ %{} :Expr (:at 1722965489176) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965490583) (:by |rJG4IHzWf) (:text |:margin) + |b $ %{} :Leaf (:at 1722965496076) (:by |rJG4IHzWf) (:text "|\"8px 0") |style-submit $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722963291408) (:by |rJG4IHzWf) :data $ {} @@ -683,12 +770,30 @@ |b $ %{} :Leaf (:at 1722963303008) (:by |rJG4IHzWf) (:text |:absolute) |h $ %{} :Expr (:at 1722963303602) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722963434218) (:by |rJG4IHzWf) (:text |:top) - |b $ %{} :Leaf (:at 1722963795189) (:by |rJG4IHzWf) (:text |-24) + |T $ %{} :Leaf (:at 1722964810780) (:by |rJG4IHzWf) (:text |:bottom) + |b $ %{} :Leaf (:at 1722964829568) (:by |rJG4IHzWf) (:text |16) |l $ %{} :Expr (:at 1722963303602) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722963394752) (:by |rJG4IHzWf) (:text |:right) - |b $ %{} :Leaf (:at 1722963390376) (:by |rJG4IHzWf) (:text |8) + |b $ %{} :Leaf (:at 1722964827048) (:by |rJG4IHzWf) (:text |16) + |style-textbox $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1722964846664) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722964848143) (:by |rJG4IHzWf) (:text |defstyle) + |b $ %{} :Leaf (:at 1722964846664) (:by |rJG4IHzWf) (:text |style-textbox) + |h $ %{} :Expr (:at 1722964846664) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722964849204) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1722964849581) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722964850614) (:by |rJG4IHzWf) (:text "|\"&") + |b $ %{} :Expr (:at 1722964850928) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722964851279) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1722964851770) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722964853950) (:by |rJG4IHzWf) (:text |:border-radius) + |b $ %{} :Leaf (:at 1722964870294) (:by |rJG4IHzWf) (:text |12) |submit-message! $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722409346610) (:by |rJG4IHzWf) :data $ {} @@ -1146,6 +1251,7 @@ |h $ %{} :Expr (:at 1722481924307) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722481924530) (:by |rJG4IHzWf) (:text |comp-copy) + |b $ %{} :Leaf (:at 1722965064837) (:by |rJG4IHzWf) (:text |comp-close) |app.config $ %{} :FileEntry :defs $ {} |dev? $ %{} :CodeEntry (:doc |) diff --git a/compact.cirru b/compact.cirru index e36268f..8e1f6c8 100644 --- a/compact.cirru +++ b/compact.cirru @@ -38,11 +38,9 @@ div {} $ :class-name (str-spaced css/row-middle) comp-copy $ :answer state - =< 2 nil - <> "\"Copy raw" css/font-fancy div {} $ :class-name style-more - <> "\"fetching more..." $ str-spaced css/font-fancy + <> "\"Streaming..." $ str-spaced css/font-fancy comp-message-box (>> states :message-box) fn (text d!) (submit-message! cursor state text d!) when dev? $ comp-reel (>> states :reel) reel ({}) @@ -60,7 +58,8 @@ textarea $ {} :value $ :content state :placeholder "\"Content" - :class-name $ str-spaced css/textarea + :id "\"message" + :class-name $ str-spaced css/textarea css/font-code! style-textbox :style $ {} (:height 160) (:width "\"100%") :on-input $ fn (e d!) d! cursor $ assoc state :content (:value e) @@ -72,10 +71,16 @@ on-submit (:content state) d! button $ {} :class-name $ str-spaced css/button style-submit - :inner-text "\"Ask" + :inner-text "\"Generate" :on-click $ fn (e d!) ; println $ :content state on-submit (:content state) d! + if + not $ blank? (:content state) + comp-close $ {} (:class-name style-clear) + :on-click $ fn (e d!) + d! cursor $ assoc state :content "\"" + -> (js/document.querySelector "\"#message") (.!focus) |get-gemini-key! $ %{} :CodeEntry (:doc |) :code $ quote defn get-gemini-key! () $ let @@ -97,6 +102,10 @@ defstyle style-app-global $ {} str "\"& ." style-code-block {} $ :max-width "\"90vw" + |style-clear $ %{} :CodeEntry (:doc |) + :code $ quote + defstyle style-clear $ {} + "\"&" $ {} (:position :absolute) (:right 16) (:top 16) (:opacity 0.4) |style-message-box $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-message-box $ {} @@ -104,14 +113,19 @@ |style-more $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-more $ {} - "\"&" $ {} (:text-align :center) - :background-color $ hsl 0 0 90 + "\"&" $ {} (:text-align :center) (:width 80) + :background-color $ hsl 0 0 94 :border-radius 12 - :margin 16 + :padding "\"4px 8px" + :margin "\"8px 0" |style-submit $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-submit $ {} - "\"&" $ {} (:position :absolute) (:top -24) (:right 8) + "\"&" $ {} (:position :absolute) (:bottom 16) (:right 16) + |style-textbox $ %{} :CodeEntry (:doc |) + :code $ quote + defstyle style-textbox $ {} + "\"&" $ {} (:border-radius 12) |submit-message! $ %{} :CodeEntry (:doc |) :code $ quote defn submit-message! (cursor state prompt-test d!) (hint-fn async) @@ -171,7 +185,7 @@ app.config :refer $ dev? "\"axios" :default axios respo-md.comp.md :refer $ comp-md-block style-code-block - respo-ui.comp :refer $ comp-copy + respo-ui.comp :refer $ comp-copy comp-close |app.config $ %{} :FileEntry :defs $ {} |dev? $ %{} :CodeEntry (:doc |) From 887c719300dfa7fb391d890c21520d249cdf3d72 Mon Sep 17 00:00:00 2001 From: tiye Date: Wed, 7 Aug 2024 13:35:58 +0800 Subject: [PATCH 03/11] refine scroll area and button offset to be smoother --- calcit.cirru | 120 +++++++++++++++++++++++++++----------------------- compact.cirru | 19 ++++---- 2 files changed, 75 insertions(+), 64 deletions(-) diff --git a/calcit.cirru b/calcit.cirru index a6b9bab..60ccb24 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -104,33 +104,11 @@ |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |:class-name) - |b $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |css/expand) - |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |:style) - |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) + |b $ %{} :Expr (:at 1723008316022) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |{}) - |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |:flex) - |b $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |2) - |h $ %{} :Expr (:at 1722445847706) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722445848855) (:by |rJG4IHzWf) (:text |:padding) - |b $ %{} :Leaf (:at 1722445912821) (:by |rJG4IHzWf) (:text "|\"40px 16px 200px 16px") - |l $ %{} :Expr (:at 1722963741928) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722963741928) (:by |rJG4IHzWf) (:text |:width) - |b $ %{} :Leaf (:at 1722963741928) (:by |rJG4IHzWf) (:text "|\"100%") - |q $ %{} :Expr (:at 1722963569534) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722963569534) (:by |rJG4IHzWf) (:text |:max-width) - |b $ %{} :Leaf (:at 1722963569534) (:by |rJG4IHzWf) (:text |1200) - |s $ %{} :Expr (:at 1722963569534) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722963569534) (:by |rJG4IHzWf) (:text |:margin) - |b $ %{} :Leaf (:at 1722963569534) (:by |rJG4IHzWf) (:text |:auto) + |D $ %{} :Leaf (:at 1723008319893) (:by |rJG4IHzWf) (:text |str-spaced) + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |css/expand) + |b $ %{} :Leaf (:at 1723008328732) (:by |rJG4IHzWf) (:text |style-message-list) |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |if) @@ -345,28 +323,6 @@ |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |str-spaced) |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/center) |l $ %{} :Leaf (:at 1722963242805) (:by |rJG4IHzWf) (:text |style-message-box) - |h $ %{} :Expr (:at 1722963593976) (:by |rJG4IHzWf) - :data $ {} - |D $ %{} :Leaf (:at 1722963595329) (:by |rJG4IHzWf) (:text |:style) - |T $ %{} :Expr (:at 1722963592731) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722963592731) (:by |rJG4IHzWf) (:text |{}) - |l $ %{} :Expr (:at 1722963592731) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722963592731) (:by |rJG4IHzWf) (:text |:max-width) - |b $ %{} :Leaf (:at 1722963592731) (:by |rJG4IHzWf) (:text |1200) - |m $ %{} :Expr (:at 1722963708864) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722963710075) (:by |rJG4IHzWf) (:text |:width) - |b $ %{} :Leaf (:at 1722963712837) (:by |rJG4IHzWf) (:text "|\"100%") - |n $ %{} :Expr (:at 1722963780723) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722963783181) (:by |rJG4IHzWf) (:text |:padding) - |b $ %{} :Leaf (:at 1722963785563) (:by |rJG4IHzWf) (:text "|\"8px") - |o $ %{} :Expr (:at 1722963592731) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722963592731) (:by |rJG4IHzWf) (:text |:margin) - |b $ %{} :Leaf (:at 1722963592731) (:by |rJG4IHzWf) (:text |:auto) |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |textarea) @@ -406,7 +362,7 @@ |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:height) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |160) + |b $ %{} :Leaf (:at 1723008299387) (:by |rJG4IHzWf) (:text "|\"200px") |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:width) @@ -679,12 +635,12 @@ |b $ %{} :Leaf (:at 1722965106099) (:by |rJG4IHzWf) (:text |:absolute) |h $ %{} :Expr (:at 1722965106982) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722965108648) (:by |rJG4IHzWf) (:text |:right) - |b $ %{} :Leaf (:at 1722965154786) (:by |rJG4IHzWf) (:text |16) + |T $ %{} :Leaf (:at 1723008928391) (:by |rJG4IHzWf) (:text |:left) + |b $ %{} :Leaf (:at 1723008934337) (:by |rJG4IHzWf) (:text |20) |l $ %{} :Expr (:at 1722965112662) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722965142049) (:by |rJG4IHzWf) (:text |:top) - |b $ %{} :Leaf (:at 1722965147856) (:by |rJG4IHzWf) (:text |16) + |T $ %{} :Leaf (:at 1723008930473) (:by |rJG4IHzWf) (:text |:bottom) + |b $ %{} :Leaf (:at 1723008936199) (:by |rJG4IHzWf) (:text |20) |o $ %{} :Expr (:at 1722965163000) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722965169477) (:by |rJG4IHzWf) (:text |:opacity) @@ -707,6 +663,60 @@ :data $ {} |T $ %{} :Leaf (:at 1722963255664) (:by |rJG4IHzWf) (:text |:position) |b $ %{} :Leaf (:at 1722963257811) (:by |rJG4IHzWf) (:text |:relative) + |l $ %{} :Expr (:at 1723008262315) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:max-width) + |b $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |1200) + |o $ %{} :Expr (:at 1723008262315) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:width) + |b $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text "|\"100%") + |q $ %{} :Expr (:at 1723008262315) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:padding) + |b $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text "|\"8px") + |s $ %{} :Expr (:at 1723008262315) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:margin) + |b $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:auto) + |style-message-list $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1723008329516) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723008330920) (:by |rJG4IHzWf) (:text |defstyle) + |b $ %{} :Leaf (:at 1723008329516) (:by |rJG4IHzWf) (:text |style-message-list) + |h $ %{} :Expr (:at 1723008329516) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723008332925) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1723008333369) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723008334008) (:by |rJG4IHzWf) (:text "|\"&") + |b $ %{} :Expr (:at 1723008334962) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723008334962) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1723008334962) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723008334962) (:by |rJG4IHzWf) (:text |:flex) + |b $ %{} :Leaf (:at 1723008334962) (:by |rJG4IHzWf) (:text |2) + |h $ %{} :Expr (:at 1723008334962) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723008334962) (:by |rJG4IHzWf) (:text |:padding) + |b $ %{} :Leaf (:at 1723008334962) (:by |rJG4IHzWf) (:text "|\"40px 16px 200px 16px") + |l $ %{} :Expr (:at 1723008334962) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723008334962) (:by |rJG4IHzWf) (:text |:width) + |b $ %{} :Leaf (:at 1723008334962) (:by |rJG4IHzWf) (:text "|\"100%") + |o $ %{} :Expr (:at 1723008334962) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723008334962) (:by |rJG4IHzWf) (:text |:max-width) + |b $ %{} :Leaf (:at 1723008334962) (:by |rJG4IHzWf) (:text |1200) + |q $ %{} :Expr (:at 1723008334962) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723008334962) (:by |rJG4IHzWf) (:text |:margin) + |b $ %{} :Leaf (:at 1723008334962) (:by |rJG4IHzWf) (:text |:auto) + |s $ %{} :Expr (:at 1723008341760) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723008364515) (:by |rJG4IHzWf) (:text |:overflow) + |T $ %{} :Leaf (:at 1723008743272) (:by |rJG4IHzWf) (:text |:scroll) |style-more $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722448082591) (:by |rJG4IHzWf) :data $ {} @@ -771,11 +781,11 @@ |h $ %{} :Expr (:at 1722963303602) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722964810780) (:by |rJG4IHzWf) (:text |:bottom) - |b $ %{} :Leaf (:at 1722964829568) (:by |rJG4IHzWf) (:text |16) + |b $ %{} :Leaf (:at 1723008946547) (:by |rJG4IHzWf) (:text |20) |l $ %{} :Expr (:at 1722963303602) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722963394752) (:by |rJG4IHzWf) (:text |:right) - |b $ %{} :Leaf (:at 1722964827048) (:by |rJG4IHzWf) (:text |16) + |b $ %{} :Leaf (:at 1723008950206) (:by |rJG4IHzWf) (:text |20) |style-textbox $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722964846664) (:by |rJG4IHzWf) :data $ {} diff --git a/compact.cirru b/compact.cirru index 8e1f6c8..264bf03 100644 --- a/compact.cirru +++ b/compact.cirru @@ -20,8 +20,7 @@ div {} $ :class-name (str-spaced css/preset css/global css/column css/fullscreen css/gap8 style-app-global) div - {} (:class-name css/expand) - :style $ {} (:flex 2) (:padding "\"40px 16px 200px 16px") (:width "\"100%") (:max-width 1200) (:margin :auto) + {} $ :class-name (str-spaced css/expand style-message-list) if (:loading? state) div ({}) (<> "\"loading..." css/font-fancy) if @@ -52,15 +51,13 @@ state $ either (:data states) {} $ :content "\"" div - {} - :class-name $ str-spaced css/center style-message-box - :style $ {} (:max-width 1200) (:width "\"100%") (:padding "\"8px") (:margin :auto) + {} $ :class-name (str-spaced css/center style-message-box) textarea $ {} :value $ :content state :placeholder "\"Content" :id "\"message" :class-name $ str-spaced css/textarea css/font-code! style-textbox - :style $ {} (:height 160) (:width "\"100%") + :style $ {} (:height "\"200px") (:width "\"100%") :on-input $ fn (e d!) d! cursor $ assoc state :content (:value e) :on-keydown $ fn (e d!) @@ -105,11 +102,15 @@ |style-clear $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-clear $ {} - "\"&" $ {} (:position :absolute) (:right 16) (:top 16) (:opacity 0.4) + "\"&" $ {} (:position :absolute) (:left 20) (:bottom 20) (:opacity 0.4) |style-message-box $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-message-box $ {} - "\"&" $ {} (:position :relative) + "\"&" $ {} (:position :relative) (:max-width 1200) (:width "\"100%") (:padding "\"8px") (:margin :auto) + |style-message-list $ %{} :CodeEntry (:doc |) + :code $ quote + defstyle style-message-list $ {} + "\"&" $ {} (:flex 2) (:padding "\"40px 16px 200px 16px") (:width "\"100%") (:max-width 1200) (:margin :auto) (:overflow :scroll) |style-more $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-more $ {} @@ -121,7 +122,7 @@ |style-submit $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-submit $ {} - "\"&" $ {} (:position :absolute) (:bottom 16) (:right 16) + "\"&" $ {} (:position :absolute) (:bottom 20) (:right 20) |style-textbox $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-textbox $ {} From 9eb9fa1a48e69a18739a0744a453606602806d43 Mon Sep 17 00:00:00 2001 From: tiye Date: Wed, 7 Aug 2024 13:43:14 +0800 Subject: [PATCH 04/11] float message box above --- calcit.cirru | 77 +++++++++++++++++++++++++++++++++++++++++---------- compact.cirru | 8 ++++-- 2 files changed, 67 insertions(+), 18 deletions(-) diff --git a/calcit.cirru b/calcit.cirru index 60ccb24..090fe46 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -233,6 +233,11 @@ :data $ {} |D $ %{} :Leaf (:at 1722448078258) (:by |rJG4IHzWf) (:text |str-spaced) |T $ %{} :Leaf (:at 1722447926334) (:by |rJG4IHzWf) (:text |css/font-fancy) + |l $ %{} :Expr (:at 1723009241406) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009242315) (:by |rJG4IHzWf) (:text |=<) + |b $ %{} :Leaf (:at 1723009244225) (:by |rJG4IHzWf) (:text |nil) + |h $ %{} :Leaf (:at 1723009245221) (:by |rJG4IHzWf) (:text |200) |r $ %{} :Expr (:at 1722536188689) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536196074) (:by |rJG4IHzWf) (:text |comp-message-box) @@ -353,20 +358,6 @@ |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/textarea) |e $ %{} :Leaf (:at 1722964960984) (:by |rJG4IHzWf) (:text |css/font-code!) |h $ %{} :Leaf (:at 1722964845813) (:by |rJG4IHzWf) (:text |style-textbox) - |o $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:style) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |{}) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:height) - |b $ %{} :Leaf (:at 1723008299387) (:by |rJG4IHzWf) (:text "|\"200px") - |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:width) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text "|\"100%") |q $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:on-input) @@ -662,7 +653,15 @@ |b $ %{} :Expr (:at 1722963253603) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722963255664) (:by |rJG4IHzWf) (:text |:position) - |b $ %{} :Leaf (:at 1722963257811) (:by |rJG4IHzWf) (:text |:relative) + |b $ %{} :Leaf (:at 1723009221445) (:by |rJG4IHzWf) (:text |:absolute) + |g $ %{} :Expr (:at 1723009224492) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009225607) (:by |rJG4IHzWf) (:text |:bottom) + |b $ %{} :Leaf (:at 1723009226474) (:by |rJG4IHzWf) (:text |0) + |i $ %{} :Expr (:at 1723009262069) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009264048) (:by |rJG4IHzWf) (:text |:opacity) + |b $ %{} :Leaf (:at 1723009381682) (:by |rJG4IHzWf) (:text |0.9) |l $ %{} :Expr (:at 1723008262315) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:max-width) @@ -671,6 +670,10 @@ :data $ {} |T $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:width) |b $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text "|\"100%") + |p $ %{} :Expr (:at 1723009676687) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009685327) (:by |rJG4IHzWf) (:text |:right) + |b $ %{} :Leaf (:at 1723009687437) (:by |rJG4IHzWf) (:text "|\"50%") |q $ %{} :Expr (:at 1723008262315) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:padding) @@ -679,6 +682,28 @@ :data $ {} |T $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:margin) |b $ %{} :Leaf (:at 1723008262315) (:by |rJG4IHzWf) (:text |:auto) + |t $ %{} :Expr (:at 1723009306927) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009310956) (:by |rJG4IHzWf) (:text |:transition-duration) + |b $ %{} :Leaf (:at 1723009322467) (:by |rJG4IHzWf) (:text "|\"300ms") + |u $ %{} :Expr (:at 1723009695319) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009698867) (:by |rJG4IHzWf) (:text |:transform) + |b $ %{} :Leaf (:at 1723009885600) (:by |rJG4IHzWf) (:text "|\"translate(50%,0)") + |h $ %{} :Expr (:at 1723009270885) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009298734) (:by |rJG4IHzWf) (:text "|\"&:focus-within") + |b $ %{} :Expr (:at 1723009276874) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009277352) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1723009277572) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009279238) (:by |rJG4IHzWf) (:text |:opacity) + |b $ %{} :Leaf (:at 1723009279508) (:by |rJG4IHzWf) (:text |1) + |h $ %{} :Expr (:at 1723009718408) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009718408) (:by |rJG4IHzWf) (:text |:transform) + |b $ %{} :Leaf (:at 1723009718408) (:by |rJG4IHzWf) (:text "|\"translate(50%,0)") |style-message-list $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1723008329516) (:by |rJG4IHzWf) :data $ {} @@ -804,6 +829,28 @@ :data $ {} |T $ %{} :Leaf (:at 1722964853950) (:by |rJG4IHzWf) (:text |:border-radius) |b $ %{} :Leaf (:at 1722964870294) (:by |rJG4IHzWf) (:text |12) + |l $ %{} :Expr (:at 1723010440562) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723010440562) (:by |rJG4IHzWf) (:text |:height) + |b $ %{} :Leaf (:at 1723010556927) (:by |rJG4IHzWf) (:text "|\"160px") + |o $ %{} :Expr (:at 1723010440562) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723010440562) (:by |rJG4IHzWf) (:text |:width) + |b $ %{} :Leaf (:at 1723010440562) (:by |rJG4IHzWf) (:text "|\"100%") + |q $ %{} :Expr (:at 1723010474462) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723010479048) (:by |rJG4IHzWf) (:text |:transition-duration) + |b $ %{} :Leaf (:at 1723010547772) (:by |rJG4IHzWf) (:text "|\"320ms") + |h $ %{} :Expr (:at 1722964849581) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723010457510) (:by |rJG4IHzWf) (:text "|\"&:focus-within") + |b $ %{} :Expr (:at 1722964850928) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722964851279) (:by |rJG4IHzWf) (:text |{}) + |l $ %{} :Expr (:at 1723010440562) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723010440562) (:by |rJG4IHzWf) (:text |:height) + |b $ %{} :Leaf (:at 1723010494761) (:by |rJG4IHzWf) (:text "|\"260px") |submit-message! $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722409346610) (:by |rJG4IHzWf) :data $ {} diff --git a/compact.cirru b/compact.cirru index 264bf03..0e20c1c 100644 --- a/compact.cirru +++ b/compact.cirru @@ -40,6 +40,7 @@ div {} $ :class-name style-more <> "\"Streaming..." $ str-spaced css/font-fancy + =< nil 200 comp-message-box (>> states :message-box) fn (text d!) (submit-message! cursor state text d!) when dev? $ comp-reel (>> states :reel) reel ({}) @@ -57,7 +58,6 @@ :placeholder "\"Content" :id "\"message" :class-name $ str-spaced css/textarea css/font-code! style-textbox - :style $ {} (:height "\"200px") (:width "\"100%") :on-input $ fn (e d!) d! cursor $ assoc state :content (:value e) :on-keydown $ fn (e d!) @@ -106,7 +106,8 @@ |style-message-box $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-message-box $ {} - "\"&" $ {} (:position :relative) (:max-width 1200) (:width "\"100%") (:padding "\"8px") (:margin :auto) + "\"&" $ {} (:position :absolute) (:bottom 0) (:opacity 0.9) (:max-width 1200) (:width "\"100%") (:right "\"50%") (:padding "\"8px") (:margin :auto) (:transition-duration "\"300ms") (:transform "\"translate(50%,0)") + "\"&:focus-within" $ {} (:opacity 1) (:transform "\"translate(50%,0)") |style-message-list $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-message-list $ {} @@ -126,7 +127,8 @@ |style-textbox $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-textbox $ {} - "\"&" $ {} (:border-radius 12) + "\"&" $ {} (:border-radius 12) (:height "\"160px") (:width "\"100%") (:transition-duration "\"320ms") + "\"&:focus-within" $ {} (:height "\"260px") |submit-message! $ %{} :CodeEntry (:doc |) :code $ quote defn submit-message! (cursor state prompt-test d!) (hint-fn async) From e337add42385a8e1955d88f45ba7c1ac00c579a1 Mon Sep 17 00:00:00 2001 From: tiye Date: Thu, 8 Aug 2024 16:33:27 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=20chrome=20ex?= =?UTF-8?q?tension=20=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ calcit.cirru | 38 ++++++++++++++++++++++-- compact.cirru | 10 +++++-- extension/content.js | 24 +++++++++++++++ extension/get-selected.mjs | 58 +++++++++++++++++++++++++++++++++++++ extension/manifest.json | 22 ++++++++++++++ extension/service-worker.js | 3 ++ package.json | 3 ++ 8 files changed, 154 insertions(+), 6 deletions(-) create mode 100644 extension/content.js create mode 100644 extension/get-selected.mjs create mode 100644 extension/manifest.json create mode 100644 extension/service-worker.js diff --git a/.gitignore b/.gitignore index 4788c7a..681614b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ node_modules/ dist/ .DS_Store + +extension/dist diff --git a/calcit.cirru b/calcit.cirru index 090fe46..2dab6de 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -860,7 +860,7 @@ :data $ {} |T $ %{} :Leaf (:at 1722409346610) (:by |rJG4IHzWf) (:text |cursor) |b $ %{} :Leaf (:at 1722409346610) (:by |rJG4IHzWf) (:text |state) - |e $ %{} :Leaf (:at 1722536402711) (:by |rJG4IHzWf) (:text |prompt-test) + |e $ %{} :Leaf (:at 1723105757947) (:by |rJG4IHzWf) (:text |prompt-text) |h $ %{} :Leaf (:at 1722410766404) (:by |rJG4IHzWf) (:text |d!) |l $ %{} :Expr (:at 1722409347984) (:by |rJG4IHzWf) :data $ {} @@ -881,7 +881,7 @@ |D $ %{} :Leaf (:at 1722536657601) (:by |rJG4IHzWf) (:text |do) |L $ %{} :Expr (:at 1722536659137) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536663086) (:by |rJG4IHzWf) (:text |js/console.log) + |T $ %{} :Leaf (:at 1723105985253) (:by |rJG4IHzWf) (:text |js/console.warn) |b $ %{} :Leaf (:at 1722536669226) (:by |rJG4IHzWf) (:text "|\"Aborting prev") |T $ %{} :Expr (:at 1722536625917) (:by |rJG4IHzWf) :data $ {} @@ -910,6 +910,31 @@ |T $ %{} :Leaf (:at 1722409352561) (:by |rJG4IHzWf) (:text |let) |b $ %{} :Expr (:at 1722409352561) (:by |rJG4IHzWf) :data $ {} + |D $ %{} :Expr (:at 1723105003222) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723105005485) (:by |rJG4IHzWf) (:text |selected) + |b $ %{} :Expr (:at 1723105009538) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723105011568) (:by |rJG4IHzWf) (:text |w-js-log) + |T $ %{} :Expr (:at 1723105005806) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723105008294) (:by |rJG4IHzWf) (:text |js-await) + |b $ %{} :Expr (:at 1723105137971) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723105008656) (:by |rJG4IHzWf) (:text |get-selected) + |L $ %{} :Expr (:at 1723105744388) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723105749368) (:by |rJG4IHzWf) (:text |content) + |b $ %{} :Expr (:at 1723105750725) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723105752174) (:by |rJG4IHzWf) (:text |.replace) + |b $ %{} :Leaf (:at 1723105759695) (:by |rJG4IHzWf) (:text |prompt-text) + |h $ %{} :Leaf (:at 1723105766407) (:by |rJG4IHzWf) (:text "|\"{{selected}}") + |l $ %{} :Expr (:at 1723105777610) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723105791996) (:by |rJG4IHzWf) (:text |or) + |T $ %{} :Leaf (:at 1723105771630) (:by |rJG4IHzWf) (:text |selected) + |b $ %{} :Leaf (:at 1723105788710) (:by |rJG4IHzWf) (:text "|\"<未找到内容>") |T $ %{} :Expr (:at 1722409352561) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722409352561) (:by |rJG4IHzWf) (:text |result) @@ -952,7 +977,7 @@ |b $ %{} :Expr (:at 1722410582786) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722410582786) (:by |rJG4IHzWf) (:text |:text) - |b $ %{} :Leaf (:at 1722536405448) (:by |rJG4IHzWf) (:text |prompt-test) + |b $ %{} :Leaf (:at 1723105794657) (:by |rJG4IHzWf) (:text |content) |b $ %{} :Expr (:at 1722410320737) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722410323567) (:by |rJG4IHzWf) (:text |js-object) @@ -1309,6 +1334,13 @@ :data $ {} |T $ %{} :Leaf (:at 1722481924530) (:by |rJG4IHzWf) (:text |comp-copy) |b $ %{} :Leaf (:at 1722965064837) (:by |rJG4IHzWf) (:text |comp-close) + |ze $ %{} :Expr (:at 1723104975584) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723104991690) (:by |rJG4IHzWf) (:text "|\"../extension/get-selected") + |b $ %{} :Leaf (:at 1723104992655) (:by |rJG4IHzWf) (:text |:refer) + |h $ %{} :Expr (:at 1723104992888) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723105000472) (:by |rJG4IHzWf) (:text |get-selected) |app.config $ %{} :FileEntry :defs $ {} |dev? $ %{} :CodeEntry (:doc |) diff --git a/compact.cirru b/compact.cirru index 0e20c1c..38e8bcf 100644 --- a/compact.cirru +++ b/compact.cirru @@ -131,19 +131,22 @@ "\"&:focus-within" $ {} (:height "\"260px") |submit-message! $ %{} :CodeEntry (:doc |) :code $ quote - defn submit-message! (cursor state prompt-test d!) (hint-fn async) + defn submit-message! (cursor state prompt-text d!) (hint-fn async) if-let abort $ deref *abort-control - do (js/console.log "\"Aborting prev") (.!abort abort) + do (js/console.warn "\"Aborting prev") (.!abort abort) d! cursor $ -> state (assoc :answer nil) (assoc :loading? true) let + selected $ w-js-log + js-await $ get-selected + content $ .replace prompt-text "\"{{selected}}" (or selected "\"<未找到内容>") result $ js-await .!post axios str "\"https://sf.chenyong.life/v1beta/models/" (pick-model) "\":streamGenerateContent" js-object $ :contents js-array $ js-object :parts $ js-array - js-object $ :text prompt-test + js-object $ :text content js-object :params $ js-object :key $ get-gemini-key! @@ -189,6 +192,7 @@ "\"axios" :default axios respo-md.comp.md :refer $ comp-md-block style-code-block respo-ui.comp :refer $ comp-copy comp-close + "\"../extension/get-selected" :refer $ get-selected |app.config $ %{} :FileEntry :defs $ {} |dev? $ %{} :CodeEntry (:doc |) diff --git a/extension/content.js b/extension/content.js new file mode 100644 index 0000000..1622aeb --- /dev/null +++ b/extension/content.js @@ -0,0 +1,24 @@ +// Listen for messages +chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) { + // If the received message has the expected format... + console.log("[Side Message] msg", msg) + if (msg.get === 'selected') { + // Call the specified callback, passing + // the web-page's DOM content as argument + sendResponse(getSelectedText()); + } +}); + +let getSelectedText = () => { + if (window.getSelection) { + // 标准浏览器 + return window.getSelection().toString(); + } else if (document.selection) { + // IE 浏览器 + return document.selection.createRange().text; + } else { + return "<未获取到内容>"; + } +} + +console.log("[Side Message] prepared content script") \ No newline at end of file diff --git a/extension/get-selected.mjs b/extension/get-selected.mjs new file mode 100644 index 0000000..fe525c5 --- /dev/null +++ b/extension/get-selected.mjs @@ -0,0 +1,58 @@ + +export let get_selected = () => { + return new Promise((resolve, reject) => { + if (chrome?.runtime?.id == null) { + console.warn("not chrome extension runtime...") + resolve(null) + return + } + console.log("calling content script...") + chrome.tabs.query({active: true, currentWindow: true}) + .then(x => { + let activeTab = x[0] + if (activeTab) { + let id = activeTab.id + chrome.tabs.sendMessage(id, {get: 'selected'}, function(response) { + // 接收来自 content.js 的返回数据 + // console.info('Content script returned: ' + response); + resolve(response) + }); + + } else { + reject("found not active tab") + } + }).catch((error) => { + console.error("Error", error) + }) + }) +} + + +// setTimeout(()=>{ +// chrome.tabs.query({active: true, currentWindow: true}).then(x => { +// let activeTab = x[0] +// if (activeTab) { +// let id = activeTab.id +// chrome.tabs.sendMessage(id, {get: 'selected'}, function(response) { +// // 接收来自 content.js 的返回数据 +// console.info('Content script returned: ' + response); +// }); + +// } else { +// throw Error("no active tab found") +// } +// }) +// }, 2000) + + +// chrome.scripting.executeScript({ +// target: { tabId: 1201634844 }, +// function: () => { console.log(document.body.innerText) } +// }); + + +// chrome.tabs.sendMessage(1201634844, {get: 'selected'}, function(response) { +// // 接收来自 content.js 的返回数据 +// console.info('Content script returned: ' + response.message); +// }); + diff --git a/extension/manifest.json b/extension/manifest.json new file mode 100644 index 0000000..df3dbe9 --- /dev/null +++ b/extension/manifest.json @@ -0,0 +1,22 @@ + +{ + "manifest_version": 3, + "name": "Side message", + "version": "1.0", + "description": "Shows how to display the same side panel on every site using the Side Panel API.", + "background": { + "service_worker": "service-worker.js" + }, + "action": { + "default_title": "Click to open panel" + }, + "content_scripts": [{ + "matches": [""], + "match_origin_as_fallback": true, + "js": ["content.js"] + }], + "side_panel": { + "default_path": "dist/index.html" + }, + "permissions": ["sidePanel", "scripting", "activeTab", "tabs"] +} diff --git a/extension/service-worker.js b/extension/service-worker.js new file mode 100644 index 0000000..4229606 --- /dev/null +++ b/extension/service-worker.js @@ -0,0 +1,3 @@ +chrome.runtime.onInstalled.addListener(() => { + chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true }); +}); \ No newline at end of file diff --git a/package.json b/package.json index 6e52b9c..f7b3e36 100644 --- a/package.json +++ b/package.json @@ -10,5 +10,8 @@ "bottom-tip": "^0.1.5", "vite": "^5.3.5" }, + "scripts": { + "build": "yarn vite build --base ./ && rm -rfv extension/dist && cp -vr dist extension/" + }, "version": "0.0.1" } From f2d897e99bea25c9c2588e95bae0a377066af7b5 Mon Sep 17 00:00:00 2001 From: tiye Date: Fri, 9 Aug 2024 01:47:23 +0800 Subject: [PATCH 06/11] refine scroll area; try handle some accidental stop; add extension icon --- calcit.cirru | 503 ++++++++++++++++++++++++++------------ compact.cirru | 82 ++++--- extension/gemini-icon.png | Bin 0 -> 3127 bytes extension/manifest.json | 7 +- vite.config.mjs | 7 + 5 files changed, 408 insertions(+), 191 deletions(-) create mode 100644 extension/gemini-icon.png create mode 100644 vite.config.mjs diff --git a/calcit.cirru b/calcit.cirru index 2dab6de..80ea3c1 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -95,51 +95,40 @@ |s $ %{} :Leaf (:at 1722963532093) (:by |rJG4IHzWf) (:text |css/fullscreen) |u $ %{} :Leaf (:at 1722445873663) (:by |rJG4IHzWf) (:text |css/gap8) |v $ %{} :Leaf (:at 1722963063278) (:by |rJG4IHzWf) (:text |style-app-global) - |l $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) + |l $ %{} :Expr (:at 1723139058342) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |div) - |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1723139059123) (:by |rJG4IHzWf) (:text |div) + |L $ %{} :Expr (:at 1723139059355) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |{}) - |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1723139062982) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1723139064362) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |:class-name) - |b $ %{} :Expr (:at 1723008316022) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1723139179143) (:by |rJG4IHzWf) (:text |:class-name) + |b $ %{} :Expr (:at 1723139148323) (:by |rJG4IHzWf) :data $ {} - |D $ %{} :Leaf (:at 1723008319893) (:by |rJG4IHzWf) (:text |str-spaced) - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |css/expand) - |b $ %{} :Leaf (:at 1723008328732) (:by |rJG4IHzWf) (:text |style-message-list) - |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1723139150711) (:by |rJG4IHzWf) (:text |str-spaced) + |L $ %{} :Leaf (:at 1723139151586) (:by |rJG4IHzWf) (:text |css/expand) + |T $ %{} :Leaf (:at 1723139071627) (:by |rJG4IHzWf) (:text |style-message-area) + |T $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |if) + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |div) |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |:loading?) - |b $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |state) - |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |div) + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |{}) |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |{}) - |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |<>) - |b $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text "|\"loading...") - |h $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |css/font-fancy) - |l $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |:class-name) + |b $ %{} :Expr (:at 1723008316022) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723008319893) (:by |rJG4IHzWf) (:text |str-spaced) + |b $ %{} :Leaf (:at 1723008328732) (:by |rJG4IHzWf) (:text |style-message-list) + |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |if) |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |not) - |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |blank?) - |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |:answer) - |b $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |state) + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |:loading?) + |b $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |state) |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |div) @@ -148,96 +137,120 @@ |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |{}) |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |comp-md-block) - |b $ %{} :Expr (:at 1722482337736) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |<>) + |b $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text "|\"loading...") + |h $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |css/font-fancy) + |l $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |if) + |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |not) + |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} - |D $ %{} :Leaf (:at 1722482338700) (:by |rJG4IHzWf) (:text |->) - |T $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |blank?) + |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |:answer) |b $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |state) - |b $ %{} :Expr (:at 1722482343883) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722482347320) (:by |rJG4IHzWf) (:text |either) - |b $ %{} :Leaf (:at 1722482347683) (:by |rJG4IHzWf) (:text "|\"") - |h $ %{} :Expr (:at 1722482348223) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722483575784) (:by |rJG4IHzWf) (:text |.!replace) - |b $ %{} :Leaf (:at 1722483515004) (:by |rJG4IHzWf) (:text |pattern-spaced-code) - |h $ %{} :Expr (:at 1722482611544) (:by |rJG4IHzWf) - :data $ {} - |D $ %{} :Leaf (:at 1722482616405) (:by |rJG4IHzWf) (:text |str) - |L $ %{} :Leaf (:at 1722482617960) (:by |rJG4IHzWf) (:text |&newline) - |T $ %{} :Leaf (:at 1722482626312) (:by |rJG4IHzWf) (:text "|\"```") - |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |{}) - |l $ %{} :Expr (:at 1722447914966) (:by |rJG4IHzWf) + |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722447915940) (:by |rJG4IHzWf) (:text |if) - |b $ %{} :Expr (:at 1722447920256) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |div) + |b $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722447919916) (:by |rJG4IHzWf) (:text |:done?) - |b $ %{} :Leaf (:at 1722447921137) (:by |rJG4IHzWf) (:text |state) - |e $ %{} :Expr (:at 1722482006086) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |{}) + |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722482007064) (:by |rJG4IHzWf) (:text |div) - |b $ %{} :Expr (:at 1722482007395) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |comp-md-block) + |b $ %{} :Expr (:at 1722482337736) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722482007688) (:by |rJG4IHzWf) (:text |{}) - |b $ %{} :Expr (:at 1722482015893) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1722482338700) (:by |rJG4IHzWf) (:text |->) + |T $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722482017960) (:by |rJG4IHzWf) (:text |:class-name) - |b $ %{} :Leaf (:at 1722482021013) (:by |rJG4IHzWf) (:text |css/row-parted) - |e $ %{} :Expr (:at 1722482010473) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722482011312) (:by |rJG4IHzWf) (:text |span) - |b $ %{} :Expr (:at 1722482012316) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |:answer) + |b $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |state) + |b $ %{} :Expr (:at 1722482343883) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722482347320) (:by |rJG4IHzWf) (:text |either) + |b $ %{} :Leaf (:at 1722482347683) (:by |rJG4IHzWf) (:text "|\"") + |h $ %{} :Expr (:at 1722482348223) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722482012629) (:by |rJG4IHzWf) (:text |{}) - |h $ %{} :Expr (:at 1722482028826) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722483575784) (:by |rJG4IHzWf) (:text |.!replace) + |b $ %{} :Leaf (:at 1722483515004) (:by |rJG4IHzWf) (:text |pattern-spaced-code) + |h $ %{} :Expr (:at 1722482611544) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1722482616405) (:by |rJG4IHzWf) (:text |str) + |L $ %{} :Leaf (:at 1722482617960) (:by |rJG4IHzWf) (:text |&newline) + |T $ %{} :Leaf (:at 1722482626312) (:by |rJG4IHzWf) (:text "|\"```") + |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |{}) + |l $ %{} :Expr (:at 1722447914966) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722447915940) (:by |rJG4IHzWf) (:text |if) + |b $ %{} :Expr (:at 1722447920256) (:by |rJG4IHzWf) :data $ {} - |D $ %{} :Leaf (:at 1722482030649) (:by |rJG4IHzWf) (:text |div) - |L $ %{} :Expr (:at 1722482031317) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722447919916) (:by |rJG4IHzWf) (:text |:done?) + |b $ %{} :Leaf (:at 1722447921137) (:by |rJG4IHzWf) (:text |state) + |e $ %{} :Expr (:at 1722482006086) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722482007064) (:by |rJG4IHzWf) (:text |div) + |b $ %{} :Expr (:at 1722482007395) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722482031618) (:by |rJG4IHzWf) (:text |{}) - |b $ %{} :Expr (:at 1722482032340) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722482007688) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1722482015893) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722482034831) (:by |rJG4IHzWf) (:text |:class-name) - |b $ %{} :Expr (:at 1722482060067) (:by |rJG4IHzWf) - :data $ {} - |D $ %{} :Leaf (:at 1722482062041) (:by |rJG4IHzWf) (:text |str-spaced) - |T $ %{} :Leaf (:at 1722482037621) (:by |rJG4IHzWf) (:text |css/row-middle) - |T $ %{} :Expr (:at 1722482008623) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722482017960) (:by |rJG4IHzWf) (:text |:class-name) + |b $ %{} :Leaf (:at 1722482021013) (:by |rJG4IHzWf) (:text |css/row-parted) + |e $ %{} :Expr (:at 1722482010473) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722482008623) (:by |rJG4IHzWf) (:text |comp-copy) - |b $ %{} :Expr (:at 1722482008623) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722482011312) (:by |rJG4IHzWf) (:text |span) + |b $ %{} :Expr (:at 1722482012316) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722482008623) (:by |rJG4IHzWf) (:text |:answer) - |b $ %{} :Leaf (:at 1722482008623) (:by |rJG4IHzWf) (:text |state) - |h $ %{} :Expr (:at 1722447922037) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722447926334) (:by |rJG4IHzWf) (:text |div) - |b $ %{} :Expr (:at 1722447926334) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722447926334) (:by |rJG4IHzWf) (:text |{}) - |b $ %{} :Expr (:at 1722448135667) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722482012629) (:by |rJG4IHzWf) (:text |{}) + |h $ %{} :Expr (:at 1722482028826) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722448139058) (:by |rJG4IHzWf) (:text |:class-name) - |b $ %{} :Leaf (:at 1722448139381) (:by |rJG4IHzWf) (:text |style-more) - |h $ %{} :Expr (:at 1722447926334) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1722482030649) (:by |rJG4IHzWf) (:text |div) + |L $ %{} :Expr (:at 1722482031317) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722482031618) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1722482032340) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722482034831) (:by |rJG4IHzWf) (:text |:class-name) + |b $ %{} :Expr (:at 1722482060067) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1722482062041) (:by |rJG4IHzWf) (:text |str-spaced) + |T $ %{} :Leaf (:at 1722482037621) (:by |rJG4IHzWf) (:text |css/row-middle) + |T $ %{} :Expr (:at 1722482008623) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722482008623) (:by |rJG4IHzWf) (:text |comp-copy) + |b $ %{} :Expr (:at 1722482008623) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722482008623) (:by |rJG4IHzWf) (:text |:answer) + |b $ %{} :Leaf (:at 1722482008623) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Expr (:at 1722447922037) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722447926334) (:by |rJG4IHzWf) (:text |<>) - |b $ %{} :Leaf (:at 1722965452159) (:by |rJG4IHzWf) (:text "|\"Streaming...") - |h $ %{} :Expr (:at 1722448074846) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722447926334) (:by |rJG4IHzWf) (:text |div) + |b $ %{} :Expr (:at 1722447926334) (:by |rJG4IHzWf) :data $ {} - |D $ %{} :Leaf (:at 1722448078258) (:by |rJG4IHzWf) (:text |str-spaced) - |T $ %{} :Leaf (:at 1722447926334) (:by |rJG4IHzWf) (:text |css/font-fancy) - |l $ %{} :Expr (:at 1723009241406) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1723009242315) (:by |rJG4IHzWf) (:text |=<) - |b $ %{} :Leaf (:at 1723009244225) (:by |rJG4IHzWf) (:text |nil) - |h $ %{} :Leaf (:at 1723009245221) (:by |rJG4IHzWf) (:text |200) + |T $ %{} :Leaf (:at 1722447926334) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1722448135667) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722448139058) (:by |rJG4IHzWf) (:text |:class-name) + |b $ %{} :Leaf (:at 1722448139381) (:by |rJG4IHzWf) (:text |style-more) + |h $ %{} :Expr (:at 1722447926334) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722447926334) (:by |rJG4IHzWf) (:text |<>) + |b $ %{} :Leaf (:at 1722965452159) (:by |rJG4IHzWf) (:text "|\"Streaming...") + |h $ %{} :Expr (:at 1722448074846) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1722448078258) (:by |rJG4IHzWf) (:text |str-spaced) + |T $ %{} :Leaf (:at 1722447926334) (:by |rJG4IHzWf) (:text |css/font-fancy) + |l $ %{} :Expr (:at 1723009241406) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723009242315) (:by |rJG4IHzWf) (:text |=<) + |b $ %{} :Leaf (:at 1723009244225) (:by |rJG4IHzWf) (:text |nil) + |h $ %{} :Leaf (:at 1723009245221) (:by |rJG4IHzWf) (:text |200) |r $ %{} :Expr (:at 1722536188689) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536196074) (:by |rJG4IHzWf) (:text |comp-message-box) @@ -514,6 +527,51 @@ |b $ %{} :Expr (:at 1722965242717) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722965247338) (:by |rJG4IHzWf) (:text |.!focus) + |first-line $ %{} :CodeEntry (:doc "|last message from error contains a line starts with \"data: \" and an extra error message. In order that JSON is parsed correctly, only first line is used now.") + :code $ %{} :Expr (:at 1723138240850) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138241954) (:by |rJG4IHzWf) (:text |defn) + |b $ %{} :Leaf (:at 1723138240850) (:by |rJG4IHzWf) (:text |first-line) + |h $ %{} :Expr (:at 1723138240850) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138248490) (:by |rJG4IHzWf) (:text |tt) + |l $ %{} :Expr (:at 1723138334253) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723138338084) (:by |rJG4IHzWf) (:text |let) + |T $ %{} :Expr (:at 1723138340627) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Expr (:at 1723138338877) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723138339723) (:by |rJG4IHzWf) (:text |lines) + |T $ %{} :Expr (:at 1723138249537) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138253165) (:by |rJG4IHzWf) (:text |.!split) + |b $ %{} :Leaf (:at 1723138253742) (:by |rJG4IHzWf) (:text |tt) + |h $ %{} :Leaf (:at 1723138256156) (:by |rJG4IHzWf) (:text |&newline) + |X $ %{} :Expr (:at 1723138503364) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723138504959) (:by |rJG4IHzWf) (:text |if) + |L $ %{} :Expr (:at 1723138505196) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138505476) (:by |rJG4IHzWf) (:text |>) + |X $ %{} :Expr (:at 1723138512446) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723138515134) (:by |rJG4IHzWf) (:text |.-length) + |T $ %{} :Leaf (:at 1723138508735) (:by |rJG4IHzWf) (:text |lines) + |b $ %{} :Leaf (:at 1723138506939) (:by |rJG4IHzWf) (:text |1) + |T $ %{} :Expr (:at 1723138351901) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138364853) (:by |rJG4IHzWf) (:text |js/console.warn) + |b $ %{} :Leaf (:at 1723138375520) (:by |rJG4IHzWf) (:text "|\"Droping some unexpected lines:") + |h $ %{} :Expr (:at 1723138517082) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723138518913) (:by |rJG4IHzWf) (:text |.!slice) + |T $ %{} :Leaf (:at 1723138369917) (:by |rJG4IHzWf) (:text |lines) + |b $ %{} :Leaf (:at 1723138520407) (:by |rJG4IHzWf) (:text |1) + |b $ %{} :Expr (:at 1723138344855) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138346137) (:by |rJG4IHzWf) (:text |.-0) + |b $ %{} :Leaf (:at 1723138348088) (:by |rJG4IHzWf) (:text |lines) |get-gemini-key! $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722448309409) (:by |rJG4IHzWf) :data $ {} @@ -606,6 +664,48 @@ :data $ {} |T $ %{} :Leaf (:at 1722963199934) (:by |rJG4IHzWf) (:text |:max-width) |b $ %{} :Leaf (:at 1722963203380) (:by |rJG4IHzWf) (:text "|\"90vw") + |h $ %{} :Expr (:at 1723137097778) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137098848) (:by |rJG4IHzWf) (:text "|\"&") + |b $ %{} :Expr (:at 1723137099199) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137099534) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1723137099776) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137100569) (:by |rJG4IHzWf) (:text |:color) + |b $ %{} :Leaf (:at 1723137233193) (:by |rJG4IHzWf) (:text "|\"#999") + |h $ %{} :Expr (:at 1723137152738) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137159216) (:by |rJG4IHzWf) (:text |:transition-duration) + |b $ %{} :Leaf (:at 1723137160974) (:by |rJG4IHzWf) (:text "|\"300ms") + |l $ %{} :Expr (:at 1723138789366) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138789366) (:by |rJG4IHzWf) (:text |:background-color) + |b $ %{} :Expr (:at 1723138789366) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138789366) (:by |rJG4IHzWf) (:text |hsl) + |b $ %{} :Leaf (:at 1723138789366) (:by |rJG4IHzWf) (:text |0) + |h $ %{} :Leaf (:at 1723138789366) (:by |rJG4IHzWf) (:text |0) + |l $ %{} :Leaf (:at 1723138835741) (:by |rJG4IHzWf) (:text |98) + |l $ %{} :Expr (:at 1723137097778) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137130651) (:by |rJG4IHzWf) (:text "|\"&:hover") + |b $ %{} :Expr (:at 1723137099199) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137099534) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1723137099776) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137100569) (:by |rJG4IHzWf) (:text |:color) + |b $ %{} :Leaf (:at 1723138711581) (:by |rJG4IHzWf) (:text "|\"#777") + |h $ %{} :Expr (:at 1723138918385) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138918385) (:by |rJG4IHzWf) (:text |:background-color) + |b $ %{} :Expr (:at 1723138918385) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138918385) (:by |rJG4IHzWf) (:text |hsl) + |b $ %{} :Leaf (:at 1723138918385) (:by |rJG4IHzWf) (:text |0) + |h $ %{} :Leaf (:at 1723138918385) (:by |rJG4IHzWf) (:text |0) + |l $ %{} :Leaf (:at 1723138920702) (:by |rJG4IHzWf) (:text |100) |style-clear $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722965090807) (:by |rJG4IHzWf) :data $ {} @@ -636,6 +736,28 @@ :data $ {} |T $ %{} :Leaf (:at 1722965169477) (:by |rJG4IHzWf) (:text |:opacity) |b $ %{} :Leaf (:at 1722965172773) (:by |rJG4IHzWf) (:text |0.4) + |style-message-area $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1723139076928) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723139078482) (:by |rJG4IHzWf) (:text |defstyle) + |b $ %{} :Leaf (:at 1723139076928) (:by |rJG4IHzWf) (:text |style-message-area) + |h $ %{} :Expr (:at 1723139080150) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723139080652) (:by |rJG4IHzWf) (:text |{}) + |T $ %{} :Expr (:at 1723139079328) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723139079328) (:by |rJG4IHzWf) (:text "|\"&") + |b $ %{} :Expr (:at 1723139079328) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723139079328) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1723139079328) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723139079328) (:by |rJG4IHzWf) (:text |:flex) + |b $ %{} :Leaf (:at 1723139079328) (:by |rJG4IHzWf) (:text |2) + |s $ %{} :Expr (:at 1723139079328) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723139079328) (:by |rJG4IHzWf) (:text |:overflow) + |b $ %{} :Leaf (:at 1723139079328) (:by |rJG4IHzWf) (:text |:scroll) |style-message-box $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722963245314) (:by |rJG4IHzWf) :data $ {} @@ -738,10 +860,6 @@ :data $ {} |T $ %{} :Leaf (:at 1723008334962) (:by |rJG4IHzWf) (:text |:margin) |b $ %{} :Leaf (:at 1723008334962) (:by |rJG4IHzWf) (:text |:auto) - |s $ %{} :Expr (:at 1723008341760) (:by |rJG4IHzWf) - :data $ {} - |D $ %{} :Leaf (:at 1723008364515) (:by |rJG4IHzWf) (:text |:overflow) - |T $ %{} :Leaf (:at 1723008743272) (:by |rJG4IHzWf) (:text |:scroll) |style-more $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722448082591) (:by |rJG4IHzWf) :data $ {} @@ -913,15 +1031,12 @@ |D $ %{} :Expr (:at 1723105003222) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1723105005485) (:by |rJG4IHzWf) (:text |selected) - |b $ %{} :Expr (:at 1723105009538) (:by |rJG4IHzWf) + |b $ %{} :Expr (:at 1723105005806) (:by |rJG4IHzWf) :data $ {} - |D $ %{} :Leaf (:at 1723105011568) (:by |rJG4IHzWf) (:text |w-js-log) - |T $ %{} :Expr (:at 1723105005806) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1723105008294) (:by |rJG4IHzWf) (:text |js-await) + |b $ %{} :Expr (:at 1723105137971) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1723105008294) (:by |rJG4IHzWf) (:text |js-await) - |b $ %{} :Expr (:at 1723105137971) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1723105008656) (:by |rJG4IHzWf) (:text |get-selected) + |T $ %{} :Leaf (:at 1723105008656) (:by |rJG4IHzWf) (:text |get-selected) |L $ %{} :Expr (:at 1723105744388) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1723105749368) (:by |rJG4IHzWf) (:text |content) @@ -1193,63 +1308,128 @@ |T $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |assoc) |b $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |:done?) |h $ %{} :Leaf (:at 1722448250705) (:by |rJG4IHzWf) (:text |true) - |l $ %{} :Expr (:at 1722447861509) (:by |rJG4IHzWf) + |l $ %{} :Expr (:at 1723137374067) (:by |rJG4IHzWf) :data $ {} - |D $ %{} :Leaf (:at 1722448041120) (:by |rJG4IHzWf) (:text |let) - |H $ %{} :Expr (:at 1722448042069) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1723137374808) (:by |rJG4IHzWf) (:text |let) + |L $ %{} :Expr (:at 1723137416402) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Expr (:at 1722448041599) (:by |rJG4IHzWf) + |T $ %{} :Expr (:at 1723137375217) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |content) - |b $ %{} :Expr (:at 1722448041599) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1723137974437) (:by |rJG4IHzWf) (:text |candidate0) + |b $ %{} :Expr (:at 1723137380973) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |->) - |b $ %{} :Expr (:at 1722448041599) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1723137380973) (:by |rJG4IHzWf) (:text |->) + |b $ %{} :Expr (:at 1723137380973) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |.!slice) - |b $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |value) - |h $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |6) - |h $ %{} :Expr (:at 1722448041599) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1723137380973) (:by |rJG4IHzWf) (:text |.!slice) + |b $ %{} :Leaf (:at 1723137380973) (:by |rJG4IHzWf) (:text |value) + |h $ %{} :Leaf (:at 1723137380973) (:by |rJG4IHzWf) (:text |6) + |e $ %{} :Expr (:at 1723137672216) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |js/JSON.parse) - |l $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |.-candidates) - |o $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |.-0) - |q $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |.-content) - |s $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |.-parts) - |t $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |.-0) - |u $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |.-text) - |J $ %{} :Expr (:at 1722448044752) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722448044752) (:by |rJG4IHzWf) (:text |swap!) - |b $ %{} :Leaf (:at 1722448044752) (:by |rJG4IHzWf) (:text |*text) - |h $ %{} :Leaf (:at 1722448044752) (:by |rJG4IHzWf) (:text |str) - |l $ %{} :Leaf (:at 1722448044752) (:by |rJG4IHzWf) (:text |content) - |L $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1723137674405) (:by |rJG4IHzWf) (:text |.!trim) + |f $ %{} :Expr (:at 1723138235994) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138240172) (:by |rJG4IHzWf) (:text |first-line) + |h $ %{} :Expr (:at 1723137380973) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137380973) (:by |rJG4IHzWf) (:text |js/JSON.parse) + |l $ %{} :Leaf (:at 1723137380973) (:by |rJG4IHzWf) (:text |.-candidates) + |o $ %{} :Leaf (:at 1723137380973) (:by |rJG4IHzWf) (:text |.-0) + |b $ %{} :Expr (:at 1723137391753) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138100284) (:by |rJG4IHzWf) (:text |content) + |b $ %{} :Expr (:at 1723137407253) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723138102079) (:by |rJG4IHzWf) (:text |.-content) + |T $ %{} :Leaf (:at 1723137976419) (:by |rJG4IHzWf) (:text |candidate0) + |T $ %{} :Expr (:at 1723137417777) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |d!) - |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |cursor) - |h $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1723137418320) (:by |rJG4IHzWf) (:text |if) + |L $ %{} :Expr (:at 1723137418558) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723138114308) (:by |rJG4IHzWf) (:text |nil?) + |T $ %{} :Leaf (:at 1723138109237) (:by |rJG4IHzWf) (:text |content) + |P $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |d!) + |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |cursor) + |h $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |->) + |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |:answer) + |h $ %{} :Expr (:at 1723137469574) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723137470405) (:by |rJG4IHzWf) (:text |str) + |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |@*text) + |b $ %{} :Leaf (:at 1723137476174) (:by |rJG4IHzWf) (:text |&newline) + |e $ %{} :Leaf (:at 1723138001847) (:by |rJG4IHzWf) (:text "|\"[STOPPED: ") + |h $ %{} :Expr (:at 1723138119344) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138121086) (:by |rJG4IHzWf) (:text |.-finishReason) + |b $ %{} :Leaf (:at 1723138124567) (:by |rJG4IHzWf) (:text |candidate0) + |l $ %{} :Leaf (:at 1723137484158) (:by |rJG4IHzWf) (:text "|\"]") + |l $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |:loading?) + |h $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |false) + |o $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |:done?) + |h $ %{} :Leaf (:at 1723137456297) (:by |rJG4IHzWf) (:text |true) + |T $ %{} :Expr (:at 1722447861509) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |->) - |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |state) - |h $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1722448041120) (:by |rJG4IHzWf) (:text |let) + |H $ %{} :Expr (:at 1722448042069) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Expr (:at 1722448041599) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |content) + |b $ %{} :Expr (:at 1722448041599) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |->) + |f $ %{} :Leaf (:at 1723137978688) (:by |rJG4IHzWf) (:text |candidate0) + |l $ %{} :Leaf (:at 1723137969776) (:by |rJG4IHzWf) (:text |.-content) + |s $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |.-parts) + |t $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |.-0) + |u $ %{} :Leaf (:at 1722448041599) (:by |rJG4IHzWf) (:text |.-text) + |J $ %{} :Expr (:at 1722448044752) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |:answer) - |h $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |@*text) - |l $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722448044752) (:by |rJG4IHzWf) (:text |swap!) + |b $ %{} :Leaf (:at 1722448044752) (:by |rJG4IHzWf) (:text |*text) + |h $ %{} :Leaf (:at 1722448044752) (:by |rJG4IHzWf) (:text |str) + |l $ %{} :Leaf (:at 1722448044752) (:by |rJG4IHzWf) (:text |content) + |L $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |:loading?) - |h $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |false) - |o $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |d!) + |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |cursor) + |h $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |->) + |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |:answer) + |h $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |@*text) + |l $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |:loading?) + |h $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |false) + |o $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |:done?) + |h $ %{} :Leaf (:at 1722448253956) (:by |rJG4IHzWf) (:text |false) + |T $ %{} :Expr (:at 1722447641142) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |:done?) - |h $ %{} :Leaf (:at 1722448253956) (:by |rJG4IHzWf) (:text |false) - |T $ %{} :Expr (:at 1722447641142) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722447642246) (:by |rJG4IHzWf) (:text |recur) + |T $ %{} :Leaf (:at 1722447642246) (:by |rJG4IHzWf) (:text |recur) :ns $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1499755354983) (:by nil) :data $ {} @@ -1513,6 +1693,7 @@ |T $ %{} :Leaf (:at 1533919515671) (:by |rJG4IHzWf) (:text |persist-storage!) |yO $ %{} :Expr (:at 1646150039456) (:by |rJG4IHzWf) :data $ {} + |5 $ %{} :Leaf (:at 1723138480153) (:by |rJG4IHzWf) (:text |;) |D $ %{} :Leaf (:at 1646150045747) (:by |rJG4IHzWf) (:text |flipped) |T $ %{} :Leaf (:at 1646150042154) (:by |rJG4IHzWf) (:text |js/setInterval) |b $ %{} :Leaf (:at 1646150175987) (:by |rJG4IHzWf) (:text |60000) diff --git a/compact.cirru b/compact.cirru index 38e8bcf..2c028f1 100644 --- a/compact.cirru +++ b/compact.cirru @@ -20,27 +20,29 @@ div {} $ :class-name (str-spaced css/preset css/global css/column css/fullscreen css/gap8 style-app-global) div - {} $ :class-name (str-spaced css/expand style-message-list) - if (:loading? state) - div ({}) (<> "\"loading..." css/font-fancy) - if - not $ blank? (:answer state) - div ({}) - comp-md-block - -> (:answer state) (either "\"") - .!replace pattern-spaced-code $ str &newline "\"```" - {} - if (:done? state) - div - {} $ :class-name css/row-parted - span $ {} + {} $ :class-name (str-spaced css/expand style-message-area) + div + {} $ :class-name (str-spaced style-message-list) + if (:loading? state) + div ({}) (<> "\"loading..." css/font-fancy) + if + not $ blank? (:answer state) + div ({}) + comp-md-block + -> (:answer state) (either "\"") + .!replace pattern-spaced-code $ str &newline "\"```" + {} + if (:done? state) + div + {} $ :class-name css/row-parted + span $ {} + div + {} $ :class-name (str-spaced css/row-middle) + comp-copy $ :answer state div - {} $ :class-name (str-spaced css/row-middle) - comp-copy $ :answer state - div - {} $ :class-name style-more - <> "\"Streaming..." $ str-spaced css/font-fancy - =< nil 200 + {} $ :class-name style-more + <> "\"Streaming..." $ str-spaced css/font-fancy + =< nil 200 comp-message-box (>> states :message-box) fn (text d!) (submit-message! cursor state text d!) when dev? $ comp-reel (>> states :reel) reel ({}) @@ -78,6 +80,15 @@ :on-click $ fn (e d!) d! cursor $ assoc state :content "\"" -> (js/document.querySelector "\"#message") (.!focus) + |first-line $ %{} :CodeEntry (:doc "|last message from error contains a line starts with \"data: \" and an extra error message. In order that JSON is parsed correctly, only first line is used now.") + :code $ quote + defn first-line (tt) + let + lines $ .!split tt &newline + if + > (.-length lines) 1 + js/console.warn "\"Droping some unexpected lines:" $ .!slice lines 1 + .-0 lines |get-gemini-key! $ %{} :CodeEntry (:doc |) :code $ quote defn get-gemini-key! () $ let @@ -99,10 +110,18 @@ defstyle style-app-global $ {} str "\"& ." style-code-block {} $ :max-width "\"90vw" + "\"&" $ {} (:color "\"#999") (:transition-duration "\"300ms") + :background-color $ hsl 0 0 98 + "\"&:hover" $ {} (:color "\"#777") + :background-color $ hsl 0 0 100 |style-clear $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-clear $ {} "\"&" $ {} (:position :absolute) (:left 20) (:bottom 20) (:opacity 0.4) + |style-message-area $ %{} :CodeEntry (:doc |) + :code $ quote + defstyle style-message-area $ {} + "\"&" $ {} (:flex 2) (:overflow :scroll) |style-message-box $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-message-box $ {} @@ -111,7 +130,7 @@ |style-message-list $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-message-list $ {} - "\"&" $ {} (:flex 2) (:padding "\"40px 16px 200px 16px") (:width "\"100%") (:max-width 1200) (:margin :auto) (:overflow :scroll) + "\"&" $ {} (:flex 2) (:padding "\"40px 16px 200px 16px") (:width "\"100%") (:max-width 1200) (:margin :auto) |style-more $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-more $ {} @@ -137,8 +156,7 @@ do (js/console.warn "\"Aborting prev") (.!abort abort) d! cursor $ -> state (assoc :answer nil) (assoc :loading? true) let - selected $ w-js-log - js-await $ get-selected + selected $ js-await (get-selected) content $ .replace prompt-text "\"{{selected}}" (or selected "\"<未找到内容>") result $ js-await .!post axios @@ -176,10 +194,18 @@ if done? d! cursor $ -> state (assoc :answer @*text) (assoc :loading? false) (assoc :done? true) let - content $ -> (.!slice value 6) (js/JSON.parse) .-candidates .-0 .-content .-parts .-0 .-text - swap! *text str content - d! cursor $ -> state (assoc :answer @*text) (assoc :loading? false) (assoc :done? false) - recur + candidate0 $ -> (.!slice value 6) (.!trim) (first-line) (js/JSON.parse) .-candidates .-0 + content $ .-content candidate0 + if (nil? content) + d! cursor $ -> state + assoc :answer $ str @*text &newline "\"[STOPPED: " (.-finishReason candidate0) "\"]" + assoc :loading? false + assoc :done? true + let + content $ -> candidate0 .-content .-parts .-0 .-text + swap! *text str content + d! cursor $ -> state (assoc :answer @*text) (assoc :loading? false) (assoc :done? false) + recur :ns $ %{} :CodeEntry (:doc |) :code $ quote ns app.comp.container $ :require (respo-ui.css :as css) @@ -226,7 +252,7 @@ js/window.addEventListener |beforeunload $ fn (event) (persist-storage!) js/window.addEventListener |visibilitychange $ fn (event) if (= "\"hidden" js/document.visibilityState) (persist-storage!) - flipped js/setInterval 60000 persist-storage! + ; flipped js/setInterval 60000 persist-storage! let raw $ js/localStorage.getItem (:storage-key config/site) when (some? raw) diff --git a/extension/gemini-icon.png b/extension/gemini-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..cdbda4159bb348e7cd47659f927adb700c63c17b GIT binary patch literal 3127 zcmV-749N3|P)eOo`M!kl0p)(PMtiT7uAEf6iWj&qIyZk!Zkcddo4E z+;MlwE1BMQb;xRZ%Y1UiaCpjqaK$5?;e>9)hi$`tam9*j!T_A&iCnxNjM$B0zR}k1 zUUSLy_4@#o-j$)*?C$tsZpVDEOZXJu9DD0 ze9y|@^scqwb%W1YYsXAs!@|hudWzAszT{SL$%K>Cm8aZsk=3B8-FBMT%FpYMnbv)y z+&_NMtFqsny5-2r>ATVGU!B~dquFt*;fICIZDzxWddb1K;G2ca(CGJu#_iJ_Mf91W1Shd@fn_?$Z zxhcy+pDxr>S(Z;#-phzlT?G&doodFAP!>7WoHZfg8SiDpC>>BP@m@xJ8tNu3Df_$^ z5}U>*p|~6I1iG|TD!t>qkl1u88-&7E#I9lz3R@A+O_P>N=e(B^lVmf5rE;0~QsU9n zq~)@pHvO$RB`lxwUQ8@fW+tr&Y16Kqa3rEl!SP-$nI^4N&Ur5Di%lL%-qhJve%@=;_~mj7Z#O^ zf_Tdy%1ZT%(v2 zXo>eC!{|@NMu-k!x|2<>UvrqW;vk$MrnfykuAxop2;$OGZjtvwgKDhQJSMF;GpSCv zlvbY(`!z42*Q84jF`Yi$sIi$;7w^Re(XN6cEEc_lDXjZ{L66q(4UOHT(5I<8Wc2!` zNt;X|1c+(7$2i`oAxyfACtOZ_m6jjA; ze}iCBM6J*X7avn|%IH~ugiMMeTzpJP;a68zH*6*?F`5*rnvMhi1_0bZE=hj(XfS(cwIpVAs|dB;&r3Zpqi9e?yDAHLFy#0E~<^jl#pUlH=)(B%|cj^ zq(VJm4P0;CMc8a2PWLP(Ef|E7)Jaqu-o3E_(oBjhhK>;Ggi-jpz zvT=L!Y#kLs$2RnFaPpYc5VxE<{4_8Caodn(n2*h*(u}aKwYY@we(>a(H-z}En_yB` z$Ch`+u)bE;<{w57KmbTJsaftT)EE*>3JBNMwAOq(9QDWG$rCGto^nq&DXk}UniLWO z#)mof;ZR_O-k=cB~%CjVXLJb##uQ4-`3NoxDYyG=x>0gPQl?=(0nnXjJdo||;madREPDs{uU58QbdC@*m^9chA45pYGbloWZU1qeZ#>qhR}Z|WeTAWlX@sMAV_NNz2SF4 z46%fSDI%_+!Q>gbN!bD2F=W_>9+Tpa710dy1Dh1WA@`vh6XsHECJks(wmgF`_tY5b zxs<&w4)4EC>mkad>v5QrDbHZ&{M18Bs@2nkH7VmTUkaK@p)-F8I)^j*Qg)NdtOJ^8 zdQyWgeDgg$8X}9K)1;9O^XVO1csxS~cRO}M=215Tp*@p&Cc%^tw!uL^vLSKrelTFk zq`0p|Lz~o_NkRA`9=d)1Gzel+mRdm^=Iex>Od9!|Mi-m~M|t)Q(v#|VG0oa^MtC6; zLAm!mg0h>m)sAgm3e^LQzRErG!HGD`p8>YChq!M`hu1gH(B&Tc=$WY}#oxy`=cIAp zTRoB`=0m>hyxyMN-UR7M!_G0%&MR{KiQ?`?5d3z;S#hWX_`(HD7~kdR7zRH?U6dco7DKVtCSq;@w&wKr0Fh&Gc6KF-RW%CoVuD2 zrif`gQh4=~aJo<4Ph1Ak(FB)g67|!FVWbBUS?8k1|hN9&eAhqKp;K_5^N94gK4ZI&=J`APxelM(9M7$$aSuI0|-3?2ZQNgTMz1Lwm{nbH)+r zQs|xy>WcrLY>Zh)f)@*Tk0^Mt$f%FJR}i~IyjF869bapQk;o$qLvt^O{{vlu#dyz4 RCTIWv002ovPDHLkV1l548aDs{ literal 0 HcmV?d00001 diff --git a/extension/manifest.json b/extension/manifest.json index df3dbe9..d83e7b1 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -1,15 +1,18 @@ { "manifest_version": 3, - "name": "Side message", + "name": "Msg Gemini", "version": "1.0", - "description": "Shows how to display the same side panel on every site using the Side Panel API.", + "description": "interact with Gemini", "background": { "service_worker": "service-worker.js" }, "action": { "default_title": "Click to open panel" }, + "icons": { + "128": "gemini-icon.png" + }, "content_scripts": [{ "matches": [""], "match_origin_as_fallback": true, diff --git a/vite.config.mjs b/vite.config.mjs new file mode 100644 index 0000000..8aef6af --- /dev/null +++ b/vite.config.mjs @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite'; + +export default defineConfig({ + build: { + minify: false + } +}); From 12bfc8f910147569151419a6fa63deb6db39d85a Mon Sep 17 00:00:00 2001 From: tiye Date: Fri, 9 Aug 2024 01:55:25 +0800 Subject: [PATCH 07/11] refine some paragraph style --- calcit.cirru | 26 ++++++++++++++++++++++++++ compact.cirru | 6 +++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/calcit.cirru b/calcit.cirru index 80ea3c1..da1fc10 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -185,6 +185,10 @@ |h $ %{} :Expr (:at 1722445823902) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722445823902) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1723139374389) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723139378423) (:by |rJG4IHzWf) (:text |:class-name) + |b $ %{} :Leaf (:at 1723139382884) (:by |rJG4IHzWf) (:text |style-md-content) |l $ %{} :Expr (:at 1722447914966) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722447915940) (:by |rJG4IHzWf) (:text |if) @@ -736,6 +740,28 @@ :data $ {} |T $ %{} :Leaf (:at 1722965169477) (:by |rJG4IHzWf) (:text |:opacity) |b $ %{} :Leaf (:at 1722965172773) (:by |rJG4IHzWf) (:text |0.4) + |style-md-content $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1723139383524) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723139384896) (:by |rJG4IHzWf) (:text |defstyle) + |b $ %{} :Leaf (:at 1723139383524) (:by |rJG4IHzWf) (:text |style-md-content) + |h $ %{} :Expr (:at 1723139383524) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723139385970) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1723139386254) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723139390693) (:by |rJG4IHzWf) (:text "|\"& .md-p") + |b $ %{} :Expr (:at 1723139392069) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723139392450) (:by |rJG4IHzWf) (:text |{}) + |b $ %{} :Expr (:at 1723139392978) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723139431096) (:by |rJG4IHzWf) (:text |:margin) + |b $ %{} :Leaf (:at 1723139692210) (:by |rJG4IHzWf) (:text "|\"16px 0") + |h $ %{} :Expr (:at 1723139665907) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723139669967) (:by |rJG4IHzWf) (:text |:line-height) + |b $ %{} :Leaf (:at 1723139676730) (:by |rJG4IHzWf) (:text "|\"1.6") |style-message-area $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1723139076928) (:by |rJG4IHzWf) :data $ {} diff --git a/compact.cirru b/compact.cirru index 2c028f1..40f9fca 100644 --- a/compact.cirru +++ b/compact.cirru @@ -31,7 +31,7 @@ comp-md-block -> (:answer state) (either "\"") .!replace pattern-spaced-code $ str &newline "\"```" - {} + {} $ :class-name style-md-content if (:done? state) div {} $ :class-name css/row-parted @@ -118,6 +118,10 @@ :code $ quote defstyle style-clear $ {} "\"&" $ {} (:position :absolute) (:left 20) (:bottom 20) (:opacity 0.4) + |style-md-content $ %{} :CodeEntry (:doc |) + :code $ quote + defstyle style-md-content $ {} + "\"& .md-p" $ {} (:margin "\"16px 0") (:line-height "\"1.6") |style-message-area $ %{} :CodeEntry (:doc |) :code $ quote defstyle style-message-area $ {} From 0538866887d0aac615406d15685ac2f06cd7f38e Mon Sep 17 00:00:00 2001 From: tiye Date: Fri, 9 Aug 2024 11:32:13 +0800 Subject: [PATCH 08/11] add content menu entrance --- calcit.cirru | 333 ++++++++++++++++++++++++++---------- compact.cirru | 47 +++-- extension/get-selected.mjs | 52 +++--- extension/manifest.json | 15 +- extension/service-worker.js | 16 +- 5 files changed, 321 insertions(+), 142 deletions(-) diff --git a/calcit.cirru b/calcit.cirru index da1fc10..5bee504 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -277,10 +277,10 @@ |h $ %{} :Leaf (:at 1722536447091) (:by |rJG4IHzWf) (:text |state) |j $ %{} :Leaf (:at 1722536453018) (:by |rJG4IHzWf) (:text |text) |l $ %{} :Leaf (:at 1722536447091) (:by |rJG4IHzWf) (:text |d!) - |x $ %{} :Expr (:at 1521954055333) (:by |root) + |x $ %{} :Expr (:at 1723173383483) (:by |rJG4IHzWf) :data $ {} - |D $ %{} :Leaf (:at 1521954057510) (:by |root) (:text |when) - |L $ %{} :Leaf (:at 1521954059290) (:by |root) (:text |dev?) + |D $ %{} :Leaf (:at 1723173387100) (:by |rJG4IHzWf) (:text |if) + |L $ %{} :Leaf (:at 1723173385793) (:by |rJG4IHzWf) (:text |dev?) |T $ %{} :Expr (:at 1507461809635) (:by |root) :data $ {} |T $ %{} :Leaf (:at 1507461815046) (:by |root) (:text |comp-reel) @@ -293,6 +293,16 @@ |r $ %{} :Expr (:at 1507461840980) (:by |root) :data $ {} |T $ %{} :Leaf (:at 1507461841342) (:by |root) (:text |{}) + |y $ %{} :Expr (:at 1723173388477) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173388840) (:by |rJG4IHzWf) (:text |if) + |b $ %{} :Leaf (:at 1723173389843) (:by |rJG4IHzWf) (:text |dev?) + |h $ %{} :Expr (:at 1723173390639) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173394293) (:by |rJG4IHzWf) (:text |comp-inspect) + |b $ %{} :Leaf (:at 1723173396026) (:by |rJG4IHzWf) (:text "|\"Store") + |h $ %{} :Leaf (:at 1723173397494) (:by |rJG4IHzWf) (:text |store) + |l $ %{} :Leaf (:at 1723173398573) (:by |rJG4IHzWf) (:text |nil) |comp-message-box $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1722536204293) (:by |rJG4IHzWf) :data $ {} @@ -1034,21 +1044,25 @@ |m $ %{} :Expr (:at 1722410955319) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722410956193) (:by |rJG4IHzWf) (:text |d!) - |b $ %{} :Leaf (:at 1722410960296) (:by |rJG4IHzWf) (:text |cursor) - |h $ %{} :Expr (:at 1722425554217) (:by |rJG4IHzWf) + |h $ %{} :Expr (:at 1723173639734) (:by |rJG4IHzWf) :data $ {} - |D $ %{} :Leaf (:at 1722425555359) (:by |rJG4IHzWf) (:text |->) - |L $ %{} :Leaf (:at 1722425557287) (:by |rJG4IHzWf) (:text |state) - |T $ %{} :Expr (:at 1722410962303) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722410963398) (:by |rJG4IHzWf) (:text |assoc) - |h $ %{} :Leaf (:at 1722410966516) (:by |rJG4IHzWf) (:text |:answer) - |l $ %{} :Leaf (:at 1722410967158) (:by |rJG4IHzWf) (:text |nil) - |b $ %{} :Expr (:at 1722410962303) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722410963398) (:by |rJG4IHzWf) (:text |assoc) - |h $ %{} :Leaf (:at 1722425562740) (:by |rJG4IHzWf) (:text |:loading?) - |l $ %{} :Leaf (:at 1722425564929) (:by |rJG4IHzWf) (:text |true) + |5 $ %{} :Leaf (:at 1723173643282) (:by |rJG4IHzWf) (:text |::) + |D $ %{} :Leaf (:at 1723173641281) (:by |rJG4IHzWf) (:text |:states) + |L $ %{} :Leaf (:at 1723173641796) (:by |rJG4IHzWf) (:text |cursor) + |T $ %{} :Expr (:at 1722425554217) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1722425555359) (:by |rJG4IHzWf) (:text |->) + |L $ %{} :Leaf (:at 1722425557287) (:by |rJG4IHzWf) (:text |state) + |T $ %{} :Expr (:at 1722410962303) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722410963398) (:by |rJG4IHzWf) (:text |assoc) + |h $ %{} :Leaf (:at 1722410966516) (:by |rJG4IHzWf) (:text |:answer) + |l $ %{} :Leaf (:at 1722410967158) (:by |rJG4IHzWf) (:text |nil) + |b $ %{} :Expr (:at 1722410962303) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722410963398) (:by |rJG4IHzWf) (:text |assoc) + |h $ %{} :Leaf (:at 1722425562740) (:by |rJG4IHzWf) (:text |:loading?) + |l $ %{} :Leaf (:at 1722425564929) (:by |rJG4IHzWf) (:text |true) |o $ %{} :Expr (:at 1722409352561) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722409352561) (:by |rJG4IHzWf) (:text |let) @@ -1246,24 +1260,28 @@ :data $ {} |D $ %{} :Leaf (:at 1722446208836) (:by |rJG4IHzWf) (:text |;) |T $ %{} :Leaf (:at 1722410742738) (:by |rJG4IHzWf) (:text |d!) - |b $ %{} :Leaf (:at 1722410745024) (:by |rJG4IHzWf) (:text |cursor) - |h $ %{} :Expr (:at 1722425567125) (:by |rJG4IHzWf) + |h $ %{} :Expr (:at 1723173649866) (:by |rJG4IHzWf) :data $ {} - |D $ %{} :Leaf (:at 1722425567881) (:by |rJG4IHzWf) (:text |->) - |L $ %{} :Leaf (:at 1722425570008) (:by |rJG4IHzWf) (:text |state) - |T $ %{} :Expr (:at 1722410745264) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1723173650639) (:by |rJG4IHzWf) (:text |::) + |L $ %{} :Leaf (:at 1723173651690) (:by |rJG4IHzWf) (:text |:states) + |P $ %{} :Leaf (:at 1723173652147) (:by |rJG4IHzWf) (:text |cursor) + |T $ %{} :Expr (:at 1722425567125) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722410746182) (:by |rJG4IHzWf) (:text |assoc) - |h $ %{} :Leaf (:at 1722410753076) (:by |rJG4IHzWf) (:text |:answer) - |l $ %{} :Expr (:at 1722425707473) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1722425567881) (:by |rJG4IHzWf) (:text |->) + |L $ %{} :Leaf (:at 1722425570008) (:by |rJG4IHzWf) (:text |state) + |T $ %{} :Expr (:at 1722410745264) (:by |rJG4IHzWf) :data $ {} - |D $ %{} :Leaf (:at 1722425709038) (:by |rJG4IHzWf) (:text |w-log) - |T $ %{} :Leaf (:at 1722410751065) (:by |rJG4IHzWf) (:text |answer) - |b $ %{} :Expr (:at 1722425572003) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722425572698) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1722425575401) (:by |rJG4IHzWf) (:text |:loading?) - |h $ %{} :Leaf (:at 1722425748929) (:by |rJG4IHzWf) (:text |false) + |T $ %{} :Leaf (:at 1722410746182) (:by |rJG4IHzWf) (:text |assoc) + |h $ %{} :Leaf (:at 1722410753076) (:by |rJG4IHzWf) (:text |:answer) + |l $ %{} :Expr (:at 1722425707473) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1722425709038) (:by |rJG4IHzWf) (:text |w-log) + |T $ %{} :Leaf (:at 1722410751065) (:by |rJG4IHzWf) (:text |answer) + |b $ %{} :Expr (:at 1722425572003) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722425572698) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1722425575401) (:by |rJG4IHzWf) (:text |:loading?) + |h $ %{} :Leaf (:at 1722425748929) (:by |rJG4IHzWf) (:text |false) |l $ %{} :Expr (:at 1722447556153) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722447562182) (:by |rJG4IHzWf) (:text |apply-args) @@ -1314,26 +1332,30 @@ |h $ %{} :Expr (:at 1722447859215) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |d!) - |b $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |cursor) - |h $ %{} :Expr (:at 1722447859215) (:by |rJG4IHzWf) + |h $ %{} :Expr (:at 1723173654613) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |->) - |b $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |state) - |h $ %{} :Expr (:at 1722447859215) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |:answer) - |h $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |@*text) - |l $ %{} :Expr (:at 1722447859215) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |:loading?) - |h $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |false) - |o $ %{} :Expr (:at 1722447859215) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1723173655355) (:by |rJG4IHzWf) (:text |::) + |L $ %{} :Leaf (:at 1723173658127) (:by |rJG4IHzWf) (:text |:states) + |P $ %{} :Leaf (:at 1723173658503) (:by |rJG4IHzWf) (:text |cursor) + |T $ %{} :Expr (:at 1722447859215) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |:done?) - |h $ %{} :Leaf (:at 1722448250705) (:by |rJG4IHzWf) (:text |true) + |T $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |->) + |b $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Expr (:at 1722447859215) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |:answer) + |h $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |@*text) + |l $ %{} :Expr (:at 1722447859215) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |:loading?) + |h $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |false) + |o $ %{} :Expr (:at 1722447859215) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1722447859215) (:by |rJG4IHzWf) (:text |:done?) + |h $ %{} :Leaf (:at 1722448250705) (:by |rJG4IHzWf) (:text |true) |l $ %{} :Expr (:at 1723137374067) (:by |rJG4IHzWf) :data $ {} |D $ %{} :Leaf (:at 1723137374808) (:by |rJG4IHzWf) (:text |let) @@ -1378,36 +1400,40 @@ |P $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |d!) - |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |cursor) - |h $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) + |h $ %{} :Expr (:at 1723173662379) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |->) - |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |state) - |h $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1723173663560) (:by |rJG4IHzWf) (:text |::) + |L $ %{} :Leaf (:at 1723173664752) (:by |rJG4IHzWf) (:text |:states) + |P $ %{} :Leaf (:at 1723173665224) (:by |rJG4IHzWf) (:text |cursor) + |T $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |:answer) - |h $ %{} :Expr (:at 1723137469574) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |->) + |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) :data $ {} - |D $ %{} :Leaf (:at 1723137470405) (:by |rJG4IHzWf) (:text |str) - |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |@*text) - |b $ %{} :Leaf (:at 1723137476174) (:by |rJG4IHzWf) (:text |&newline) - |e $ %{} :Leaf (:at 1723138001847) (:by |rJG4IHzWf) (:text "|\"[STOPPED: ") - |h $ %{} :Expr (:at 1723138119344) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |:answer) + |h $ %{} :Expr (:at 1723137469574) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1723138121086) (:by |rJG4IHzWf) (:text |.-finishReason) - |b $ %{} :Leaf (:at 1723138124567) (:by |rJG4IHzWf) (:text |candidate0) - |l $ %{} :Leaf (:at 1723137484158) (:by |rJG4IHzWf) (:text "|\"]") - |l $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |:loading?) - |h $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |false) - |o $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |:done?) - |h $ %{} :Leaf (:at 1723137456297) (:by |rJG4IHzWf) (:text |true) + |D $ %{} :Leaf (:at 1723137470405) (:by |rJG4IHzWf) (:text |str) + |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |@*text) + |b $ %{} :Leaf (:at 1723137476174) (:by |rJG4IHzWf) (:text |&newline) + |e $ %{} :Leaf (:at 1723138001847) (:by |rJG4IHzWf) (:text "|\"[STOPPED: ") + |h $ %{} :Expr (:at 1723138119344) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723138121086) (:by |rJG4IHzWf) (:text |.-finishReason) + |b $ %{} :Leaf (:at 1723138124567) (:by |rJG4IHzWf) (:text |candidate0) + |l $ %{} :Leaf (:at 1723137484158) (:by |rJG4IHzWf) (:text "|\"]") + |l $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |:loading?) + |h $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |false) + |o $ %{} :Expr (:at 1723137432603) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1723137432603) (:by |rJG4IHzWf) (:text |:done?) + |h $ %{} :Leaf (:at 1723137456297) (:by |rJG4IHzWf) (:text |true) |T $ %{} :Expr (:at 1722447861509) (:by |rJG4IHzWf) :data $ {} |D $ %{} :Leaf (:at 1722448041120) (:by |rJG4IHzWf) (:text |let) @@ -1433,26 +1459,30 @@ |L $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |d!) - |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |cursor) - |h $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + |h $ %{} :Expr (:at 1723173667608) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |->) - |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |state) - |h $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |:answer) - |h $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |@*text) - |l $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |:loading?) - |h $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |false) - |o $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1723173668065) (:by |rJG4IHzWf) (:text |::) + |H $ %{} :Leaf (:at 1723173670237) (:by |rJG4IHzWf) (:text |:states) + |L $ %{} :Leaf (:at 1723173669033) (:by |rJG4IHzWf) (:text |cursor) + |T $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |:done?) - |h $ %{} :Leaf (:at 1722448253956) (:by |rJG4IHzWf) (:text |false) + |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |->) + |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |:answer) + |h $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |@*text) + |l $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |:loading?) + |h $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |false) + |o $ %{} :Expr (:at 1722447863571) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1722447863571) (:by |rJG4IHzWf) (:text |:done?) + |h $ %{} :Leaf (:at 1722448253956) (:by |rJG4IHzWf) (:text |false) |T $ %{} :Expr (:at 1722447641142) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722447642246) (:by |rJG4IHzWf) (:text |recur) @@ -1505,6 +1535,13 @@ |v $ %{} :Expr (:at 1499755354983) (:by nil) :data $ {} |j $ %{} :Leaf (:at 1499755354983) (:by |root) (:text |=<) + |xT $ %{} :Expr (:at 1499755354983) (:by nil) + :data $ {} + |j $ %{} :Leaf (:at 1723173404175) (:by |rJG4IHzWf) (:text |respo.comp.inspect) + |r $ %{} :Leaf (:at 1499755354983) (:by |root) (:text |:refer) + |v $ %{} :Expr (:at 1499755354983) (:by nil) + :data $ {} + |j $ %{} :Leaf (:at 1723173410653) (:by |rJG4IHzWf) (:text |comp-inspect) |y $ %{} :Expr (:at 1507461845717) (:by |root) :data $ {} |j $ %{} :Leaf (:at 1507461855480) (:by |root) (:text |reel.comp.reel) @@ -1549,6 +1586,26 @@ |T $ %{} :Leaf (:at 1723105000472) (:by |rJG4IHzWf) (:text |get-selected) |app.config $ %{} :FileEntry :defs $ {} + |chrome-extension? $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1723172916349) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723172919449) (:by |rJG4IHzWf) (:text |def) + |b $ %{} :Leaf (:at 1723172916349) (:by |rJG4IHzWf) (:text |chrome-extension?) + |h $ %{} :Expr (:at 1723172944417) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723172948256) (:by |rJG4IHzWf) (:text |and) + |T $ %{} :Expr (:at 1723172916349) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723172926530) (:by |rJG4IHzWf) (:text |some?) + |b $ %{} :Leaf (:at 1723172943024) (:by |rJG4IHzWf) (:text |js/chrome) + |b $ %{} :Expr (:at 1723172916349) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723172926530) (:by |rJG4IHzWf) (:text |some?) + |b $ %{} :Leaf (:at 1723172953620) (:by |rJG4IHzWf) (:text |js/chrome.runtime) + |h $ %{} :Expr (:at 1723172916349) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723172926530) (:by |rJG4IHzWf) (:text |some?) + |b $ %{} :Leaf (:at 1723172962879) (:by |rJG4IHzWf) (:text |js/chrome.runtime.id) |dev? $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1544873875614) (:by |rJG4IHzWf) :data $ {} @@ -1636,6 +1693,86 @@ |j $ %{} :Leaf (:at 1507399888500) (:by |root) (:text |updater) |r $ %{} :Leaf (:at 1507399891576) (:by |root) (:text |@*reel) |v $ %{} :Leaf (:at 1507399892687) (:by |root) (:text |op) + |listen-extension! $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1723173038708) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173038708) (:by |rJG4IHzWf) (:text |defn) + |b $ %{} :Leaf (:at 1723173038708) (:by |rJG4IHzWf) (:text |listen-extension!) + |h $ %{} :Expr (:at 1723173038708) (:by |rJG4IHzWf) + :data $ {} + |l $ %{} :Expr (:at 1723173040157) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173073735) (:by |rJG4IHzWf) (:text |js/chrome.runtime.onMessage.addListener) + |b $ %{} :Expr (:at 1723173078523) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723173079494) (:by |rJG4IHzWf) (:text |fn) + |T $ %{} :Expr (:at 1723173075164) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173076777) (:by |rJG4IHzWf) (:text |message) + |b $ %{} :Leaf (:at 1723173077930) (:by |rJG4IHzWf) (:text |sender) + |h $ %{} :Leaf (:at 1723173090308) (:by |rJG4IHzWf) (:text |respond!) + |h $ %{} :Expr (:at 1723173143646) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173145542) (:by |rJG4IHzWf) (:text |if) + |b $ %{} :Expr (:at 1723173145835) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173146422) (:by |rJG4IHzWf) (:text |=) + |b $ %{} :Leaf (:at 1723173151154) (:by |rJG4IHzWf) (:text "|\"menu-trigger") + |h $ %{} :Expr (:at 1723173153114) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173357943) (:by |rJG4IHzWf) (:text |.-action) + |b $ %{} :Leaf (:at 1723173361116) (:by |rJG4IHzWf) (:text |message) + |h $ %{} :Expr (:at 1723173362936) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173447860) (:by |rJG4IHzWf) (:text |let) + |b $ %{} :Expr (:at 1723173451729) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Expr (:at 1723173448347) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723173451364) (:by |rJG4IHzWf) (:text |content) + |T $ %{} :Expr (:at 1723173700673) (:by |rJG4IHzWf) + :data $ {} + |5 $ %{} :Leaf (:at 1723173715368) (:by |rJG4IHzWf) (:text |str) + |D $ %{} :Leaf (:at 1723174203375) (:by |rJG4IHzWf) (:text "|\"你扮演一个专业的工程师, 对以下内容做一下讲解, 用中文, 注意要简略, 内容注意分块.\n\n") + |H $ %{} :Leaf (:at 1723173841889) (:by |rJG4IHzWf) (:text |) + |L $ %{} :Leaf (:at 1723173718369) (:by |rJG4IHzWf) (:text |&newline) + |P $ %{} :Leaf (:at 1723173720650) (:by |rJG4IHzWf) (:text |&newline) + |T $ %{} :Expr (:at 1723173367820) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173369158) (:by |rJG4IHzWf) (:text |.-content) + |b $ %{} :Leaf (:at 1723173370100) (:by |rJG4IHzWf) (:text |message) + |b $ %{} :Expr (:at 1723173453535) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173455063) (:by |rJG4IHzWf) (:text |store) + |b $ %{} :Expr (:at 1723173456519) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173457590) (:by |rJG4IHzWf) (:text |:store) + |b $ %{} :Leaf (:at 1723173460557) (:by |rJG4IHzWf) (:text |@*reel) + |h $ %{} :Expr (:at 1723173464286) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173466868) (:by |rJG4IHzWf) (:text |cursor) + |b $ %{} :Expr (:at 1723173467230) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173467945) (:by |rJG4IHzWf) (:text |[]) + |j $ %{} :Expr (:at 1723173515506) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173515506) (:by |rJG4IHzWf) (:text |state0) + |b $ %{} :Expr (:at 1723173515506) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173515506) (:by |rJG4IHzWf) (:text |get-in) + |b $ %{} :Leaf (:at 1723173515506) (:by |rJG4IHzWf) (:text |store) + |h $ %{} :Expr (:at 1723173515506) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173515506) (:by |rJG4IHzWf) (:text |[]) + |b $ %{} :Leaf (:at 1723173515506) (:by |rJG4IHzWf) (:text |:states) + |h $ %{} :Leaf (:at 1723173515506) (:by |rJG4IHzWf) (:text |:data) + |h $ %{} :Expr (:at 1723173517113) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173517113) (:by |rJG4IHzWf) (:text |submit-message!) + |b $ %{} :Leaf (:at 1723173517113) (:by |rJG4IHzWf) (:text |cursor) + |h $ %{} :Leaf (:at 1723173518932) (:by |rJG4IHzWf) (:text |state0) + |l $ %{} :Leaf (:at 1723173521472) (:by |rJG4IHzWf) (:text |content) + |o $ %{} :Leaf (:at 1723173632238) (:by |rJG4IHzWf) (:text |dispatch!) |main! $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1499755354983) (:by nil) :data $ {} @@ -1757,6 +1894,13 @@ :data $ {} |T $ %{} :Leaf (:at 1688397811073) (:by |rJG4IHzWf) (:text |parse-cirru-edn) |b $ %{} :Leaf (:at 1688397811073) (:by |rJG4IHzWf) (:text |raw) + |yR $ %{} :Expr (:at 1723172966777) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723172967107) (:by |rJG4IHzWf) (:text |if) + |b $ %{} :Leaf (:at 1723172973092) (:by |rJG4IHzWf) (:text |config/chrome-extension?) + |h $ %{} :Expr (:at 1723172974998) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723173037074) (:by |rJG4IHzWf) (:text |listen-extension!) |yT $ %{} :Expr (:at 1499755354983) (:by nil) :data $ {} |T $ %{} :Leaf (:at 1499755354983) (:by |root) (:text |println) @@ -1901,6 +2045,7 @@ |v $ %{} :Expr (:at 1499755354983) (:by nil) :data $ {} |j $ %{} :Leaf (:at 1499755354983) (:by |root) (:text |comp-container) + |n $ %{} :Leaf (:at 1723173491003) (:by |rJG4IHzWf) (:text |submit-message!) |y $ %{} :Expr (:at 1499755354983) (:by nil) :data $ {} |j $ %{} :Leaf (:at 1508556737455) (:by |root) (:text |app.updater) diff --git a/compact.cirru b/compact.cirru index 40f9fca..53918d3 100644 --- a/compact.cirru +++ b/compact.cirru @@ -45,7 +45,8 @@ =< nil 200 comp-message-box (>> states :message-box) fn (text d!) (submit-message! cursor state text d!) - when dev? $ comp-reel (>> states :reel) reel ({}) + if dev? $ comp-reel (>> states :reel) reel ({}) + if dev? $ comp-inspect "\"Store" store nil |comp-message-box $ %{} :CodeEntry (:doc |) :code $ quote defcomp comp-message-box (states on-submit) @@ -158,7 +159,8 @@ if-let abort $ deref *abort-control do (js/console.warn "\"Aborting prev") (.!abort abort) - d! cursor $ -> state (assoc :answer nil) (assoc :loading? true) + d! $ :: :states cursor + -> state (assoc :answer nil) (assoc :loading? true) let selected $ js-await (get-selected) content $ .replace prompt-text "\"{{selected}}" (or selected "\"<未找到内容>") @@ -187,28 +189,32 @@ *text $ atom "\"" ; reading $ js-await (.!read reader) ; answer $ -> result .-data .-candidates .-0 .-content .-parts .-0 .-text - ; d! cursor $ -> state - assoc :answer $ w-log answer - assoc :loading? false + ; d! $ :: :states cursor + -> state + assoc :answer $ w-log answer + assoc :loading? false apply-args () $ fn () (hint-fn async) let info $ js-await (.!read reader) value $ .-value info done? $ .-done info if done? - d! cursor $ -> state (assoc :answer @*text) (assoc :loading? false) (assoc :done? true) + d! $ :: :states cursor + -> state (assoc :answer @*text) (assoc :loading? false) (assoc :done? true) let candidate0 $ -> (.!slice value 6) (.!trim) (first-line) (js/JSON.parse) .-candidates .-0 content $ .-content candidate0 if (nil? content) - d! cursor $ -> state - assoc :answer $ str @*text &newline "\"[STOPPED: " (.-finishReason candidate0) "\"]" - assoc :loading? false - assoc :done? true + d! $ :: :states cursor + -> state + assoc :answer $ str @*text &newline "\"[STOPPED: " (.-finishReason candidate0) "\"]" + assoc :loading? false + assoc :done? true let content $ -> candidate0 .-content .-parts .-0 .-text swap! *text str content - d! cursor $ -> state (assoc :answer @*text) (assoc :loading? false) (assoc :done? false) + d! $ :: :states cursor + -> state (assoc :answer @*text) (assoc :loading? false) (assoc :done? false) recur :ns $ %{} :CodeEntry (:doc |) :code $ quote @@ -217,6 +223,7 @@ respo.util.format :refer $ hsl respo.core :refer $ defcomp defeffect <> >> div button textarea span input respo.comp.space :refer $ =< + respo.comp.inspect :refer $ comp-inspect reel.comp.reel :refer $ comp-reel app.config :refer $ dev? "\"axios" :default axios @@ -225,6 +232,9 @@ "\"../extension/get-selected" :refer $ get-selected |app.config $ %{} :FileEntry :defs $ {} + |chrome-extension? $ %{} :CodeEntry (:doc |) + :code $ quote + def chrome-extension? $ and (some? js/chrome) (some? js/chrome.runtime) (some? js/chrome.runtime.id) |dev? $ %{} :CodeEntry (:doc |) :code $ quote def dev? $ = "\"dev" (get-env "\"mode" "\"release") @@ -245,6 +255,18 @@ and config/dev? $ not= op :states js/console.log "\"Dispatch:" op reset! *reel $ reel-updater updater @*reel op + |listen-extension! $ %{} :CodeEntry (:doc |) + :code $ quote + defn listen-extension! () $ js/chrome.runtime.onMessage.addListener + fn (message sender respond!) + if + = "\"menu-trigger" $ .-action message + let + content $ str "\"你扮演一个专业的工程师, 对以下内容做一下讲解, 用中文, 注意要简略, 内容注意分块.\n\n" &newline &newline (.-content message) + store $ :store @*reel + cursor $ [] + state0 $ get-in store ([] :states :data) + submit-message! cursor state0 content dispatch! |main! $ %{} :CodeEntry (:doc |) :code $ quote defn main! () @@ -261,6 +283,7 @@ raw $ js/localStorage.getItem (:storage-key config/site) when (some? raw) dispatch! $ :: :hydrate-storage (parse-cirru-edn raw) + if config/chrome-extension? $ listen-extension! println "|App started." |mount-target $ %{} :CodeEntry (:doc |) :code $ quote @@ -286,7 +309,7 @@ :code $ quote ns app.main $ :require respo.core :refer $ render! clear-cache! - app.comp.container :refer $ comp-container + app.comp.container :refer $ comp-container submit-message! app.updater :refer $ updater app.schema :as schema reel.util :refer $ listen-devtools! diff --git a/extension/get-selected.mjs b/extension/get-selected.mjs index fe525c5..d6a9303 100644 --- a/extension/get-selected.mjs +++ b/extension/get-selected.mjs @@ -1,32 +1,31 @@ - export let get_selected = () => { return new Promise((resolve, reject) => { if (chrome?.runtime?.id == null) { - console.warn("not chrome extension runtime...") - resolve(null) - return + console.warn("not chrome extension runtime..."); + resolve(null); + return; } - console.log("calling content script...") - chrome.tabs.query({active: true, currentWindow: true}) - .then(x => { - let activeTab = x[0] - if (activeTab) { - let id = activeTab.id - chrome.tabs.sendMessage(id, {get: 'selected'}, function(response) { - // 接收来自 content.js 的返回数据 - // console.info('Content script returned: ' + response); - resolve(response) - }); - - } else { - reject("found not active tab") - } - }).catch((error) => { - console.error("Error", error) - }) - }) -} - + console.log("calling content script..."); + chrome.tabs + .query({ active: true, currentWindow: true }) + .then((x) => { + let activeTab = x[0]; + if (activeTab) { + let id = activeTab.id; + chrome.tabs.sendMessage(id, { get: "selected" }, function (response) { + // 接收来自 content.js 的返回数据 + // console.info('Content script returned: ' + response); + resolve(response); + }); + } else { + reject("found not active tab"); + } + }) + .catch((error) => { + console.error("Error", error); + }); + }); +}; // setTimeout(()=>{ // chrome.tabs.query({active: true, currentWindow: true}).then(x => { @@ -44,15 +43,12 @@ export let get_selected = () => { // }) // }, 2000) - // chrome.scripting.executeScript({ // target: { tabId: 1201634844 }, // function: () => { console.log(document.body.innerText) } // }); - // chrome.tabs.sendMessage(1201634844, {get: 'selected'}, function(response) { // // 接收来自 content.js 的返回数据 // console.info('Content script returned: ' + response.message); // }); - diff --git a/extension/manifest.json b/extension/manifest.json index d83e7b1..2da1585 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -1,4 +1,3 @@ - { "manifest_version": 3, "name": "Msg Gemini", @@ -13,13 +12,15 @@ "icons": { "128": "gemini-icon.png" }, - "content_scripts": [{ - "matches": [""], - "match_origin_as_fallback": true, - "js": ["content.js"] - }], + "content_scripts": [ + { + "matches": [""], + "match_origin_as_fallback": true, + "js": ["content.js"] + } + ], "side_panel": { "default_path": "dist/index.html" }, - "permissions": ["sidePanel", "scripting", "activeTab", "tabs"] + "permissions": ["sidePanel", "scripting", "activeTab", "tabs", "contextMenus"] } diff --git a/extension/service-worker.js b/extension/service-worker.js index 4229606..c619666 100644 --- a/extension/service-worker.js +++ b/extension/service-worker.js @@ -1,3 +1,17 @@ chrome.runtime.onInstalled.addListener(() => { chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true }); -}); \ No newline at end of file +}); + +chrome.runtime.onInstalled.addListener(async () => { + chrome.contextMenus.create({ + id: "msg-gemeni-selection", + title: "Msg Gemini", + type: "normal", + contexts: ["selection"], + }); +}); + +chrome.contextMenus.onClicked.addListener((item, tab) => { + let content = item.selectionText; + chrome.runtime.sendMessage({ action: "menu-trigger", content }); +}); From 999c0ed70f2eba9239622025b982d5a9a8f55c56 Mon Sep 17 00:00:00 2001 From: tiye Date: Fri, 9 Aug 2024 17:10:09 +0800 Subject: [PATCH 09/11] raise error gen key not presented --- calcit.cirru | 17 ++++++++++++++++- compact.cirru | 2 ++ extension/service-worker.js | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/calcit.cirru b/calcit.cirru index 5bee504..f515224 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -624,6 +624,21 @@ :data $ {} |T $ %{} :Leaf (:at 1722963913549) (:by |rJG4IHzWf) (:text |js/prompt) |b $ %{} :Leaf (:at 1722448341536) (:by |rJG4IHzWf) (:text "|\"Required gemini-key in localStorage") + |V $ %{} :Expr (:at 1723194578778) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723194578778) (:by |rJG4IHzWf) (:text |if) + |b $ %{} :Expr (:at 1723194578778) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723194578778) (:by |rJG4IHzWf) (:text |blank?) + |b $ %{} :Leaf (:at 1723194578778) (:by |rJG4IHzWf) (:text |v) + |h $ %{} :Expr (:at 1723194578778) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723194578778) (:by |rJG4IHzWf) (:text |raise) + |b $ %{} :Expr (:at 1723194578778) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723194578778) (:by |rJG4IHzWf) (:text |new) + |b $ %{} :Leaf (:at 1723194578778) (:by |rJG4IHzWf) (:text |js/Error) + |h $ %{} :Leaf (:at 1723194578778) (:by |rJG4IHzWf) (:text "|\"key is empty") |X $ %{} :Expr (:at 1722963927392) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722963929685) (:by |rJG4IHzWf) (:text |js/localStorage.setItem) @@ -1145,7 +1160,7 @@ |b $ %{} :Expr (:at 1722410389535) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722410391267) (:by |rJG4IHzWf) (:text |:key) - |b $ %{} :Expr (:at 1722448303509) (:by |rJG4IHzWf) + |b $ %{} :Expr (:at 1723194500835) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722448307986) (:by |rJG4IHzWf) (:text |get-gemini-key!) |h $ %{} :Expr (:at 1722446159882) (:by |rJG4IHzWf) diff --git a/compact.cirru b/compact.cirru index 53918d3..d7c0846 100644 --- a/compact.cirru +++ b/compact.cirru @@ -97,6 +97,8 @@ if (blank? key) let v $ js/prompt "\"Required gemini-key in localStorage" + if (blank? v) + raise $ new js/Error "\"key is empty" js/localStorage.setItem "\"gemini-key" v , v , key diff --git a/extension/service-worker.js b/extension/service-worker.js index c619666..fa8335f 100644 --- a/extension/service-worker.js +++ b/extension/service-worker.js @@ -14,4 +14,7 @@ chrome.runtime.onInstalled.addListener(async () => { chrome.contextMenus.onClicked.addListener((item, tab) => { let content = item.selectionText; chrome.runtime.sendMessage({ action: "menu-trigger", content }); + chrome.sidePanel.open({tabId: tab.id}, () => { + // also try to open + }) }); From 5caaecc20636c237cf511169e851017aebbeb401 Mon Sep 17 00:00:00 2001 From: tiye Date: Tue, 13 Aug 2024 11:56:52 +0800 Subject: [PATCH 10/11] trigger message when open from context menu --- calcit.cirru | 12 +++++++++++- compact.cirru | 5 +++-- extension/content.js | 18 +++++++++--------- extension/service-worker.js | 23 +++++++++++++++++++++-- 4 files changed, 44 insertions(+), 14 deletions(-) diff --git a/calcit.cirru b/calcit.cirru index f515224..a41d15a 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -1788,6 +1788,16 @@ |h $ %{} :Leaf (:at 1723173518932) (:by |rJG4IHzWf) (:text |state0) |l $ %{} :Leaf (:at 1723173521472) (:by |rJG4IHzWf) (:text |content) |o $ %{} :Leaf (:at 1723173632238) (:by |rJG4IHzWf) (:text |dispatch!) + |o $ %{} :Expr (:at 1723521090613) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723521097047) (:by |rJG4IHzWf) (:text |js/chrome.runtime.connect) + |b $ %{} :Expr (:at 1723521097651) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723521101462) (:by |rJG4IHzWf) (:text |js-object) + |b $ %{} :Expr (:at 1723521102038) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723521102663) (:by |rJG4IHzWf) (:text |:name) + |b $ %{} :Leaf (:at 1723521106610) (:by |rJG4IHzWf) (:text ||mySidepanel) |main! $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1499755354983) (:by nil) :data $ {} @@ -1911,7 +1921,7 @@ |b $ %{} :Leaf (:at 1688397811073) (:by |rJG4IHzWf) (:text |raw) |yR $ %{} :Expr (:at 1723172966777) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1723172967107) (:by |rJG4IHzWf) (:text |if) + |T $ %{} :Leaf (:at 1723521086239) (:by |rJG4IHzWf) (:text |if) |b $ %{} :Leaf (:at 1723172973092) (:by |rJG4IHzWf) (:text |config/chrome-extension?) |h $ %{} :Expr (:at 1723172974998) (:by |rJG4IHzWf) :data $ {} diff --git a/compact.cirru b/compact.cirru index d7c0846..c17275b 100644 --- a/compact.cirru +++ b/compact.cirru @@ -259,8 +259,8 @@ reset! *reel $ reel-updater updater @*reel op |listen-extension! $ %{} :CodeEntry (:doc |) :code $ quote - defn listen-extension! () $ js/chrome.runtime.onMessage.addListener - fn (message sender respond!) + defn listen-extension! () + js/chrome.runtime.onMessage.addListener $ fn (message sender respond!) if = "\"menu-trigger" $ .-action message let @@ -269,6 +269,7 @@ cursor $ [] state0 $ get-in store ([] :states :data) submit-message! cursor state0 content dispatch! + js/chrome.runtime.connect $ js-object (:name |mySidepanel) |main! $ %{} :CodeEntry (:doc |) :code $ quote defn main! () diff --git a/extension/content.js b/extension/content.js index 1622aeb..2771998 100644 --- a/extension/content.js +++ b/extension/content.js @@ -1,12 +1,12 @@ // Listen for messages chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) { - // If the received message has the expected format... - console.log("[Side Message] msg", msg) - if (msg.get === 'selected') { - // Call the specified callback, passing - // the web-page's DOM content as argument - sendResponse(getSelectedText()); - } + // If the received message has the expected format... + console.log("[Side Message] msg", msg); + if (msg.get === "selected") { + // Call the specified callback, passing + // the web-page's DOM content as argument + sendResponse(getSelectedText()); + } }); let getSelectedText = () => { @@ -19,6 +19,6 @@ let getSelectedText = () => { } else { return "<未获取到内容>"; } -} +}; -console.log("[Side Message] prepared content script") \ No newline at end of file +console.log("[Side Message] prepared content script"); diff --git a/extension/service-worker.js b/extension/service-worker.js index fa8335f..e0510f3 100644 --- a/extension/service-worker.js +++ b/extension/service-worker.js @@ -1,3 +1,5 @@ +let sidepanelOpen = false; + chrome.runtime.onInstalled.addListener(() => { chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true }); }); @@ -14,7 +16,24 @@ chrome.runtime.onInstalled.addListener(async () => { chrome.contextMenus.onClicked.addListener((item, tab) => { let content = item.selectionText; chrome.runtime.sendMessage({ action: "menu-trigger", content }); - chrome.sidePanel.open({tabId: tab.id}, () => { + chrome.sidePanel.open({ tabId: tab.id }, () => { // also try to open - }) + if (!sidepanelOpen) { + setTimeout(() => { + chrome.runtime.sendMessage({ action: "menu-trigger", content }); + }, 1000); + } + }); +}); + +// https://stackoverflow.com/a/77106777/883571 +chrome.runtime.onConnect.addListener(function (port) { + if (port.name === "mySidepanel") { + sidepanelOpen = true; + console.log("Sidepanel opened."); + port.onDisconnect.addListener(async () => { + sidepanelOpen = false; + console.log("Sidepanel closed."); + }); + } }); From 23bf1cf5033f424c5b6c5f44c7a0fbe9cc8893c4 Mon Sep 17 00:00:00 2001 From: tiye Date: Wed, 14 Aug 2024 10:56:42 +0800 Subject: [PATCH 11/11] autofocus to message box --- calcit.cirru | 331 ++++++++++++++++++++++++++++---------------------- compact.cirru | 60 +++++---- 2 files changed, 216 insertions(+), 175 deletions(-) diff --git a/calcit.cirru b/calcit.cirru index a41d15a..42fdb27 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -341,206 +341,240 @@ :data $ {} |T $ %{} :Leaf (:at 1722536236503) (:by |rJG4IHzWf) (:text |:content) |b $ %{} :Leaf (:at 1722536237836) (:by |rJG4IHzWf) (:text "|\"") - |T $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + |T $ %{} :Expr (:at 1723603372844) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |div) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1723603373761) (:by |rJG4IHzWf) (:text |[]) + |L $ %{} :Expr (:at 1723603375458) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |{}) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:class-name) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |str-spaced) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/center) - |l $ %{} :Leaf (:at 1722963242805) (:by |rJG4IHzWf) (:text |style-message-box) - |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1723603383380) (:by |rJG4IHzWf) (:text |effect-focus) + |T $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |textarea) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |div) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |{}) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:value) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:content) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |state) - |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:placeholder) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text "|\"Content") - |j $ %{} :Expr (:at 1722965218570) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722965219789) (:by |rJG4IHzWf) (:text |:id) - |b $ %{} :Leaf (:at 1722965223404) (:by |rJG4IHzWf) (:text "|\"message") - |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:class-name) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |str-spaced) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/textarea) - |e $ %{} :Leaf (:at 1722964960984) (:by |rJG4IHzWf) (:text |css/font-code!) - |h $ %{} :Leaf (:at 1722964845813) (:by |rJG4IHzWf) (:text |style-textbox) - |q $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/center) + |l $ %{} :Leaf (:at 1722963242805) (:by |rJG4IHzWf) (:text |style-message-box) + |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |textarea) + |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:on-input) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |{}) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |fn) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:value) + |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:content) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:placeholder) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text "|\"Content") + |j $ %{} :Expr (:at 1722965218570) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965219789) (:by |rJG4IHzWf) (:text |:id) + |b $ %{} :Leaf (:at 1722965223404) (:by |rJG4IHzWf) (:text "|\"message") + |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:class-name) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |e) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |d!) - |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |str-spaced) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/textarea) + |e $ %{} :Leaf (:at 1722964960984) (:by |rJG4IHzWf) (:text |css/font-code!) + |h $ %{} :Leaf (:at 1722964845813) (:by |rJG4IHzWf) (:text |style-textbox) + |q $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:on-input) + |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |d!) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |cursor) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |fn) + |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |e) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |d!) |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |state) - |h $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:content) - |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |d!) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |cursor) + |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:value) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |e) - |s $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:on-keydown) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:content) + |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:value) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |e) + |s $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |fn) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:on-keydown) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |e) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |d!) - |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |if) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |fn) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |and) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |e) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |d!) + |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |if) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |=) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |13) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |and) + |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |=) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |13) + |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:keycode) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |e) |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:keycode) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:meta?) |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |e) - |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:meta?) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |e) - |l $ %{} :Expr (:at 1722536419205) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536419900) (:by |rJG4IHzWf) (:text |on-submit) - |b $ %{} :Expr (:at 1722536423510) (:by |rJG4IHzWf) + |l $ %{} :Expr (:at 1722536419205) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536424418) (:by |rJG4IHzWf) (:text |:content) - |b $ %{} :Leaf (:at 1722536426394) (:by |rJG4IHzWf) (:text |state) - |h $ %{} :Leaf (:at 1722536427678) (:by |rJG4IHzWf) (:text |d!) - |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |button) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722536419900) (:by |rJG4IHzWf) (:text |on-submit) + |b $ %{} :Expr (:at 1722536423510) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536424418) (:by |rJG4IHzWf) (:text |:content) + |b $ %{} :Leaf (:at 1722536426394) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Leaf (:at 1722536427678) (:by |rJG4IHzWf) (:text |d!) + |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |{}) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |button) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:class-name) - |b $ %{} :Expr (:at 1722963277244) (:by |rJG4IHzWf) - :data $ {} - |D $ %{} :Leaf (:at 1722963281394) (:by |rJG4IHzWf) (:text |str-spaced) - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/button) - |b $ %{} :Leaf (:at 1722963290998) (:by |rJG4IHzWf) (:text |style-submit) - |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:inner-text) - |b $ %{} :Leaf (:at 1722965711522) (:by |rJG4IHzWf) (:text "|\"Generate") - |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:on-click) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |{}) |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |fn) - |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:class-name) + |b $ %{} :Expr (:at 1722963277244) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |e) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |d!) - |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1722963281394) (:by |rJG4IHzWf) (:text |str-spaced) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |css/button) + |b $ %{} :Leaf (:at 1722963290998) (:by |rJG4IHzWf) (:text |style-submit) + |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:inner-text) + |b $ %{} :Leaf (:at 1722965711522) (:by |rJG4IHzWf) (:text "|\"Generate") + |l $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:on-click) + |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |;) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |println) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |fn) + |b $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |e) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |d!) |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:content) - |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |state) - |l $ %{} :Expr (:at 1722536434666) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |on-submit) - |b $ %{} :Expr (:at 1722536434666) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |;) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |println) + |h $ %{} :Expr (:at 1722536206569) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |:content) + |b $ %{} :Leaf (:at 1722536206569) (:by |rJG4IHzWf) (:text |state) + |l $ %{} :Expr (:at 1722536434666) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |:content) - |b $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |state) - |h $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |d!) - |o $ %{} :Expr (:at 1722965020043) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722965021333) (:by |rJG4IHzWf) (:text |if) - |b $ %{} :Expr (:at 1722965030750) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |on-submit) + |b $ %{} :Expr (:at 1722536434666) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |:content) + |b $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Leaf (:at 1722536434666) (:by |rJG4IHzWf) (:text |d!) + |o $ %{} :Expr (:at 1722965020043) (:by |rJG4IHzWf) :data $ {} - |D $ %{} :Leaf (:at 1722965031352) (:by |rJG4IHzWf) (:text |not) - |T $ %{} :Expr (:at 1722965024623) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722965021333) (:by |rJG4IHzWf) (:text |if) + |b $ %{} :Expr (:at 1722965030750) (:by |rJG4IHzWf) :data $ {} - |D $ %{} :Leaf (:at 1722965028235) (:by |rJG4IHzWf) (:text |blank?) - |T $ %{} :Expr (:at 1722965022922) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1722965031352) (:by |rJG4IHzWf) (:text |not) + |T $ %{} :Expr (:at 1722965024623) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722965022922) (:by |rJG4IHzWf) (:text |:content) - |b $ %{} :Leaf (:at 1722965022922) (:by |rJG4IHzWf) (:text |state) - |h $ %{} :Expr (:at 1722965069081) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722965069081) (:by |rJG4IHzWf) (:text |comp-close) - |b $ %{} :Expr (:at 1722965070390) (:by |rJG4IHzWf) + |D $ %{} :Leaf (:at 1722965028235) (:by |rJG4IHzWf) (:text |blank?) + |T $ %{} :Expr (:at 1722965022922) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965022922) (:by |rJG4IHzWf) (:text |:content) + |b $ %{} :Leaf (:at 1722965022922) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Expr (:at 1722965069081) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722965071425) (:by |rJG4IHzWf) (:text |{}) - |X $ %{} :Expr (:at 1722965084061) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722965069081) (:by |rJG4IHzWf) (:text |comp-close) + |b $ %{} :Expr (:at 1722965070390) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722965087170) (:by |rJG4IHzWf) (:text |:class-name) - |b $ %{} :Leaf (:at 1722965090173) (:by |rJG4IHzWf) (:text |style-clear) - |b $ %{} :Expr (:at 1722965071839) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722965075272) (:by |rJG4IHzWf) (:text |:on-click) - |b $ %{} :Expr (:at 1722965075541) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722965071425) (:by |rJG4IHzWf) (:text |{}) + |X $ %{} :Expr (:at 1722965084061) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722965076006) (:by |rJG4IHzWf) (:text |fn) - |b $ %{} :Expr (:at 1722965076328) (:by |rJG4IHzWf) - :data $ {} - |T $ %{} :Leaf (:at 1722965076541) (:by |rJG4IHzWf) (:text |e) - |b $ %{} :Leaf (:at 1722965077748) (:by |rJG4IHzWf) (:text |d!) - |h $ %{} :Expr (:at 1722965190406) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722965087170) (:by |rJG4IHzWf) (:text |:class-name) + |b $ %{} :Leaf (:at 1722965090173) (:by |rJG4IHzWf) (:text |style-clear) + |b $ %{} :Expr (:at 1722965071839) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965075272) (:by |rJG4IHzWf) (:text |:on-click) + |b $ %{} :Expr (:at 1722965075541) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722965191669) (:by |rJG4IHzWf) (:text |d!) - |b $ %{} :Leaf (:at 1722965192894) (:by |rJG4IHzWf) (:text |cursor) - |h $ %{} :Expr (:at 1722965193115) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722965076006) (:by |rJG4IHzWf) (:text |fn) + |b $ %{} :Expr (:at 1722965076328) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722965195162) (:by |rJG4IHzWf) (:text |assoc) - |b $ %{} :Leaf (:at 1722965196793) (:by |rJG4IHzWf) (:text |state) - |h $ %{} :Leaf (:at 1722965197792) (:by |rJG4IHzWf) (:text |:content) - |l $ %{} :Leaf (:at 1722965198275) (:by |rJG4IHzWf) (:text "|\"") - |l $ %{} :Expr (:at 1722965240723) (:by |rJG4IHzWf) - :data $ {} - |D $ %{} :Leaf (:at 1722965241869) (:by |rJG4IHzWf) (:text |->) - |T $ %{} :Expr (:at 1722965226578) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722965076541) (:by |rJG4IHzWf) (:text |e) + |b $ %{} :Leaf (:at 1722965077748) (:by |rJG4IHzWf) (:text |d!) + |h $ %{} :Expr (:at 1722965190406) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722965236898) (:by |rJG4IHzWf) (:text |js/document.querySelector) - |b $ %{} :Leaf (:at 1722965239062) (:by |rJG4IHzWf) (:text "|\"#message") - |b $ %{} :Expr (:at 1722965242717) (:by |rJG4IHzWf) + |T $ %{} :Leaf (:at 1722965191669) (:by |rJG4IHzWf) (:text |d!) + |b $ %{} :Leaf (:at 1722965192894) (:by |rJG4IHzWf) (:text |cursor) + |h $ %{} :Expr (:at 1722965193115) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965195162) (:by |rJG4IHzWf) (:text |assoc) + |b $ %{} :Leaf (:at 1722965196793) (:by |rJG4IHzWf) (:text |state) + |h $ %{} :Leaf (:at 1722965197792) (:by |rJG4IHzWf) (:text |:content) + |l $ %{} :Leaf (:at 1722965198275) (:by |rJG4IHzWf) (:text "|\"") + |l $ %{} :Expr (:at 1722965240723) (:by |rJG4IHzWf) :data $ {} - |T $ %{} :Leaf (:at 1722965247338) (:by |rJG4IHzWf) (:text |.!focus) + |D $ %{} :Leaf (:at 1722965241869) (:by |rJG4IHzWf) (:text |->) + |T $ %{} :Expr (:at 1722965226578) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965236898) (:by |rJG4IHzWf) (:text |js/document.querySelector) + |b $ %{} :Leaf (:at 1722965239062) (:by |rJG4IHzWf) (:text "|\"#message") + |b $ %{} :Expr (:at 1722965242717) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1722965247338) (:by |rJG4IHzWf) (:text |.!focus) + |effect-focus $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1723603385630) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723603387635) (:by |rJG4IHzWf) (:text |defeffect) + |b $ %{} :Leaf (:at 1723603385630) (:by |rJG4IHzWf) (:text |effect-focus) + |h $ %{} :Expr (:at 1723603385630) (:by |rJG4IHzWf) + :data $ {} + |l $ %{} :Expr (:at 1723603394606) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723603396940) (:by |rJG4IHzWf) (:text |action) + |b $ %{} :Leaf (:at 1723603397935) (:by |rJG4IHzWf) (:text |el) + |h $ %{} :Leaf (:at 1723603399765) (:by |rJG4IHzWf) (:text |at?) + |o $ %{} :Expr (:at 1723603401130) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723603561484) (:by |rJG4IHzWf) (:text |when) + |b $ %{} :Expr (:at 1723603402821) (:by |rJG4IHzWf) + :data $ {} + |T $ %{} :Leaf (:at 1723603402548) (:by |rJG4IHzWf) (:text |=) + |b $ %{} :Leaf (:at 1723603405327) (:by |rJG4IHzWf) (:text |action) + |h $ %{} :Leaf (:at 1723603407398) (:by |rJG4IHzWf) (:text |:mount) + |h $ %{} :Expr (:at 1723603417488) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723603471483) (:by |rJG4IHzWf) (:text |.!select) + |T $ %{} :Expr (:at 1723603407983) (:by |rJG4IHzWf) + :data $ {} + |D $ %{} :Leaf (:at 1723603414646) (:by |rJG4IHzWf) (:text |.!querySelector) + |T $ %{} :Leaf (:at 1723603408532) (:by |rJG4IHzWf) (:text |el) + |b $ %{} :Leaf (:at 1723603416886) (:by |rJG4IHzWf) (:text "|\"textarea") |first-line $ %{} :CodeEntry (:doc "|last message from error contains a line starts with \"data: \" and an extra error message. In order that JSON is parsed correctly, only first line is used now.") :code $ %{} :Expr (:at 1723138240850) (:by |rJG4IHzWf) :data $ {} @@ -1571,6 +1605,7 @@ |v $ %{} :Expr (:at 1521954065004) (:by |root) :data $ {} |j $ %{} :Leaf (:at 1521954067604) (:by |root) (:text |dev?) + |n $ %{} :Leaf (:at 1723603608554) (:by |rJG4IHzWf) (:text |chrome-extension?) |zD $ %{} :Expr (:at 1722410482268) (:by |rJG4IHzWf) :data $ {} |T $ %{} :Leaf (:at 1722410483524) (:by |rJG4IHzWf) (:text "|\"axios") diff --git a/compact.cirru b/compact.cirru index c17275b..278478c 100644 --- a/compact.cirru +++ b/compact.cirru @@ -54,33 +54,39 @@ cursor $ :cursor states state $ either (:data states) {} $ :content "\"" - div - {} $ :class-name (str-spaced css/center style-message-box) - textarea $ {} - :value $ :content state - :placeholder "\"Content" - :id "\"message" - :class-name $ str-spaced css/textarea css/font-code! style-textbox - :on-input $ fn (e d!) - d! cursor $ assoc state :content (:value e) - :on-keydown $ fn (e d!) - if - and - = 13 $ :keycode e - :meta? e - on-submit (:content state) d! - button $ {} - :class-name $ str-spaced css/button style-submit - :inner-text "\"Generate" - :on-click $ fn (e d!) - ; println $ :content state - on-submit (:content state) d! - if - not $ blank? (:content state) - comp-close $ {} (:class-name style-clear) + [] (effect-focus) + div + {} $ :class-name (str-spaced css/center style-message-box) + textarea $ {} + :value $ :content state + :placeholder "\"Content" + :id "\"message" + :class-name $ str-spaced css/textarea css/font-code! style-textbox + :on-input $ fn (e d!) + d! cursor $ assoc state :content (:value e) + :on-keydown $ fn (e d!) + if + and + = 13 $ :keycode e + :meta? e + on-submit (:content state) d! + button $ {} + :class-name $ str-spaced css/button style-submit + :inner-text "\"Generate" :on-click $ fn (e d!) - d! cursor $ assoc state :content "\"" - -> (js/document.querySelector "\"#message") (.!focus) + ; println $ :content state + on-submit (:content state) d! + if + not $ blank? (:content state) + comp-close $ {} (:class-name style-clear) + :on-click $ fn (e d!) + d! cursor $ assoc state :content "\"" + -> (js/document.querySelector "\"#message") (.!focus) + |effect-focus $ %{} :CodeEntry (:doc |) + :code $ quote + defeffect effect-focus () (action el at?) + when (= action :mount) + .!select $ .!querySelector el "\"textarea" |first-line $ %{} :CodeEntry (:doc "|last message from error contains a line starts with \"data: \" and an extra error message. In order that JSON is parsed correctly, only first line is used now.") :code $ quote defn first-line (tt) @@ -227,7 +233,7 @@ respo.comp.space :refer $ =< respo.comp.inspect :refer $ comp-inspect reel.comp.reel :refer $ comp-reel - app.config :refer $ dev? + app.config :refer $ dev? chrome-extension? "\"axios" :default axios respo-md.comp.md :refer $ comp-md-block style-code-block respo-ui.comp :refer $ comp-copy comp-close