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 CHANGED
@@ -120,7 +120,7 @@ Contribute to the project, or use **drab** as a template for another component l
120
120
 
121
121
  1. Clone the [repository](https://github.com/rossrobino/drab)
122
122
  2. `bun i`
123
- 3. `bun run dev`
123
+ 3. `bun dev`
124
124
 
125
125
  #### Add or edit a component
126
126
 
@@ -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 && e.key) {
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.5",
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": "^3.1.0",
62
- "@sveltejs/kit": "^1.29.1",
63
- "@sveltejs/package": "^2.2.3",
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.4",
66
- "@typescript-eslint/eslint-plugin": "^6.14.0",
67
- "@typescript-eslint/parser": "^6.14.0",
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.55.0",
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.9",
75
- "publint": "^0.2.6",
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.3.6",
79
+ "tailwindcss": "^3.4.0",
79
80
  "tslib": "^2.6.2",
80
81
  "typescript": "^5.3.3",
81
- "uico": "^0.1.6",
82
- "vite": "^4.5.0"
82
+ "uico": "^0.2.1",
83
+ "vite": "^5.0.11"
83
84
  }
84
85
  }