@tobq/boardclip 2.1.115 → 2.1.116

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.
@@ -218,18 +218,13 @@ function install({ shortcut, onPressed: handler }) {
218
218
  return registerParsedHotKey({ parsed, id: 1, namespace: DEFAULT_NAMESPACE, handler });
219
219
  }
220
220
 
221
- function shortcutForSlot(shortcut, slot) {
222
- const parts = String(shortcut || '').split('+').map(normalizeShortcutPart).filter(Boolean);
223
- if (!parts.length) return '';
224
- parts[parts.length - 1] = String(slot);
225
- return parts.join('+');
226
- }
227
-
228
- function installQuickPaste({ shortcut, onSlot }) {
221
+ // shortcuts[n - 1] = slot n's chord (main's quickPasteShortcutForSlot, the
222
+ // one slot rule: a numpad digit stays a numpad digit).
223
+ function installQuickPaste({ shortcuts, onSlot }) {
229
224
  if (process.platform !== 'darwin') return { ok: false, error: 'macOS hotkeys are only available on macOS.' };
230
225
  clearQuickPasteShortcuts();
231
226
  for (let slot = 1; slot <= 9; slot++) {
232
- const slotShortcut = shortcutForSlot(shortcut, slot);
227
+ const slotShortcut = shortcuts[slot - 1] || '';
233
228
  const parsed = parseShortcut(slotShortcut);
234
229
  if (!parsed) {
235
230
  clearQuickPasteShortcuts();
package/main.js CHANGED
@@ -8127,8 +8127,9 @@ function registerShortcuts() {
8127
8127
  if (quickPasteKey) {
8128
8128
  if (process.platform === 'darwin') {
8129
8129
  const hook = getMacosHotkey();
8130
+ const slotKeys = Array.from({ length: 9 }, (_, i) => quickPasteShortcutForSlot(quickPasteKey, i + 1));
8130
8131
  const result = hook.installQuickPaste({
8131
- shortcut: quickPasteKey,
8132
+ shortcuts: slotKeys,
8132
8133
  onSlot: slot => {
8133
8134
  handleQuickPaste(slot).catch(error => {
8134
8135
  diagnostics.record('shortcut.quick_paste_error', { slot, error: error && error.message }, { forceFile: true });
@@ -8139,7 +8140,7 @@ function registerShortcuts() {
8139
8140
  for (let n = 1; n <= 9; n++) {
8140
8141
  quickPasteRegistrations.push({
8141
8142
  slot: n,
8142
- key: quickPasteShortcutForSlot(quickPasteKey, n),
8143
+ key: slotKeys[n - 1],
8143
8144
  registered: quickPasteRegistered,
8144
8145
  backend: 'carbon',
8145
8146
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tobq/boardclip",
3
3
  "productName": "BoardClip",
4
- "version": "2.1.115",
4
+ "version": "2.1.116",
5
5
  "description": "Cross-platform clipboard history tray app with numpad quick-paste and native cloud sync",
6
6
  "keywords": [
7
7
  "clipboard",