drab 4.1.5 → 4.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/Editor.svelte +20 -19
- package/dist/components/Editor.svelte.d.ts +1 -1
- package/package.json +14 -13
package/README.md
CHANGED
@@ -229,28 +229,29 @@ ${repeat}`,
|
|
229
229
|
});
|
230
230
|
}, 0);
|
231
231
|
}
|
232
|
-
} else if (e.ctrlKey || e.metaKey) {
|
233
|
-
if (textArea.selectionStart === textArea.selectionEnd) {
|
234
|
-
if (e.key === "c" || e.key === "x") {
|
235
|
-
e.preventDefault();
|
236
|
-
const { lines, lineNumber, columnNumber } = getLineInfo();
|
237
|
-
await navigator.clipboard.writeText(
|
238
|
-
`${lineNumber === 0 && e.key === "x" ? "" : "\n"}${lines[lineNumber]}`
|
239
|
-
);
|
240
|
-
if (e.key === "x") {
|
241
|
-
const newPos = textArea.selectionStart - columnNumber;
|
242
|
-
lines.splice(lineNumber, 1);
|
243
|
-
valueTextarea = lines.join("\n");
|
244
|
-
setTimeout(() => {
|
245
|
-
textArea.setSelectionRange(newPos, newPos);
|
246
|
-
}, 0);
|
247
|
-
}
|
248
|
-
}
|
249
|
-
}
|
250
232
|
} else {
|
251
233
|
const nextCharIsClosing = Object.values(keyPairs).includes(nextChar);
|
252
234
|
const highlighted = textArea.selectionStart !== textArea.selectionEnd;
|
253
|
-
if (e.ctrlKey
|
235
|
+
if (e.ctrlKey || e.metaKey) {
|
236
|
+
if (textArea.selectionStart === textArea.selectionEnd) {
|
237
|
+
if (e.key === "c" || e.key === "x") {
|
238
|
+
e.preventDefault();
|
239
|
+
const { lines, lineNumber, columnNumber } = getLineInfo();
|
240
|
+
await navigator.clipboard.writeText(
|
241
|
+
`${lineNumber === 0 && e.key === "x" ? "" : "\n"}${lines[lineNumber]}`
|
242
|
+
);
|
243
|
+
if (e.key === "x") {
|
244
|
+
const newPos = textArea.selectionStart - columnNumber;
|
245
|
+
lines.splice(lineNumber, 1);
|
246
|
+
valueTextarea = lines.join("\n");
|
247
|
+
setTimeout(() => {
|
248
|
+
textArea.setSelectionRange(newPos, newPos);
|
249
|
+
}, 0);
|
250
|
+
}
|
251
|
+
}
|
252
|
+
}
|
253
|
+
}
|
254
|
+
if ((e.ctrlKey || e.metaKey) && e.key) {
|
254
255
|
const matchedEl = contentElements.find((el) => el.key === e.key);
|
255
256
|
if (matchedEl)
|
256
257
|
addContent(matchedEl);
|
@@ -10,7 +10,7 @@ declare const __propDef: {
|
|
10
10
|
/** controls how the text is added */
|
11
11
|
display: "inline" | "block" | "wrap";
|
12
12
|
/** contents of the `button` */
|
13
|
-
icon: string | ComponentType
|
13
|
+
icon: string | ComponentType<SvelteComponent>;
|
14
14
|
/** keyboard shortcut */
|
15
15
|
key?: string | undefined;
|
16
16
|
/** class to apply to the specific `button` */
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "drab",
|
3
|
-
"version": "4.1.
|
3
|
+
"version": "4.1.7",
|
4
4
|
"description": "An Unstyled Svelte Component Library",
|
5
5
|
"keywords": [
|
6
6
|
"components",
|
@@ -58,27 +58,28 @@
|
|
58
58
|
"svelte": "^4.2.8"
|
59
59
|
},
|
60
60
|
"devDependencies": {
|
61
|
-
"@sveltejs/adapter-vercel": "^
|
62
|
-
"@sveltejs/kit": "^
|
63
|
-
"@sveltejs/package": "^2.2.
|
61
|
+
"@sveltejs/adapter-vercel": "^4.0.4",
|
62
|
+
"@sveltejs/kit": "^2.0.6",
|
63
|
+
"@sveltejs/package": "^2.2.5",
|
64
|
+
"@sveltejs/vite-plugin-svelte": "^3.0.1",
|
64
65
|
"@tailwindcss/typography": "^0.5.10",
|
65
|
-
"@types/node": "^20.10.
|
66
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
67
|
-
"@typescript-eslint/parser": "^6.
|
66
|
+
"@types/node": "^20.10.6",
|
67
|
+
"@typescript-eslint/eslint-plugin": "^6.17.0",
|
68
|
+
"@typescript-eslint/parser": "^6.17.0",
|
68
69
|
"autoprefixer": "^10.4.16",
|
69
|
-
"eslint": "^8.
|
70
|
+
"eslint": "^8.56.0",
|
70
71
|
"eslint-config-prettier": "^9.1.0",
|
71
72
|
"eslint-plugin-svelte": "^2.35.1",
|
72
73
|
"prettier": "^3.1.1",
|
73
74
|
"prettier-plugin-svelte": "^3.1.2",
|
74
|
-
"prettier-plugin-tailwindcss": "^0.5.
|
75
|
-
"publint": "^0.2.
|
75
|
+
"prettier-plugin-tailwindcss": "^0.5.10",
|
76
|
+
"publint": "^0.2.7",
|
76
77
|
"robino": "^0.0.39",
|
77
78
|
"svelte-check": "^3.6.2",
|
78
|
-
"tailwindcss": "^3.
|
79
|
+
"tailwindcss": "^3.4.0",
|
79
80
|
"tslib": "^2.6.2",
|
80
81
|
"typescript": "^5.3.3",
|
81
|
-
"uico": "^0.1
|
82
|
-
"vite": "^
|
82
|
+
"uico": "^0.2.1",
|
83
|
+
"vite": "^5.0.11"
|
83
84
|
}
|
84
85
|
}
|