microboard-ui-temp 0.1.28 → 0.1.30

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 +84 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -256209,6 +256209,90 @@ registerItem({
256209
256209
  item: Deck,
256210
256210
  defaultData: defaultDeckData
256211
256211
  });
256212
+ registerHotkey({
256213
+ name: "getCard-top",
256214
+ hotkey: { key: { button: "KeyD", shift: true }, label: { windows: "Shift+D", mac: "⇧D" } },
256215
+ boardMode: "edit",
256216
+ hotkeyConfig: {
256217
+ allItemsType: ["Deck"],
256218
+ cb: (event, board) => {
256219
+ const deck = board?.selection.items.getSingle();
256220
+ if (!(deck instanceof Deck)) {
256221
+ return;
256222
+ }
256223
+ const card = deck.getTopCard();
256224
+ const { left, top } = deck.getMbr();
256225
+ if (!card) {
256226
+ return;
256227
+ }
256228
+ card.transformation.translateTo(left, top - 280);
256229
+ if (deck.getDeck().length === 0) {
256230
+ board?.remove(deck);
256231
+ }
256232
+ }
256233
+ }
256234
+ });
256235
+ registerHotkey({
256236
+ name: "getCard-bottom",
256237
+ hotkey: { key: { button: "KeyB", shift: true }, label: { windows: "Shift+B", mac: "⇧B" } },
256238
+ boardMode: "edit",
256239
+ hotkeyConfig: {
256240
+ allItemsType: ["Deck"],
256241
+ cb: (event, board) => {
256242
+ const deck = board?.selection.items.getSingle();
256243
+ if (!(deck instanceof Deck)) {
256244
+ return;
256245
+ }
256246
+ const card = deck.getBottomCard();
256247
+ const { left, top } = deck.getMbr();
256248
+ if (!card) {
256249
+ return;
256250
+ }
256251
+ card.transformation.translateTo(left, top - 280);
256252
+ if (deck.getDeck().length === 0) {
256253
+ board?.remove(deck);
256254
+ }
256255
+ }
256256
+ }
256257
+ });
256258
+ registerHotkey({
256259
+ name: "getCard-random",
256260
+ hotkey: { key: { button: "KeyR", shift: true }, label: { windows: "Shift+R", mac: "⇧R" } },
256261
+ boardMode: "edit",
256262
+ hotkeyConfig: {
256263
+ allItemsType: ["Deck"],
256264
+ cb: (event, board) => {
256265
+ const deck = board?.selection.items.getSingle();
256266
+ if (!(deck instanceof Deck)) {
256267
+ return;
256268
+ }
256269
+ const card = deck.getRandomCard();
256270
+ const { left, top } = deck.getMbr();
256271
+ if (!card) {
256272
+ return;
256273
+ }
256274
+ card.transformation.translateTo(left, top - 280);
256275
+ if (deck.getDeck().length === 0) {
256276
+ board?.remove(deck);
256277
+ }
256278
+ }
256279
+ }
256280
+ });
256281
+ registerHotkey({
256282
+ name: "flipDeck",
256283
+ hotkey: { key: { button: "KeyF" }, label: { windows: "F", mac: "F" } },
256284
+ boardMode: "edit",
256285
+ hotkeyConfig: {
256286
+ allItemsType: ["Deck"],
256287
+ cb: (event, board) => {
256288
+ const deck = board?.selection.items.getSingle();
256289
+ if (!(deck instanceof Deck)) {
256290
+ return;
256291
+ }
256292
+ deck.flipDeck();
256293
+ }
256294
+ }
256295
+ });
256212
256296
 
256213
256297
  class AddDice extends ShapeTool {
256214
256298
  constructor(board, name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-ui-temp",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
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.5",
54
+ "microboard-temp": "^0.5.10",
55
55
  "nanoid": "^5.1.5",
56
56
  "prop-types": "^15.8.1",
57
57
  "react-hot-toast": "2.4.1",