bard-legends-framework 0.9.5 → 0.9.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/dist/_interfaces/index.d.ts +2 -2
- package/dist/_interfaces/index.js +2 -3
- package/dist/game-entities/attachable/attachable.d.ts +6 -6
- package/dist/game-entities/attachable/attachable.js +28 -30
- package/dist/game-entities/attachable/attachable.spec.js +129 -128
- package/dist/game-entities/attachable/attachable.store.d.ts +5 -5
- package/dist/game-entities/attachable/attachable.store.js +34 -32
- package/dist/game-entities/attachable/attachable.test.js +132 -131
- package/dist/game-entities/attachable/destroyable.d.ts +13 -13
- package/dist/game-entities/attachable/destroyable.js +64 -69
- package/dist/game-entities/attachable/helpers/decorate-actions-lib.d.ts +15 -15
- package/dist/game-entities/attachable/helpers/decorate-actions-lib.js +125 -116
- package/dist/game-entities/attachable/helpers/referance-variable.d.ts +15 -15
- package/dist/game-entities/attachable/helpers/referance-variable.js +47 -48
- package/dist/game-entities/attachable/interfaces.d.ts +6 -6
- package/dist/game-entities/attachable/interfaces.js +2 -3
- package/dist/game-entities/base/helpers/decorate-actions-lib.js +0 -1
- package/dist/game-entities/controller/controller.js +0 -1
- package/dist/game-entities/controller/controller.spec.js +128 -125
- package/dist/game-entities/entity/entity.spec.js +263 -293
- package/dist/game-entities/entity/helpers/view-creation.helper.d.ts +7 -7
- package/dist/game-entities/entity/helpers/view-creation.helper.js +48 -48
- package/dist/game-entities/scene/scene.spec.js +219 -223
- package/dist/game-entities/service/service.js +0 -4
- package/dist/game-entities/service/service.spec.js +265 -237
- package/dist/game-entities/service/service.test.js +4 -2
- package/dist/game-entities/update-loop.d.ts +18 -18
- package/dist/game-entities/update-loop.js +46 -28
- package/dist/game-entities/view/view.js +1 -1
- package/dist/game-entities/view/view.spec.js +490 -506
- package/dist/game-entities/view/view.test.js +1 -1
- package/dist/lib/animator/animations.d.ts +13 -13
- package/dist/lib/animator/animations.js +43 -40
- package/dist/lib/animator/animator.d.ts +41 -41
- package/dist/lib/animator/animator.js +194 -197
- package/dist/lib/animator/animator.spec.js +699 -612
- package/dist/lib/animator/index.js +24 -19
- package/dist/lib/libraries/animator/animations.d.ts +13 -13
- package/dist/lib/libraries/animator/animations.js +43 -40
- package/dist/lib/libraries/animator/animator.d.ts +41 -41
- package/dist/lib/libraries/animator/animator.js +194 -197
- package/dist/lib/libraries/animator/animator.spec.js +699 -612
- package/dist/lib/libraries/animator/index.js +24 -19
- package/dist/lib/libraries/path-finder/path-finder.d.ts +2 -2
- package/dist/lib/libraries/path-finder/path-finder.js +19 -20
- package/dist/lib/path-finder/path-finder.d.ts +2 -2
- package/dist/lib/path-finder/path-finder.js +19 -20
- package/dist/lib/services/keyboard/keyboard.d.ts +4 -4
- package/dist/lib/services/keyboard/keyboard.js +39 -31
- package/dist/lib/services/mouse/mouse.service.d.ts +8 -8
- package/dist/lib/services/mouse/mouse.service.js +65 -53
- package/dist/lib/services/mouse/mouser-target-focus.service.d.ts +11 -11
- package/dist/lib/services/mouse/mouser-target-focus.service.js +83 -81
- package/dist/lib/update-loop.d.ts +10 -10
- package/dist/lib/update-loop.js +35 -27
- package/dist/physics/entitity-types/immovable-physics-entity.d.ts +6 -6
- package/dist/physics/entitity-types/immovable-physics-entity.js +23 -24
- package/dist/physics/entitity-types/movable-entity.d.ts +6 -6
- package/dist/physics/entitity-types/movable-entity.js +21 -22
- package/dist/physics/entitity-types/movable-physics-entity.d.ts +14 -14
- package/dist/physics/entitity-types/movable-physics-entity.js +83 -88
- package/dist/physics/entitity-types/physics-entity.d.ts +23 -23
- package/dist/physics/entitity-types/physics-entity.js +97 -88
- package/dist/physics/helpers/closest-available-space.helper.d.ts +16 -16
- package/dist/physics/helpers/closest-available-space.helper.js +98 -96
- package/dist/physics/helpers/closest-available-space.helper.spec.js +115 -68
- package/dist/physics/helpers/p2js.helper.d.ts +3 -3
- package/dist/physics/helpers/p2js.helper.js +21 -22
- package/dist/physics/helpers/shape-factory.d.ts +9 -4
- package/dist/physics/helpers/shape-factory.js +99 -75
- package/dist/physics/libs/p2js.helper.js +1 -1
- package/dist/physics/libs/position-to-grid-position-converter.d.ts +3 -3
- package/dist/physics/libs/position-to-grid-position-converter.js +15 -13
- package/dist/physics/module//360/237/223/220services/availability-grid.service.d.ts +10 -5
- package/dist/physics/module//360/237/223/220services/availability-grid.service.js +77 -57
- package/dist/physics/module//360/237/223/220services/border.service.d.ts +2 -2
- package/dist/physics/module//360/237/223/220services/border.service.js +57 -37
- package/dist/physics/module//360/237/223/220services/collision/physics-body-group.service.js +1 -1
- package/dist/physics/module//360/237/223/220services/collisions.service.d.ts +7 -7
- package/dist/physics/module//360/237/223/220services/collisions.service.js +110 -98
- package/dist/physics/module//360/237/223/220services/debug-visuals.service.d.ts +28 -6
- package/dist/physics/module//360/237/223/220services/debug-visuals.service.js +121 -89
- package/dist/physics/module//360/237/223/220services/eliptic-explosion.service.d.ts +15 -7
- package/dist/physics/module//360/237/223/220services/eliptic-explosion.service.js +117 -93
- package/dist/physics/module//360/237/223/220services/explosion.service.d.ts +14 -7
- package/dist/physics/module//360/237/223/220services/explosion.service.js +102 -77
- package/dist/physics/module//360/237/223/220services/explosions/eliptic-explosion.service.d.ts +15 -7
- package/dist/physics/module//360/237/223/220services/explosions/eliptic-explosion.service.js +117 -93
- package/dist/physics/module//360/237/223/220services/explosions/explosion.service.d.ts +14 -7
- package/dist/physics/module//360/237/223/220services/explosions/explosion.service.js +102 -77
- package/dist/physics/module//360/237/223/220services/explosions/helpers/ray-cast-hit-converter.d.ts +3 -3
- package/dist/physics/module//360/237/223/220services/explosions/helpers/ray-cast-hit-converter.js +71 -67
- package/dist/physics/module//360/237/223/220services/helpers/ray-cast-hit-converter.d.ts +3 -3
- package/dist/physics/module//360/237/223/220services/helpers/ray-cast-hit-converter.js +71 -67
- package/dist/physics/module//360/237/223/220services/impact/eliptic-explosion.service.js +1 -1
- package/dist/physics/module//360/237/223/220services/materials.service.d.ts +16 -11
- package/dist/physics/module//360/237/223/220services/materials.service.js +118 -108
- package/dist/physics/module//360/237/223/220services/path-finder.service.d.ts +19 -8
- package/dist/physics/module//360/237/223/220services/path-finder.service.js +121 -82
- package/dist/physics/module//360/237/223/220services/physics-world.service.d.ts +30 -15
- package/dist/physics/module//360/237/223/220services/physics-world.service.js +122 -100
- package/dist/physics/module//360/237/223/220services/ray-casting.service.d.ts +3 -3
- package/dist/physics/module//360/237/223/220services/ray-casting.service.js +87 -86
- package/dist/physics/module//360/237/223/220services/shape-creation.service.d.ts +9 -4
- package/dist/physics/module//360/237/223/220services/shape-creation.service.js +113 -84
- package/dist/physics/module//360/237/223/220services/test-visuals/test-visuals.service.js +2 -1
- package/dist/physics/module//360/237/247/212entities/data-structures/availability-grid-cache.d.ts +8 -8
- package/dist/physics/module//360/237/247/212entities/data-structures/availability-grid-cache.js +32 -33
- package/dist/physics/physics-world.d.ts +50 -34
- package/dist/physics/physics-world.js +142 -133
- package/dist/physics/sub-elements/available-spaces/helpers/availability-grid.helper.d.ts +3 -3
- package/dist/physics/sub-elements/available-spaces/helpers/availability-grid.helper.js +15 -13
- package/dist/physics/sub-elements/available-spaces/physics-availability-grid.d.ts +9 -9
- package/dist/physics/sub-elements/available-spaces/physics-availability-grid.js +82 -77
- package/dist/physics/sub-elements/available-spaces/physics-available-spaces.d.ts +18 -14
- package/dist/physics/sub-elements/available-spaces/physics-available-spaces.js +91 -79
- package/dist/physics/sub-elements/collisions/contact-equation-orginiser.d.ts +11 -11
- package/dist/physics/sub-elements/collisions/contact-equation-orginiser.js +84 -76
- package/dist/physics/sub-elements/collisions/physics-collision.d.ts +7 -7
- package/dist/physics/sub-elements/collisions/physics-collision.js +43 -44
- package/dist/physics/sub-elements/elements/physics-body-groups.d.ts +11 -11
- package/dist/physics/sub-elements/elements/physics-body-groups.js +54 -54
- package/dist/physics/sub-elements/elements/physics-materials.d.ts +15 -10
- package/dist/physics/sub-elements/elements/physics-materials.js +101 -100
- package/dist/physics/sub-elements/elements/physics-world-borders.d.ts +3 -3
- package/dist/physics/sub-elements/elements/physics-world-borders.js +69 -45
- package/dist/physics/sub-elements/physics-body-groups.d.ts +8 -8
- package/dist/physics/sub-elements/physics-body-groups.js +41 -42
- package/dist/physics/sub-elements/physics-collision.d.ts +16 -16
- package/dist/physics/sub-elements/physics-collision.js +141 -121
- package/dist/physics/sub-elements/physics-materials.d.ts +15 -10
- package/dist/physics/sub-elements/physics-materials.js +101 -100
- package/dist/physics/sub-elements/physics-world-borders.d.ts +2 -2
- package/dist/physics/sub-elements/physics-world-borders.js +25 -26
- package/dist/physics/sub-elements/raycasting/physics-body-explosion-hit.d.ts +15 -11
- package/dist/physics/sub-elements/raycasting/physics-body-explosion-hit.js +59 -59
- package/dist/physics/sub-elements/raycasting/physics-explosion.d.ts +13 -6
- package/dist/physics/sub-elements/raycasting/physics-explosion.js +108 -73
- package/dist/physics/sub-elements/raycasting/ray-cast.d.ts +19 -19
- package/dist/physics/sub-elements/raycasting/ray-cast.js +93 -98
- package/dist/pixi/display-object/components/filters.d.ts +18 -18
- package/dist/pixi/display-object/components/filters.js +106 -81
- package/dist/pixi/display-object/components/glow-effect.d.ts +8 -8
- package/dist/pixi/display-object/components/glow-effect.js +33 -36
- package/dist/pixi/display-object/components/glow-filter.d.ts +8 -8
- package/dist/pixi/display-object/components/glow-filter.js +33 -36
- package/dist/pixi/display-object/container-attributes.js +1 -1
- package/dist/pixi/display-object/display-object-attributes.d.ts +41 -41
- package/dist/pixi/display-object/display-object-attributes.js +148 -150
- package/dist/pixi/display-object/display-object.d.ts +17 -17
- package/dist/pixi/display-object/display-object.js +79 -75
- package/dist/pixi/display-object/filters/base-filters/alpha-primer-color.filter.d.ts +9 -4
- package/dist/pixi/display-object/filters/base-filters/alpha-primer-color.filter.js +89 -77
- package/dist/pixi/display-object/filters/base-filters/blur.filter.js +30 -30
- package/dist/pixi/display-object/filters/base-filters/contrast-filter.d.ts +9 -4
- package/dist/pixi/display-object/filters/base-filters/contrast-filter.js +62 -53
- package/dist/pixi/display-object/filters/base-filters/expand-with-alpha-color.d.ts +10 -5
- package/dist/pixi/display-object/filters/base-filters/expand-with-alpha-color.js +93 -81
- package/dist/pixi/display-object/filters/base-filters/expand-with-color-gradient.d.ts +12 -7
- package/dist/pixi/display-object/filters/base-filters/expand-with-color-gradient.js +120 -109
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.d.ts +10 -5
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.filter.js +32 -32
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.js +92 -85
- package/dist/pixi/display-object/filters/templates/checking-neighbors.template.js +28 -28
- package/dist/pixi/display-object/filters/templates/plane.template.js +20 -20
- package/dist/pixi/display-object/filters.js +20 -4
- package/dist/pixi/display-object/objects/components/filters.d.ts +18 -18
- package/dist/pixi/display-object/objects/components/filters.js +106 -81
- package/dist/pixi/display-object/objects/container.d.ts +2 -2
- package/dist/pixi/display-object/objects/container.js +39 -30
- package/dist/pixi/display-object/objects/graphics.d.ts +28 -28
- package/dist/pixi/display-object/objects/graphics.js +218 -202
- package/dist/pixi/display-object/objects/helpers/filters.d.ts +25 -25
- package/dist/pixi/display-object/objects/helpers/filters.js +150 -124
- package/dist/pixi/display-object/objects/helpers/glow-sprite-generator.d.ts +7 -7
- package/dist/pixi/display-object/objects/helpers/glow-sprite-generator.js +114 -95
- package/dist/pixi/display-object/objects/premade-objects/sprite-with-glowing-shapes.d.ts +5 -5
- package/dist/pixi/display-object/objects/premade-objects/sprite-with-glowing-shapes.js +81 -57
- package/dist/pixi/display-object/objects/sprite.d.ts +43 -43
- package/dist/pixi/display-object/objects/sprite.js +248 -233
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.js +1 -1
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.test.js +9 -9
- package/dist/pixi/display-object/objects/text/helpers/rich-text-to-plane-text.d.ts +1 -1
- package/dist/pixi/display-object/objects/text.d.ts +25 -25
- package/dist/pixi/display-object/objects/text.js +111 -102
- package/dist/pixi/display-object/premade-objects/sprite-with-glowing-shapes.d.ts +13 -9
- package/dist/pixi/display-object/premade-objects/sprite-with-glowing-shapes.js +96 -67
- package/dist/pixi/game.d.ts +1 -1
- package/dist/pixi/game.js +2 -2
- package/dist/pixi/helpers/glow-sprite-generator.d.ts +6 -6
- package/dist/pixi/helpers/glow-sprite-generator.js +99 -84
- package/dist/pixi/helpers/pixi-container.helper.d.ts +1 -1
- package/dist/pixi/helpers/pixi-container.helper.js +10 -8
- package/dist/pixi/helpers/screen-position-to-stage.helper.d.ts +1 -1
- package/dist/pixi/helpers/screen-position-to-stage.helper.js +12 -12
- package/dist/pixi/helpers/screen-position-to-stage.helper.test.js +174 -79
- package/dist/pixi/modules/CAMERA/index.d.ts +1 -1
- package/dist/pixi/modules/CAMERA/index.js +3 -3
- package/dist/services/keyboard/keyboard.d.ts +4 -4
- package/dist/services/keyboard/keyboard.js +39 -31
- package/dist/services/mouse/mouse.service.d.ts +8 -8
- package/dist/services/mouse/mouse.service.js +65 -53
- package/dist/services/mouse/mouser-target-focus.service.d.ts +11 -11
- package/dist/services/mouse/mouser-target-focus.service.js +83 -81
- package/dist/utilities/libraries/animator/animating-content/state-animation.d.ts +29 -26
- package/dist/utilities/libraries/animator/animating-content/state-animation.js +159 -165
- package/dist/utilities/libraries/animator/animating-content/state-animation.test.js +386 -375
- package/dist/utilities/libraries/animator/animator.spec.js +765 -656
- package/dist/utilities/libraries/binary-heap/binary-heap.d.ts +11 -11
- package/dist/utilities/libraries/binary-heap/binary-heap.js +79 -81
- package/dist/utilities/libraries/data-structures/binary-heap/binary-heap.d.ts +11 -11
- package/dist/utilities/libraries/data-structures/binary-heap/binary-heap.js +79 -81
- package/dist/utilities/libraries/data-structures/grid/grid.d.ts +35 -31
- package/dist/utilities/libraries/data-structures/grid/grid.js +128 -117
- package/dist/utilities/libraries/data-structures/grid/grid.spec.js +176 -138
- package/dist/utilities/libraries/data-structures/grid/grid.test.js +218 -141
- package/dist/utilities/libraries/data-structures/grid/position-to-grid-position-converter.d.ts +3 -3
- package/dist/utilities/libraries/data-structures/grid/position-to-grid-position-converter.js +15 -13
- package/dist/utilities/libraries/data-structures/queue/queue.d.ts +21 -21
- package/dist/utilities/libraries/data-structures/queue/queue.js +63 -66
- package/dist/utilities/libraries/data-structures/queue/queue.test.js +54 -55
- package/dist/utilities/libraries/grid-algorithms/closest-available-space/closest-available-space.helper.spec.js +122 -68
- package/dist/utilities/libraries/grid-algorithms/path-finder/path-finder.spec.js +140 -135
- package/dist/utilities/libraries/grid-algorithms/vector-field-path-finder/vector-field-path-finder.spec.js +293 -229
- package/dist/utilities/libraries/path-finder/path-finder.d.ts +7 -7
- package/dist/utilities/libraries/path-finder/path-finder.js +113 -109
- package/dist/utilities/libraries/path-finder/path-finder.spec.js +131 -106
- package/dist/utilities/services/keyboard/keyboard.d.ts +4 -4
- package/dist/utilities/services/keyboard/keyboard.js +42 -34
- package/dist/utilities/services/mouse/helpers/mouse-position.helper.d.ts +1 -1
- package/dist/utilities/services/mouse/helpers/mouse-position.helper.js +12 -12
- package/dist/utilities/services/mouse/helpers/mouse-position.helper.test.js +168 -73
- package/dist/utilities/services/mouse/mouse-target-focus.service.d.ts +15 -15
- package/dist/utilities/services/mouse/mouse-target-focus.service.js +79 -76
- package/dist/utilities/services/mouse/mouse.service.d.ts +9 -9
- package/dist/utilities/services/mouse/mouse.service.js +86 -72
- package/dist/utilities/services/mouse/mouser-target-focus.service.d.ts +11 -11
- package/dist/utilities/services/mouse/mouser-target-focus.service.js +83 -81
- package/package.json +6 -12
|
@@ -1,125 +1,134 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
var __createBinding =
|
|
2
|
+
(this && this.__createBinding) ||
|
|
3
|
+
(Object.create
|
|
4
|
+
? (o, m, k, k2) => {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: () => m[k] };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}
|
|
12
|
+
: (o, m, k, k2) => {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
});
|
|
16
|
+
var __setModuleDefault =
|
|
17
|
+
(this && this.__setModuleDefault) ||
|
|
18
|
+
(Object.create
|
|
19
|
+
? (o, v) => {
|
|
20
|
+
Object.defineProperty(o, 'default', { enumerable: true, value: v });
|
|
21
|
+
}
|
|
22
|
+
: (o, v) => {
|
|
23
|
+
o['default'] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar =
|
|
26
|
+
(this && this.__importStar) ||
|
|
27
|
+
(mod => {
|
|
19
28
|
if (mod && mod.__esModule) return mod;
|
|
20
29
|
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !==
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== 'default' && Object.hasOwn(mod, k)) __createBinding(result, mod, k);
|
|
22
31
|
__setModuleDefault(result, mod);
|
|
23
32
|
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports,
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
26
35
|
exports.ActionsLibDecorator = void 0;
|
|
27
|
-
const ActionsLib = __importStar(require(
|
|
28
|
-
const attachable_store_1 = require(
|
|
36
|
+
const ActionsLib = __importStar(require('actions-lib'));
|
|
37
|
+
const attachable_store_1 = require('../attachable.store');
|
|
29
38
|
class ActionsLibDecorator {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
static decorateAttachFunctions(actionsLib) {
|
|
41
|
-
actionsLib.ActionSubscription.prototype.attach = function (parent) {
|
|
42
|
-
let parentEntity = attachable_store_1.AttachableStore.findAttachableParent(parent);
|
|
43
|
-
parentEntity['setAttachment'](this);
|
|
44
|
-
this.$meta = { attachIsCalled: true, attachedParent: parentEntity };
|
|
45
|
-
return this;
|
|
46
|
-
};
|
|
47
|
-
actionsLib.ActionSubscription.prototype.skipAttachCheck = function () {
|
|
48
|
-
this.$meta = { attachIsCalled: true };
|
|
49
|
-
return this;
|
|
50
|
-
};
|
|
51
|
-
actionsLib.ActionSubscription.prototype.decorateActionSubscription = function () {
|
|
52
|
-
setTimeout(() => {
|
|
53
|
-
if (!this.$meta?.attachIsCalled) {
|
|
54
|
-
throw new Error(`ActionsLibDecorator: subscribe is called without attach!`);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
return this;
|
|
58
|
-
};
|
|
59
|
-
let originalCombine = actionsLib.ActionSubscription.combine;
|
|
60
|
-
actionsLib.ActionSubscription.combine = function (subscriptions) {
|
|
61
|
-
subscriptions.forEach(subscription => subscription.skipAttachCheck());
|
|
62
|
-
return originalCombine(subscriptions);
|
|
63
|
-
};
|
|
64
|
-
actionsLib.ReducerEffectChannel.prototype.attach = function (parent) {
|
|
65
|
-
let parentEntity = attachable_store_1.AttachableStore.findAttachableParent(parent);
|
|
66
|
-
parentEntity['setAttachment'](this);
|
|
67
|
-
this.$meta = { attachIsCalled: true, attachedParent: parentEntity };
|
|
68
|
-
return this;
|
|
69
|
-
};
|
|
70
|
-
actionsLib.ReducerEffectChannel.prototype.skipAttachCheck = function () {
|
|
71
|
-
this.$meta = { attachIsCalled: true };
|
|
72
|
-
return this;
|
|
73
|
-
};
|
|
74
|
-
actionsLib.ReducerEffectChannel.prototype.decorateEffectChannel = function () {
|
|
75
|
-
setTimeout(() => {
|
|
76
|
-
if (!this.$meta?.attachIsCalled) {
|
|
77
|
-
throw new Error(`ActionsLibDecorator: effect is called without attach!`);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
return this;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
static decorateUnsubscriptions(actionsLib) {
|
|
84
|
-
let originalUnsubscribe = actionsLib.ActionSubscription.prototype.unsubscribe;
|
|
85
|
-
actionsLib.ActionSubscription.prototype.unsubscribe = function () {
|
|
86
|
-
let parentEntity = this.$meta?.attachedParent;
|
|
87
|
-
if (parentEntity) {
|
|
88
|
-
parentEntity['removeAttachment'](this);
|
|
89
|
-
this.$meta.attachedParent = undefined;
|
|
90
|
-
}
|
|
91
|
-
originalUnsubscribe.call(this);
|
|
92
|
-
};
|
|
93
|
-
let originalEffectUnsubscribe = actionsLib.ReducerEffectChannel.prototype.unsubscribe;
|
|
94
|
-
actionsLib.ReducerEffectChannel.prototype.unsubscribe = function () {
|
|
95
|
-
let parentEntity = this.$meta?.attachedParent;
|
|
96
|
-
if (parentEntity) {
|
|
97
|
-
parentEntity['removeAttachment'](this);
|
|
98
|
-
this.$meta.attachedParent = undefined;
|
|
99
|
-
}
|
|
100
|
-
originalEffectUnsubscribe.call(this);
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
static decorateSubscriptions(actionsLib) {
|
|
104
|
-
let originalActionSubscribe = actionsLib.Action.prototype.subscribe;
|
|
105
|
-
actionsLib.Action.prototype.subscribe = function (callback) {
|
|
106
|
-
return originalActionSubscribe.call(this, callback).decorateActionSubscription();
|
|
107
|
-
};
|
|
108
|
-
let originalVariableSubscribe = actionsLib.Variable.prototype.subscribe;
|
|
109
|
-
actionsLib.Variable.prototype.subscribe = function (callback, options) {
|
|
110
|
-
return originalVariableSubscribe.call(this, callback, options).decorateActionSubscription();
|
|
111
|
-
};
|
|
112
|
-
let originalReducerSubscribe = actionsLib.Reducer.prototype.subscribe;
|
|
113
|
-
actionsLib.Reducer.prototype.subscribe = function (callback, options) {
|
|
114
|
-
return originalReducerSubscribe.call(this, callback, options).decorateActionSubscription();
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
static decorateEffectChannels(actionsLib) {
|
|
118
|
-
let originalEffect = actionsLib.Reducer.prototype.effect;
|
|
119
|
-
actionsLib.Reducer.prototype.effect = function (value) {
|
|
120
|
-
return originalEffect.call(this, value).decorateEffectChannel();
|
|
121
|
-
};
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
40
|
+
static decorate(actionsLib) {
|
|
41
|
+
ActionsLibDecorator.decorateAttachFunctions(actionsLib);
|
|
42
|
+
ActionsLibDecorator.decorateUnsubscriptions(actionsLib);
|
|
43
|
+
ActionsLibDecorator.decorateSubscriptions(actionsLib);
|
|
44
|
+
ActionsLibDecorator.decorateEffectChannels(actionsLib);
|
|
45
|
+
if (actionsLib !== ActionsLib) {
|
|
46
|
+
ActionsLibDecorator.decorate(ActionsLib);
|
|
122
47
|
}
|
|
48
|
+
}
|
|
49
|
+
static decorateAttachFunctions(actionsLib) {
|
|
50
|
+
actionsLib.ActionSubscription.prototype.attach = function (parent) {
|
|
51
|
+
const parentEntity = attachable_store_1.AttachableStore.findAttachableParent(parent);
|
|
52
|
+
parentEntity['setAttachment'](this);
|
|
53
|
+
this.$meta = { attachIsCalled: true, attachedParent: parentEntity };
|
|
54
|
+
return this;
|
|
55
|
+
};
|
|
56
|
+
actionsLib.ActionSubscription.prototype.skipAttachCheck = function () {
|
|
57
|
+
this.$meta = { attachIsCalled: true };
|
|
58
|
+
return this;
|
|
59
|
+
};
|
|
60
|
+
actionsLib.ActionSubscription.prototype.decorateActionSubscription = function () {
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
if (!this.$meta?.attachIsCalled) {
|
|
63
|
+
throw new Error(`ActionsLibDecorator: subscribe is called without attach!`);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return this;
|
|
67
|
+
};
|
|
68
|
+
const originalCombine = actionsLib.ActionSubscription.combine;
|
|
69
|
+
actionsLib.ActionSubscription.combine = subscriptions => {
|
|
70
|
+
subscriptions.forEach(subscription => subscription.skipAttachCheck());
|
|
71
|
+
return originalCombine(subscriptions);
|
|
72
|
+
};
|
|
73
|
+
actionsLib.ReducerEffectChannel.prototype.attach = function (parent) {
|
|
74
|
+
const parentEntity = attachable_store_1.AttachableStore.findAttachableParent(parent);
|
|
75
|
+
parentEntity['setAttachment'](this);
|
|
76
|
+
this.$meta = { attachIsCalled: true, attachedParent: parentEntity };
|
|
77
|
+
return this;
|
|
78
|
+
};
|
|
79
|
+
actionsLib.ReducerEffectChannel.prototype.skipAttachCheck = function () {
|
|
80
|
+
this.$meta = { attachIsCalled: true };
|
|
81
|
+
return this;
|
|
82
|
+
};
|
|
83
|
+
actionsLib.ReducerEffectChannel.prototype.decorateEffectChannel = function () {
|
|
84
|
+
setTimeout(() => {
|
|
85
|
+
if (!this.$meta?.attachIsCalled) {
|
|
86
|
+
throw new Error(`ActionsLibDecorator: effect is called without attach!`);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return this;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
static decorateUnsubscriptions(actionsLib) {
|
|
93
|
+
const originalUnsubscribe = actionsLib.ActionSubscription.prototype.unsubscribe;
|
|
94
|
+
actionsLib.ActionSubscription.prototype.unsubscribe = function () {
|
|
95
|
+
const parentEntity = this.$meta?.attachedParent;
|
|
96
|
+
if (parentEntity) {
|
|
97
|
+
parentEntity['removeAttachment'](this);
|
|
98
|
+
this.$meta.attachedParent = undefined;
|
|
99
|
+
}
|
|
100
|
+
originalUnsubscribe.call(this);
|
|
101
|
+
};
|
|
102
|
+
const originalEffectUnsubscribe = actionsLib.ReducerEffectChannel.prototype.unsubscribe;
|
|
103
|
+
actionsLib.ReducerEffectChannel.prototype.unsubscribe = function () {
|
|
104
|
+
const parentEntity = this.$meta?.attachedParent;
|
|
105
|
+
if (parentEntity) {
|
|
106
|
+
parentEntity['removeAttachment'](this);
|
|
107
|
+
this.$meta.attachedParent = undefined;
|
|
108
|
+
}
|
|
109
|
+
originalEffectUnsubscribe.call(this);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
static decorateSubscriptions(actionsLib) {
|
|
113
|
+
const originalActionSubscribe = actionsLib.Action.prototype.subscribe;
|
|
114
|
+
actionsLib.Action.prototype.subscribe = function (callback) {
|
|
115
|
+
return originalActionSubscribe.call(this, callback).decorateActionSubscription();
|
|
116
|
+
};
|
|
117
|
+
const originalVariableSubscribe = actionsLib.Variable.prototype.subscribe;
|
|
118
|
+
actionsLib.Variable.prototype.subscribe = function (callback, options) {
|
|
119
|
+
return originalVariableSubscribe.call(this, callback, options).decorateActionSubscription();
|
|
120
|
+
};
|
|
121
|
+
const originalReducerSubscribe = actionsLib.Reducer.prototype.subscribe;
|
|
122
|
+
actionsLib.Reducer.prototype.subscribe = function (callback, options) {
|
|
123
|
+
return originalReducerSubscribe.call(this, callback, options).decorateActionSubscription();
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
static decorateEffectChannels(actionsLib) {
|
|
127
|
+
const originalEffect = actionsLib.Reducer.prototype.effect;
|
|
128
|
+
actionsLib.Reducer.prototype.effect = function (value) {
|
|
129
|
+
return originalEffect.call(this, value).decorateEffectChannel();
|
|
130
|
+
};
|
|
131
|
+
}
|
|
123
132
|
}
|
|
124
133
|
exports.ActionsLibDecorator = ActionsLibDecorator;
|
|
125
|
-
//# sourceMappingURL=decorate-actions-lib.js.map
|
|
134
|
+
//# sourceMappingURL=decorate-actions-lib.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ActionListenerCallbackFunction, ActionSubscription, IVariable } from 'actions-lib';
|
|
2
2
|
import { Attachable } from '../attachable';
|
|
3
3
|
export declare class ReferanceVariable implements IVariable<string | undefined> {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
private options;
|
|
5
|
+
private variable;
|
|
6
|
+
private destroySubscription?;
|
|
7
|
+
get value(): string | undefined;
|
|
8
|
+
set value(value: string | undefined);
|
|
9
|
+
get listenerCount(): number;
|
|
10
|
+
constructor(options: {
|
|
11
|
+
attachTo: Attachable;
|
|
12
|
+
});
|
|
13
|
+
set(data: string | undefined): this;
|
|
14
|
+
subscribe(callback: ActionListenerCallbackFunction<string | undefined>): ActionSubscription;
|
|
15
|
+
waitUntilNextCallback(callback: (data: string | undefined) => void): void;
|
|
16
|
+
waitUntilNext(): Promise<string | undefined>;
|
|
17
|
+
waitUntilCallback(data: string | undefined, callback: (data: string | undefined) => void): void;
|
|
18
|
+
waitUntil(data: string | undefined): Promise<string | undefined>;
|
|
19
19
|
}
|
|
@@ -1,52 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
2
|
exports.ReferanceVariable = void 0;
|
|
4
|
-
const actions_lib_1 = require(
|
|
5
|
-
const attachable_store_1 = require(
|
|
3
|
+
const actions_lib_1 = require('actions-lib');
|
|
4
|
+
const attachable_store_1 = require('../attachable.store');
|
|
6
5
|
class ReferanceVariable {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
6
|
+
get value() {
|
|
7
|
+
return this.variable.value;
|
|
8
|
+
}
|
|
9
|
+
set value(value) {
|
|
10
|
+
this.set(value);
|
|
11
|
+
}
|
|
12
|
+
get listenerCount() {
|
|
13
|
+
return this.variable.listenerCount;
|
|
14
|
+
}
|
|
15
|
+
constructor(options) {
|
|
16
|
+
this.options = options;
|
|
17
|
+
this.variable = new actions_lib_1.Variable({ notifyOnChange: true });
|
|
18
|
+
}
|
|
19
|
+
set(data) {
|
|
20
|
+
if (data !== this.variable.value) {
|
|
21
|
+
this.destroySubscription?.unsubscribe();
|
|
22
|
+
this.destroySubscription = undefined;
|
|
23
|
+
if (data) {
|
|
24
|
+
this.destroySubscription = attachable_store_1.AttachableStore.findAttachableParent(data)
|
|
25
|
+
.onDestroy.subscribe(() => {
|
|
26
|
+
this.set(undefined);
|
|
27
|
+
})
|
|
28
|
+
.attach(this.options.attachTo);
|
|
29
|
+
}
|
|
30
|
+
this.variable.set(data);
|
|
31
|
+
}
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
subscribe(callback) {
|
|
35
|
+
return this.variable.subscribe(callback);
|
|
36
|
+
}
|
|
37
|
+
waitUntilNextCallback(callback) {
|
|
38
|
+
this.variable.waitUntilNextCallback(callback);
|
|
39
|
+
}
|
|
40
|
+
async waitUntilNext() {
|
|
41
|
+
return this.variable.waitUntilNext();
|
|
42
|
+
}
|
|
43
|
+
waitUntilCallback(data, callback) {
|
|
44
|
+
this.variable.waitUntilCallback(data, callback);
|
|
45
|
+
}
|
|
46
|
+
async waitUntil(data) {
|
|
47
|
+
return this.variable.waitUntil(data);
|
|
48
|
+
}
|
|
50
49
|
}
|
|
51
50
|
exports.ReferanceVariable = ReferanceVariable;
|
|
52
|
-
//# sourceMappingURL=referance-variable.js.map
|
|
51
|
+
//# sourceMappingURL=referance-variable.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Action, Variable } from 'actions-lib';
|
|
2
2
|
export interface IDestroyable {
|
|
3
|
-
|
|
3
|
+
destroy(): void;
|
|
4
4
|
}
|
|
5
5
|
export interface IAttachable {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly onDestroy: Action<void>;
|
|
8
|
+
setAttachment(child: CanBeAttached): void;
|
|
9
|
+
removeAttachment(child: CanBeAttached): void;
|
|
10
10
|
}
|
|
11
11
|
export interface IUnsubscribable {
|
|
12
|
-
|
|
12
|
+
unsubscribe(...args: any[]): void;
|
|
13
13
|
}
|
|
14
14
|
export type CanBeAttached = IDestroyable | IUnsubscribable | CanBeAttached[] | Variable<CanBeAttached>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=interfaces.js.map
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
//# sourceMappingURL=interfaces.js.map
|
|
@@ -27,7 +27,6 @@ exports.ActionsLibDecorator = void 0;
|
|
|
27
27
|
const ActionsLib = __importStar(require("actions-lib"));
|
|
28
28
|
const attachable_store_1 = require("./attachable.store");
|
|
29
29
|
class ActionsLibDecorator {
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
31
30
|
static decorate(actionsLib) {
|
|
32
31
|
this.decorateAttachFunctions(actionsLib);
|
|
33
32
|
this.decorateUnsubscriptions(actionsLib);
|
|
@@ -33,7 +33,6 @@ class ControllerLink {
|
|
|
33
33
|
}
|
|
34
34
|
exports.ControllerLink = ControllerLink;
|
|
35
35
|
function ControllerDecorator(meta) {
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
37
36
|
return function (ControllerClass) {
|
|
38
37
|
let paramtypes = service_1.Service.getParametersMeta(ControllerClass);
|
|
39
38
|
if (paramtypes.some(type => !type)) {
|