microboard-ui-temp 0.1.33 → 0.1.35

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.
Files changed (2) hide show
  1. package/dist/index.js +30 -33
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -255866,17 +255866,6 @@ function throttle2(func, delay) {
255866
255866
  }
255867
255867
  };
255868
255868
  }
255869
- var editModeHotkeyRegistry = {};
255870
- var viewModeHotkeyRegistry = {};
255871
- var hotkeyNames = {};
255872
- function registerHotkey({ name, hotkey, hotkeyConfig, boardMode }) {
255873
- if (boardMode === "edit") {
255874
- editModeHotkeyRegistry[name] = hotkeyConfig;
255875
- } else {
255876
- viewModeHotkeyRegistry[name] = hotkeyConfig;
255877
- }
255878
- hotkeyNames[name] = hotkey;
255879
- }
255880
255869
  var defaultCardData = {
255881
255870
  itemType: "Card",
255882
255871
  isOpen: false,
@@ -256012,21 +256001,17 @@ registerItem({
256012
256001
  item: Card,
256013
256002
  defaultData: defaultCardData
256014
256003
  });
256015
- registerHotkey({
256016
- name: "flipCard",
256017
- hotkey: { key: { button: "KeyF", shift: true }, label: { windows: "F", mac: "F" } },
256018
- boardMode: "edit",
256019
- hotkeyConfig: {
256020
- allItemsType: ["Card"],
256021
- cb: (event, board) => {
256022
- const cards = board?.selection.items.list();
256023
- if (!cards) {
256024
- return;
256025
- }
256026
- cards[0].toggleIsOpen(cards);
256027
- }
256004
+ var editModeHotkeyRegistry = {};
256005
+ var viewModeHotkeyRegistry = {};
256006
+ var hotkeyNames = {};
256007
+ function registerHotkey({ name, hotkey, hotkeyConfig, boardMode }) {
256008
+ if (boardMode === "edit") {
256009
+ editModeHotkeyRegistry[name] = hotkeyConfig;
256010
+ } else {
256011
+ viewModeHotkeyRegistry[name] = hotkeyConfig;
256028
256012
  }
256029
- });
256013
+ hotkeyNames[name] = hotkey;
256014
+ }
256030
256015
  var defaultDeckData = {
256031
256016
  itemType: "Deck"
256032
256017
  };
@@ -256279,17 +256264,29 @@ registerHotkey({
256279
256264
  }
256280
256265
  });
256281
256266
  registerHotkey({
256282
- name: "flipDeck",
256283
- hotkey: { key: { button: "KeyF", shift: true }, label: { windows: "F", mac: "F" } },
256267
+ name: "flipDeckOrCard",
256268
+ hotkey: { key: { button: "KeyF", shift: true }, label: { windows: "Shift+F", mac: "F" } },
256284
256269
  boardMode: "edit",
256285
256270
  hotkeyConfig: {
256286
- allItemsType: ["Deck"],
256271
+ allItemsType: ["Deck", "Card"],
256287
256272
  cb: (event, board) => {
256288
- const deck = board?.selection.items.getSingle();
256289
- if (!(deck instanceof Deck)) {
256273
+ const cardsOrDecks = board?.selection.items.list();
256274
+ if (!cardsOrDecks) {
256290
256275
  return;
256291
256276
  }
256292
- deck.flipDeck();
256277
+ let cards = [];
256278
+ let decks = [];
256279
+ for (const item of cardsOrDecks) {
256280
+ if (item instanceof Card) {
256281
+ cards.push(item);
256282
+ } else if (item instanceof Deck) {
256283
+ decks.push(item);
256284
+ }
256285
+ }
256286
+ cards[0]?.toggleIsOpen(cards);
256287
+ decks.forEach((deck) => {
256288
+ deck.flipDeck();
256289
+ });
256293
256290
  }
256294
256291
  }
256295
256292
  });
@@ -355558,7 +355555,7 @@ function FlipCard({ rounded = "none" }) {
355558
355555
  onClick: handleClick,
355559
355556
  variant: "secondary",
355560
355557
  rounded,
355561
- hotkey: getHotkeyLabel("flipCard")
355558
+ hotkey: getHotkeyLabel("flipDeckOrCard")
355562
355559
  }, /* @__PURE__ */ import_react284.default.createElement(Icon, {
355563
355560
  iconName: "RotateCard",
355564
355561
  width: 24,
@@ -355721,7 +355718,7 @@ function FlipDeck({ rounded = "none" }) {
355721
355718
  onClick: handleClick,
355722
355719
  variant: "secondary",
355723
355720
  rounded,
355724
- hotkey: getHotkeyLabel("flipDeck")
355721
+ hotkey: getHotkeyLabel("flipDeckOrCard")
355725
355722
  }, /* @__PURE__ */ import_react287.default.createElement(Icon, {
355726
355723
  iconName: "RotateCard",
355727
355724
  width: 24,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-ui-temp",
3
- "version": "0.1.33",
3
+ "version": "0.1.35",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "type": "module",
@@ -51,7 +51,7 @@
51
51
  "i18next-browser-languagedetector": "^8.2.0",
52
52
  "js-cookie": "^3.0.5",
53
53
  "jwt-decode": "^4.0.0",
54
- "microboard-temp": "^0.5.11",
54
+ "microboard-temp": "^0.5.12",
55
55
  "nanoid": "^5.1.5",
56
56
  "prop-types": "^15.8.1",
57
57
  "react-hot-toast": "2.4.1",