microboard-temp 0.4.79 → 0.4.80
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/dist/cjs/browser.js +7 -16
- package/dist/cjs/index.js +7 -16
- package/dist/cjs/node.js +7 -16
- package/dist/esm/browser.js +7 -16
- package/dist/esm/index.js +7 -16
- package/dist/esm/node.js +7 -16
- package/dist/types/Items/Examples/CardGame/Deck/Deck.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -47923,21 +47923,11 @@ var defaultDeckData = {
|
|
|
47923
47923
|
class Deck extends BaseItem {
|
|
47924
47924
|
subject = new Subject;
|
|
47925
47925
|
shouldUseCustomRender = false;
|
|
47926
|
-
constructor(board, id = ""
|
|
47926
|
+
constructor(board, id = "") {
|
|
47927
47927
|
super(board, id, defaultDeckData, true);
|
|
47928
47928
|
this.index.getUnderPoint = () => [];
|
|
47929
47929
|
this.index.getEnclosed = () => [];
|
|
47930
47930
|
this.index.getEnclosedOrCrossed = () => [];
|
|
47931
|
-
if (cards) {
|
|
47932
|
-
this.transformation.apply({
|
|
47933
|
-
class: "Transformation",
|
|
47934
|
-
method: "translateTo",
|
|
47935
|
-
item: [this.id],
|
|
47936
|
-
x: cards[0].left,
|
|
47937
|
-
y: cards[0].top
|
|
47938
|
-
});
|
|
47939
|
-
this.updateMbr();
|
|
47940
|
-
}
|
|
47941
47931
|
this.transformation.subject.subscribe(() => {
|
|
47942
47932
|
this.updateMbr();
|
|
47943
47933
|
this.subject.publish(this);
|
|
@@ -48025,8 +48015,8 @@ class Deck extends BaseItem {
|
|
|
48025
48015
|
const j = Math.floor(Math.random() * (i + 1));
|
|
48026
48016
|
[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
|
|
48027
48017
|
}
|
|
48028
|
-
this.index.
|
|
48029
|
-
|
|
48018
|
+
this.removeChildItems(this.index.list());
|
|
48019
|
+
this.addChildItems(shuffled);
|
|
48030
48020
|
}
|
|
48031
48021
|
apply(op) {
|
|
48032
48022
|
super.apply(op);
|
|
@@ -48034,11 +48024,12 @@ class Deck extends BaseItem {
|
|
|
48034
48024
|
}
|
|
48035
48025
|
updateMbr() {
|
|
48036
48026
|
const { translateX, translateY } = this.transformation.matrix;
|
|
48037
|
-
const
|
|
48027
|
+
const items = this.index.list();
|
|
48028
|
+
const itemsMbr = items[0].getMbr().combine(items.slice(1).map((item) => item.getMbr()));
|
|
48038
48029
|
this.left = translateX;
|
|
48039
48030
|
this.top = translateY;
|
|
48040
|
-
this.right = translateX +
|
|
48041
|
-
this.bottom = translateY +
|
|
48031
|
+
this.right = translateX + itemsMbr.getWidth();
|
|
48032
|
+
this.bottom = translateY + itemsMbr.getHeight();
|
|
48042
48033
|
}
|
|
48043
48034
|
deserialize(data) {
|
|
48044
48035
|
super.deserialize(data);
|
package/dist/cjs/index.js
CHANGED
|
@@ -47923,21 +47923,11 @@ var defaultDeckData = {
|
|
|
47923
47923
|
class Deck extends BaseItem {
|
|
47924
47924
|
subject = new Subject;
|
|
47925
47925
|
shouldUseCustomRender = false;
|
|
47926
|
-
constructor(board, id = ""
|
|
47926
|
+
constructor(board, id = "") {
|
|
47927
47927
|
super(board, id, defaultDeckData, true);
|
|
47928
47928
|
this.index.getUnderPoint = () => [];
|
|
47929
47929
|
this.index.getEnclosed = () => [];
|
|
47930
47930
|
this.index.getEnclosedOrCrossed = () => [];
|
|
47931
|
-
if (cards) {
|
|
47932
|
-
this.transformation.apply({
|
|
47933
|
-
class: "Transformation",
|
|
47934
|
-
method: "translateTo",
|
|
47935
|
-
item: [this.id],
|
|
47936
|
-
x: cards[0].left,
|
|
47937
|
-
y: cards[0].top
|
|
47938
|
-
});
|
|
47939
|
-
this.updateMbr();
|
|
47940
|
-
}
|
|
47941
47931
|
this.transformation.subject.subscribe(() => {
|
|
47942
47932
|
this.updateMbr();
|
|
47943
47933
|
this.subject.publish(this);
|
|
@@ -48025,8 +48015,8 @@ class Deck extends BaseItem {
|
|
|
48025
48015
|
const j = Math.floor(Math.random() * (i + 1));
|
|
48026
48016
|
[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
|
|
48027
48017
|
}
|
|
48028
|
-
this.index.
|
|
48029
|
-
|
|
48018
|
+
this.removeChildItems(this.index.list());
|
|
48019
|
+
this.addChildItems(shuffled);
|
|
48030
48020
|
}
|
|
48031
48021
|
apply(op) {
|
|
48032
48022
|
super.apply(op);
|
|
@@ -48034,11 +48024,12 @@ class Deck extends BaseItem {
|
|
|
48034
48024
|
}
|
|
48035
48025
|
updateMbr() {
|
|
48036
48026
|
const { translateX, translateY } = this.transformation.matrix;
|
|
48037
|
-
const
|
|
48027
|
+
const items = this.index.list();
|
|
48028
|
+
const itemsMbr = items[0].getMbr().combine(items.slice(1).map((item) => item.getMbr()));
|
|
48038
48029
|
this.left = translateX;
|
|
48039
48030
|
this.top = translateY;
|
|
48040
|
-
this.right = translateX +
|
|
48041
|
-
this.bottom = translateY +
|
|
48031
|
+
this.right = translateX + itemsMbr.getWidth();
|
|
48032
|
+
this.bottom = translateY + itemsMbr.getHeight();
|
|
48042
48033
|
}
|
|
48043
48034
|
deserialize(data) {
|
|
48044
48035
|
super.deserialize(data);
|
package/dist/cjs/node.js
CHANGED
|
@@ -50396,21 +50396,11 @@ var defaultDeckData = {
|
|
|
50396
50396
|
class Deck extends BaseItem {
|
|
50397
50397
|
subject = new Subject;
|
|
50398
50398
|
shouldUseCustomRender = false;
|
|
50399
|
-
constructor(board, id = ""
|
|
50399
|
+
constructor(board, id = "") {
|
|
50400
50400
|
super(board, id, defaultDeckData, true);
|
|
50401
50401
|
this.index.getUnderPoint = () => [];
|
|
50402
50402
|
this.index.getEnclosed = () => [];
|
|
50403
50403
|
this.index.getEnclosedOrCrossed = () => [];
|
|
50404
|
-
if (cards) {
|
|
50405
|
-
this.transformation.apply({
|
|
50406
|
-
class: "Transformation",
|
|
50407
|
-
method: "translateTo",
|
|
50408
|
-
item: [this.id],
|
|
50409
|
-
x: cards[0].left,
|
|
50410
|
-
y: cards[0].top
|
|
50411
|
-
});
|
|
50412
|
-
this.updateMbr();
|
|
50413
|
-
}
|
|
50414
50404
|
this.transformation.subject.subscribe(() => {
|
|
50415
50405
|
this.updateMbr();
|
|
50416
50406
|
this.subject.publish(this);
|
|
@@ -50498,8 +50488,8 @@ class Deck extends BaseItem {
|
|
|
50498
50488
|
const j = Math.floor(Math.random() * (i + 1));
|
|
50499
50489
|
[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
|
|
50500
50490
|
}
|
|
50501
|
-
this.index.
|
|
50502
|
-
|
|
50491
|
+
this.removeChildItems(this.index.list());
|
|
50492
|
+
this.addChildItems(shuffled);
|
|
50503
50493
|
}
|
|
50504
50494
|
apply(op) {
|
|
50505
50495
|
super.apply(op);
|
|
@@ -50507,11 +50497,12 @@ class Deck extends BaseItem {
|
|
|
50507
50497
|
}
|
|
50508
50498
|
updateMbr() {
|
|
50509
50499
|
const { translateX, translateY } = this.transformation.matrix;
|
|
50510
|
-
const
|
|
50500
|
+
const items = this.index.list();
|
|
50501
|
+
const itemsMbr = items[0].getMbr().combine(items.slice(1).map((item) => item.getMbr()));
|
|
50511
50502
|
this.left = translateX;
|
|
50512
50503
|
this.top = translateY;
|
|
50513
|
-
this.right = translateX +
|
|
50514
|
-
this.bottom = translateY +
|
|
50504
|
+
this.right = translateX + itemsMbr.getWidth();
|
|
50505
|
+
this.bottom = translateY + itemsMbr.getHeight();
|
|
50515
50506
|
}
|
|
50516
50507
|
deserialize(data) {
|
|
50517
50508
|
super.deserialize(data);
|
package/dist/esm/browser.js
CHANGED
|
@@ -47772,21 +47772,11 @@ var defaultDeckData = {
|
|
|
47772
47772
|
class Deck extends BaseItem {
|
|
47773
47773
|
subject = new Subject;
|
|
47774
47774
|
shouldUseCustomRender = false;
|
|
47775
|
-
constructor(board, id = ""
|
|
47775
|
+
constructor(board, id = "") {
|
|
47776
47776
|
super(board, id, defaultDeckData, true);
|
|
47777
47777
|
this.index.getUnderPoint = () => [];
|
|
47778
47778
|
this.index.getEnclosed = () => [];
|
|
47779
47779
|
this.index.getEnclosedOrCrossed = () => [];
|
|
47780
|
-
if (cards) {
|
|
47781
|
-
this.transformation.apply({
|
|
47782
|
-
class: "Transformation",
|
|
47783
|
-
method: "translateTo",
|
|
47784
|
-
item: [this.id],
|
|
47785
|
-
x: cards[0].left,
|
|
47786
|
-
y: cards[0].top
|
|
47787
|
-
});
|
|
47788
|
-
this.updateMbr();
|
|
47789
|
-
}
|
|
47790
47780
|
this.transformation.subject.subscribe(() => {
|
|
47791
47781
|
this.updateMbr();
|
|
47792
47782
|
this.subject.publish(this);
|
|
@@ -47874,8 +47864,8 @@ class Deck extends BaseItem {
|
|
|
47874
47864
|
const j = Math.floor(Math.random() * (i + 1));
|
|
47875
47865
|
[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
|
|
47876
47866
|
}
|
|
47877
|
-
this.index.
|
|
47878
|
-
|
|
47867
|
+
this.removeChildItems(this.index.list());
|
|
47868
|
+
this.addChildItems(shuffled);
|
|
47879
47869
|
}
|
|
47880
47870
|
apply(op) {
|
|
47881
47871
|
super.apply(op);
|
|
@@ -47883,11 +47873,12 @@ class Deck extends BaseItem {
|
|
|
47883
47873
|
}
|
|
47884
47874
|
updateMbr() {
|
|
47885
47875
|
const { translateX, translateY } = this.transformation.matrix;
|
|
47886
|
-
const
|
|
47876
|
+
const items = this.index.list();
|
|
47877
|
+
const itemsMbr = items[0].getMbr().combine(items.slice(1).map((item) => item.getMbr()));
|
|
47887
47878
|
this.left = translateX;
|
|
47888
47879
|
this.top = translateY;
|
|
47889
|
-
this.right = translateX +
|
|
47890
|
-
this.bottom = translateY +
|
|
47880
|
+
this.right = translateX + itemsMbr.getWidth();
|
|
47881
|
+
this.bottom = translateY + itemsMbr.getHeight();
|
|
47891
47882
|
}
|
|
47892
47883
|
deserialize(data) {
|
|
47893
47884
|
super.deserialize(data);
|
package/dist/esm/index.js
CHANGED
|
@@ -47765,21 +47765,11 @@ var defaultDeckData = {
|
|
|
47765
47765
|
class Deck extends BaseItem {
|
|
47766
47766
|
subject = new Subject;
|
|
47767
47767
|
shouldUseCustomRender = false;
|
|
47768
|
-
constructor(board, id = ""
|
|
47768
|
+
constructor(board, id = "") {
|
|
47769
47769
|
super(board, id, defaultDeckData, true);
|
|
47770
47770
|
this.index.getUnderPoint = () => [];
|
|
47771
47771
|
this.index.getEnclosed = () => [];
|
|
47772
47772
|
this.index.getEnclosedOrCrossed = () => [];
|
|
47773
|
-
if (cards) {
|
|
47774
|
-
this.transformation.apply({
|
|
47775
|
-
class: "Transformation",
|
|
47776
|
-
method: "translateTo",
|
|
47777
|
-
item: [this.id],
|
|
47778
|
-
x: cards[0].left,
|
|
47779
|
-
y: cards[0].top
|
|
47780
|
-
});
|
|
47781
|
-
this.updateMbr();
|
|
47782
|
-
}
|
|
47783
47773
|
this.transformation.subject.subscribe(() => {
|
|
47784
47774
|
this.updateMbr();
|
|
47785
47775
|
this.subject.publish(this);
|
|
@@ -47867,8 +47857,8 @@ class Deck extends BaseItem {
|
|
|
47867
47857
|
const j = Math.floor(Math.random() * (i + 1));
|
|
47868
47858
|
[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
|
|
47869
47859
|
}
|
|
47870
|
-
this.index.
|
|
47871
|
-
|
|
47860
|
+
this.removeChildItems(this.index.list());
|
|
47861
|
+
this.addChildItems(shuffled);
|
|
47872
47862
|
}
|
|
47873
47863
|
apply(op) {
|
|
47874
47864
|
super.apply(op);
|
|
@@ -47876,11 +47866,12 @@ class Deck extends BaseItem {
|
|
|
47876
47866
|
}
|
|
47877
47867
|
updateMbr() {
|
|
47878
47868
|
const { translateX, translateY } = this.transformation.matrix;
|
|
47879
|
-
const
|
|
47869
|
+
const items = this.index.list();
|
|
47870
|
+
const itemsMbr = items[0].getMbr().combine(items.slice(1).map((item) => item.getMbr()));
|
|
47880
47871
|
this.left = translateX;
|
|
47881
47872
|
this.top = translateY;
|
|
47882
|
-
this.right = translateX +
|
|
47883
|
-
this.bottom = translateY +
|
|
47873
|
+
this.right = translateX + itemsMbr.getWidth();
|
|
47874
|
+
this.bottom = translateY + itemsMbr.getHeight();
|
|
47884
47875
|
}
|
|
47885
47876
|
deserialize(data) {
|
|
47886
47877
|
super.deserialize(data);
|
package/dist/esm/node.js
CHANGED
|
@@ -50233,21 +50233,11 @@ var defaultDeckData = {
|
|
|
50233
50233
|
class Deck extends BaseItem {
|
|
50234
50234
|
subject = new Subject;
|
|
50235
50235
|
shouldUseCustomRender = false;
|
|
50236
|
-
constructor(board, id = ""
|
|
50236
|
+
constructor(board, id = "") {
|
|
50237
50237
|
super(board, id, defaultDeckData, true);
|
|
50238
50238
|
this.index.getUnderPoint = () => [];
|
|
50239
50239
|
this.index.getEnclosed = () => [];
|
|
50240
50240
|
this.index.getEnclosedOrCrossed = () => [];
|
|
50241
|
-
if (cards) {
|
|
50242
|
-
this.transformation.apply({
|
|
50243
|
-
class: "Transformation",
|
|
50244
|
-
method: "translateTo",
|
|
50245
|
-
item: [this.id],
|
|
50246
|
-
x: cards[0].left,
|
|
50247
|
-
y: cards[0].top
|
|
50248
|
-
});
|
|
50249
|
-
this.updateMbr();
|
|
50250
|
-
}
|
|
50251
50241
|
this.transformation.subject.subscribe(() => {
|
|
50252
50242
|
this.updateMbr();
|
|
50253
50243
|
this.subject.publish(this);
|
|
@@ -50335,8 +50325,8 @@ class Deck extends BaseItem {
|
|
|
50335
50325
|
const j = Math.floor(Math.random() * (i + 1));
|
|
50336
50326
|
[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
|
|
50337
50327
|
}
|
|
50338
|
-
this.index.
|
|
50339
|
-
|
|
50328
|
+
this.removeChildItems(this.index.list());
|
|
50329
|
+
this.addChildItems(shuffled);
|
|
50340
50330
|
}
|
|
50341
50331
|
apply(op) {
|
|
50342
50332
|
super.apply(op);
|
|
@@ -50344,11 +50334,12 @@ class Deck extends BaseItem {
|
|
|
50344
50334
|
}
|
|
50345
50335
|
updateMbr() {
|
|
50346
50336
|
const { translateX, translateY } = this.transformation.matrix;
|
|
50347
|
-
const
|
|
50337
|
+
const items = this.index.list();
|
|
50338
|
+
const itemsMbr = items[0].getMbr().combine(items.slice(1).map((item) => item.getMbr()));
|
|
50348
50339
|
this.left = translateX;
|
|
50349
50340
|
this.top = translateY;
|
|
50350
|
-
this.right = translateX +
|
|
50351
|
-
this.bottom = translateY +
|
|
50341
|
+
this.right = translateX + itemsMbr.getWidth();
|
|
50342
|
+
this.bottom = translateY + itemsMbr.getHeight();
|
|
50352
50343
|
}
|
|
50353
50344
|
deserialize(data) {
|
|
50354
50345
|
super.deserialize(data);
|
|
@@ -8,7 +8,7 @@ export declare const defaultDeckData: BaseItemData;
|
|
|
8
8
|
export declare class Deck extends BaseItem {
|
|
9
9
|
readonly subject: Subject<Deck>;
|
|
10
10
|
shouldUseCustomRender: boolean;
|
|
11
|
-
constructor(board: Board, id?: string
|
|
11
|
+
constructor(board: Board, id?: string);
|
|
12
12
|
applyAddChildren(childIds: string[]): void;
|
|
13
13
|
applyRemoveChildren(childIds: string[]): void;
|
|
14
14
|
getDeck(): Card[];
|