Skip to content

Commit 340ce7e

Browse files
committed
improve mobile bar
1 parent 4f0a94c commit 340ce7e

File tree

3 files changed

+96
-85
lines changed

3 files changed

+96
-85
lines changed

public/app.js

+76-76
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/sw.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const cacheName = "luizbills.litecanvas-editor-v1";
2-
const version = "2.13.1";
2+
const version = "2.14.0";
33

44
const precacheResources = [
55
"/",

src/mobileBar.js

+19-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
import { toggleComment, undo, redo, indentMore } from "@codemirror/commands";
2-
// import { openSearchPanel } from "@codemirror/search";
1+
import {
2+
toggleComment,
3+
undo,
4+
redo,
5+
indentMore,
6+
selectAll,
7+
} from "@codemirror/commands";
8+
import { openSearchPanel } from "@codemirror/search";
39

410
export default function mobileBar(editorView) {
511
const viewport = visualViewport;
@@ -29,12 +35,17 @@ export default function mobileBar(editorView) {
2935
label: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m15 15 6-6m0 0-6-6m6 6H9a6 6 0 0 0 0 12h3" /></svg>`,
3036
callback: redo,
3137
},
32-
// {
33-
// name: "search (and replace)",
34-
// label: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" /></svg>`,
35-
// callback: openSearchPanel,
36-
// focus: false,
37-
// },
38+
{
39+
name: "select all",
40+
label: `[A]`,
41+
callback: selectAll,
42+
},
43+
{
44+
name: "search (and replace)",
45+
label: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" /></svg>`,
46+
callback: openSearchPanel,
47+
focus: false,
48+
},
3849
];
3950

4051
const buttons = document.createElement("div");

0 commit comments

Comments
 (0)