samcan 0.0.2 → 0.1.0
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/{license → LICENSE} +3 -1
- package/README.md +3 -0
- package/dist/camera/index.cjs +370 -0
- package/dist/camera/index.d.cts +54 -0
- package/dist/camera/index.d.ts +54 -0
- package/dist/camera/index.js +70 -0
- package/dist/document/index.cjs +735 -0
- package/dist/document/index.d.cts +174 -0
- package/dist/document/index.d.ts +174 -0
- package/dist/document/index.js +161 -0
- package/dist/editor/index.cjs +5007 -0
- package/dist/editor/index.d.cts +374 -0
- package/dist/editor/index.d.ts +374 -0
- package/dist/editor/index.js +2401 -0
- package/dist/engine/index.cjs +3752 -0
- package/dist/engine/index.d.cts +183 -0
- package/dist/engine/index.d.ts +183 -0
- package/dist/engine/index.js +111 -0
- package/dist/index.cjs +8899 -0
- package/dist/index.d.cts +962 -0
- package/dist/index.d.ts +962 -46
- package/dist/index.js +1008 -49
- package/dist/math/index.cjs +2230 -0
- package/dist/math/index.d.cts +302 -0
- package/dist/math/index.d.ts +302 -0
- package/dist/math/index.js +1109 -0
- package/dist/renderer/index.cjs +1865 -0
- package/dist/renderer/index.d.cts +91 -0
- package/dist/renderer/index.d.ts +91 -0
- package/dist/renderer/index.js +89 -0
- package/dist/shared/chunk-35pkr0zs.js +110 -0
- package/dist/shared/chunk-7sr7q84y.js +80 -0
- package/dist/shared/chunk-87399bz7.js +89 -0
- package/dist/shared/chunk-8ynnz57m.js +129 -0
- package/dist/shared/chunk-d6gxvapt.js +500 -0
- package/dist/shared/chunk-hewznwbd.js +305 -0
- package/dist/shared/chunk-jdvrd5tv.js +623 -0
- package/dist/shared/chunk-rvag1j46.js +461 -0
- package/dist/shared/chunk-rzxyjwk8.js +397 -0
- package/dist/shared/chunk-s3qdcmcq.js +1392 -0
- package/dist/shared/chunk-v53jprrn.js +68 -0
- package/dist/shared/chunk-wa3772hp.js +117 -0
- package/dist/spatial/index.cjs +954 -0
- package/dist/spatial/index.d.cts +136 -0
- package/dist/spatial/index.d.ts +136 -0
- package/dist/spatial/index.js +301 -0
- package/dist/stroke/index.cjs +1010 -0
- package/dist/stroke/index.d.cts +143 -0
- package/dist/stroke/index.d.ts +143 -0
- package/dist/stroke/index.js +343 -0
- package/package.json +122 -58
- package/dist/bundle.js +0 -5888
- package/dist/core/animation/animationruntime.d.ts +0 -238
- package/dist/core/animation/animationruntime.d.ts.map +0 -1
- package/dist/core/animation/animationruntime.js +0 -530
- package/dist/core/animation/animationruntime.js.map +0 -1
- package/dist/core/animation/animationstate.d.ts +0 -85
- package/dist/core/animation/animationstate.d.ts.map +0 -1
- package/dist/core/animation/animationstate.js +0 -119
- package/dist/core/animation/animationstate.js.map +0 -1
- package/dist/core/animation/animationtrack.d.ts +0 -55
- package/dist/core/animation/animationtrack.d.ts.map +0 -1
- package/dist/core/animation/animationtrack.js +0 -185
- package/dist/core/animation/animationtrack.js.map +0 -1
- package/dist/core/animation/easing.d.ts +0 -80
- package/dist/core/animation/easing.d.ts.map +0 -1
- package/dist/core/animation/easing.js +0 -126
- package/dist/core/animation/easing.js.map +0 -1
- package/dist/core/animation/index.d.ts +0 -11
- package/dist/core/animation/index.d.ts.map +0 -1
- package/dist/core/animation/index.js +0 -10
- package/dist/core/animation/index.js.map +0 -1
- package/dist/core/animation/interpolator.d.ts +0 -82
- package/dist/core/animation/interpolator.d.ts.map +0 -1
- package/dist/core/animation/interpolator.js +0 -108
- package/dist/core/animation/interpolator.js.map +0 -1
- package/dist/core/animation/keyframe.d.ts +0 -52
- package/dist/core/animation/keyframe.d.ts.map +0 -1
- package/dist/core/animation/keyframe.js +0 -65
- package/dist/core/animation/keyframe.js.map +0 -1
- package/dist/core/animation/logger.d.ts +0 -8
- package/dist/core/animation/logger.d.ts.map +0 -1
- package/dist/core/animation/logger.js +0 -20
- package/dist/core/animation/logger.js.map +0 -1
- package/dist/core/animation/statemachine.d.ts +0 -178
- package/dist/core/animation/statemachine.d.ts.map +0 -1
- package/dist/core/animation/statemachine.js +0 -378
- package/dist/core/animation/statemachine.js.map +0 -1
- package/dist/core/animation/statetransition.d.ts +0 -142
- package/dist/core/animation/statetransition.d.ts.map +0 -1
- package/dist/core/animation/statetransition.js +0 -189
- package/dist/core/animation/statetransition.js.map +0 -1
- package/dist/core/animation/timeline.d.ts +0 -62
- package/dist/core/animation/timeline.d.ts.map +0 -1
- package/dist/core/animation/timeline.js +0 -102
- package/dist/core/animation/timeline.js.map +0 -1
- package/dist/core/api.d.ts +0 -245
- package/dist/core/api.d.ts.map +0 -1
- package/dist/core/api.js +0 -369
- package/dist/core/api.js.map +0 -1
- package/dist/core/asset/assetmanager.d.ts +0 -196
- package/dist/core/asset/assetmanager.d.ts.map +0 -1
- package/dist/core/asset/assetmanager.js +0 -502
- package/dist/core/asset/assetmanager.js.map +0 -1
- package/dist/core/asset/index.d.ts +0 -3
- package/dist/core/asset/index.d.ts.map +0 -1
- package/dist/core/asset/index.js +0 -3
- package/dist/core/asset/index.js.map +0 -1
- package/dist/core/asset/types.d.ts +0 -36
- package/dist/core/asset/types.d.ts.map +0 -1
- package/dist/core/asset/types.js +0 -1
- package/dist/core/asset/types.js.map +0 -1
- package/dist/core/command/basecommand.d.ts +0 -29
- package/dist/core/command/basecommand.d.ts.map +0 -1
- package/dist/core/command/basecommand.js +0 -36
- package/dist/core/command/basecommand.js.map +0 -1
- package/dist/core/command/command.d.ts +0 -55
- package/dist/core/command/command.d.ts.map +0 -1
- package/dist/core/command/command.js +0 -1
- package/dist/core/command/command.js.map +0 -1
- package/dist/core/command/commandhistory.d.ts +0 -76
- package/dist/core/command/commandhistory.d.ts.map +0 -1
- package/dist/core/command/commandhistory.js +0 -122
- package/dist/core/command/commandhistory.js.map +0 -1
- package/dist/core/command/editorcommands.d.ts +0 -108
- package/dist/core/command/editorcommands.d.ts.map +0 -1
- package/dist/core/command/editorcommands.js +0 -274
- package/dist/core/command/editorcommands.js.map +0 -1
- package/dist/core/command/index.d.ts +0 -5
- package/dist/core/command/index.d.ts.map +0 -1
- package/dist/core/command/index.js +0 -5
- package/dist/core/command/index.js.map +0 -1
- package/dist/core/editor/events/emitter.d.ts +0 -45
- package/dist/core/editor/events/emitter.d.ts.map +0 -1
- package/dist/core/editor/events/emitter.js +0 -88
- package/dist/core/editor/events/emitter.js.map +0 -1
- package/dist/core/error/animationerror.d.ts +0 -27
- package/dist/core/error/animationerror.d.ts.map +0 -1
- package/dist/core/error/animationerror.js +0 -41
- package/dist/core/error/animationerror.js.map +0 -1
- package/dist/core/error/asseterror.d.ts +0 -32
- package/dist/core/error/asseterror.d.ts.map +0 -1
- package/dist/core/error/asseterror.js +0 -48
- package/dist/core/error/asseterror.js.map +0 -1
- package/dist/core/error/index.d.ts +0 -7
- package/dist/core/error/index.d.ts.map +0 -1
- package/dist/core/error/index.js +0 -7
- package/dist/core/error/index.js.map +0 -1
- package/dist/core/error/pluginerror.d.ts +0 -22
- package/dist/core/error/pluginerror.d.ts.map +0 -1
- package/dist/core/error/pluginerror.js +0 -33
- package/dist/core/error/pluginerror.js.map +0 -1
- package/dist/core/error/renderererror.d.ts +0 -26
- package/dist/core/error/renderererror.d.ts.map +0 -1
- package/dist/core/error/renderererror.js +0 -40
- package/dist/core/error/renderererror.js.map +0 -1
- package/dist/core/error/samcanerror.d.ts +0 -72
- package/dist/core/error/samcanerror.d.ts.map +0 -1
- package/dist/core/error/samcanerror.js +0 -108
- package/dist/core/error/samcanerror.js.map +0 -1
- package/dist/core/error/serializationerror.d.ts +0 -31
- package/dist/core/error/serializationerror.d.ts.map +0 -1
- package/dist/core/error/serializationerror.js +0 -46
- package/dist/core/error/serializationerror.js.map +0 -1
- package/dist/core/index.d.ts +0 -12
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -12
- package/dist/core/index.js.map +0 -1
- package/dist/core/math/color.d.ts +0 -56
- package/dist/core/math/color.d.ts.map +0 -1
- package/dist/core/math/color.js +0 -125
- package/dist/core/math/color.js.map +0 -1
- package/dist/core/math/index.d.ts +0 -14
- package/dist/core/math/index.d.ts.map +0 -1
- package/dist/core/math/index.js +0 -14
- package/dist/core/math/index.js.map +0 -1
- package/dist/core/math/matrix.d.ts +0 -101
- package/dist/core/math/matrix.d.ts.map +0 -1
- package/dist/core/math/matrix.js +0 -177
- package/dist/core/math/matrix.js.map +0 -1
- package/dist/core/math/paint.d.ts +0 -104
- package/dist/core/math/paint.d.ts.map +0 -1
- package/dist/core/math/paint.js +0 -204
- package/dist/core/math/paint.js.map +0 -1
- package/dist/core/math/path/index.d.ts +0 -94
- package/dist/core/math/path/index.d.ts.map +0 -1
- package/dist/core/math/path/index.js +0 -180
- package/dist/core/math/path/index.js.map +0 -1
- package/dist/core/math/path/operations.d.ts +0 -38
- package/dist/core/math/path/operations.d.ts.map +0 -1
- package/dist/core/math/path/operations.js +0 -149
- package/dist/core/math/path/operations.js.map +0 -1
- package/dist/core/math/pool.d.ts +0 -54
- package/dist/core/math/pool.d.ts.map +0 -1
- package/dist/core/math/pool.js +0 -97
- package/dist/core/math/pool.js.map +0 -1
- package/dist/core/math/pools.d.ts +0 -29
- package/dist/core/math/pools.d.ts.map +0 -1
- package/dist/core/math/pools.js +0 -50
- package/dist/core/math/pools.js.map +0 -1
- package/dist/core/math/rectangle.d.ts +0 -68
- package/dist/core/math/rectangle.d.ts.map +0 -1
- package/dist/core/math/rectangle.js +0 -124
- package/dist/core/math/rectangle.js.map +0 -1
- package/dist/core/math/utils.d.ts +0 -68
- package/dist/core/math/utils.d.ts.map +0 -1
- package/dist/core/math/utils.js +0 -110
- package/dist/core/math/utils.js.map +0 -1
- package/dist/core/math/vector2.d.ts +0 -85
- package/dist/core/math/vector2.d.ts.map +0 -1
- package/dist/core/math/vector2.js +0 -134
- package/dist/core/math/vector2.js.map +0 -1
- package/dist/core/plugin/animationcontroller.d.ts +0 -43
- package/dist/core/plugin/animationcontroller.d.ts.map +0 -1
- package/dist/core/plugin/animationcontroller.js +0 -11
- package/dist/core/plugin/animationcontroller.js.map +0 -1
- package/dist/core/plugin/index.d.ts +0 -6
- package/dist/core/plugin/index.d.ts.map +0 -1
- package/dist/core/plugin/index.js +0 -4
- package/dist/core/plugin/index.js.map +0 -1
- package/dist/core/plugin/plugin.d.ts +0 -53
- package/dist/core/plugin/plugin.d.ts.map +0 -1
- package/dist/core/plugin/plugin.js +0 -29
- package/dist/core/plugin/plugin.js.map +0 -1
- package/dist/core/plugin/pluginregistry.d.ts +0 -71
- package/dist/core/plugin/pluginregistry.d.ts.map +0 -1
- package/dist/core/plugin/pluginregistry.js +0 -143
- package/dist/core/plugin/pluginregistry.js.map +0 -1
- package/dist/core/renderer/batchmanager.d.ts +0 -68
- package/dist/core/renderer/batchmanager.d.ts.map +0 -1
- package/dist/core/renderer/batchmanager.js +0 -82
- package/dist/core/renderer/batchmanager.js.map +0 -1
- package/dist/core/renderer/canvas2drenderer.d.ts +0 -139
- package/dist/core/renderer/canvas2drenderer.d.ts.map +0 -1
- package/dist/core/renderer/canvas2drenderer.js +0 -499
- package/dist/core/renderer/canvas2drenderer.js.map +0 -1
- package/dist/core/renderer/dirtyregionmanager.d.ts +0 -54
- package/dist/core/renderer/dirtyregionmanager.d.ts.map +0 -1
- package/dist/core/renderer/dirtyregionmanager.js +0 -129
- package/dist/core/renderer/dirtyregionmanager.js.map +0 -1
- package/dist/core/renderer/index.d.ts +0 -8
- package/dist/core/renderer/index.d.ts.map +0 -1
- package/dist/core/renderer/index.js +0 -6
- package/dist/core/renderer/index.js.map +0 -1
- package/dist/core/renderer/renderer.d.ts +0 -154
- package/dist/core/renderer/renderer.d.ts.map +0 -1
- package/dist/core/renderer/renderer.js +0 -1
- package/dist/core/renderer/renderer.js.map +0 -1
- package/dist/core/renderer/rendererfactory.d.ts +0 -66
- package/dist/core/renderer/rendererfactory.d.ts.map +0 -1
- package/dist/core/renderer/rendererfactory.js +0 -219
- package/dist/core/renderer/rendererfactory.js.map +0 -1
- package/dist/core/renderer/webglrenderer.d.ts +0 -185
- package/dist/core/renderer/webglrenderer.d.ts.map +0 -1
- package/dist/core/renderer/webglrenderer.js +0 -1007
- package/dist/core/renderer/webglrenderer.js.map +0 -1
- package/dist/core/scene/index.d.ts +0 -4
- package/dist/core/scene/index.d.ts.map +0 -1
- package/dist/core/scene/index.js +0 -4
- package/dist/core/scene/index.js.map +0 -1
- package/dist/core/scene/node.d.ts +0 -162
- package/dist/core/scene/node.d.ts.map +0 -1
- package/dist/core/scene/node.js +0 -402
- package/dist/core/scene/node.js.map +0 -1
- package/dist/core/scene/nodes/artboard.d.ts +0 -42
- package/dist/core/scene/nodes/artboard.d.ts.map +0 -1
- package/dist/core/scene/nodes/artboard.js +0 -64
- package/dist/core/scene/nodes/artboard.js.map +0 -1
- package/dist/core/scene/nodes/groupnode.d.ts +0 -10
- package/dist/core/scene/nodes/groupnode.d.ts.map +0 -1
- package/dist/core/scene/nodes/groupnode.js +0 -12
- package/dist/core/scene/nodes/groupnode.js.map +0 -1
- package/dist/core/scene/nodes/imagenode.d.ts +0 -38
- package/dist/core/scene/nodes/imagenode.d.ts.map +0 -1
- package/dist/core/scene/nodes/imagenode.js +0 -77
- package/dist/core/scene/nodes/imagenode.js.map +0 -1
- package/dist/core/scene/nodes/index.d.ts +0 -5
- package/dist/core/scene/nodes/index.d.ts.map +0 -1
- package/dist/core/scene/nodes/index.js +0 -5
- package/dist/core/scene/nodes/index.js.map +0 -1
- package/dist/core/scene/nodes/shapenode.d.ts +0 -76
- package/dist/core/scene/nodes/shapenode.d.ts.map +0 -1
- package/dist/core/scene/nodes/shapenode.js +0 -212
- package/dist/core/scene/nodes/shapenode.js.map +0 -1
- package/dist/core/scene/transform.d.ts +0 -27
- package/dist/core/scene/transform.d.ts.map +0 -1
- package/dist/core/scene/transform.js +0 -52
- package/dist/core/scene/transform.js.map +0 -1
- package/dist/core/serialization/index.d.ts +0 -3
- package/dist/core/serialization/index.d.ts.map +0 -1
- package/dist/core/serialization/index.js +0 -2
- package/dist/core/serialization/index.js.map +0 -1
- package/dist/core/serialization/serializer.d.ts +0 -323
- package/dist/core/serialization/serializer.d.ts.map +0 -1
- package/dist/core/serialization/serializer.js +0 -1173
- package/dist/core/serialization/serializer.js.map +0 -1
- package/dist/core/serialization/types.d.ts +0 -242
- package/dist/core/serialization/types.d.ts.map +0 -1
- package/dist/core/serialization/types.js +0 -1
- package/dist/core/serialization/types.js.map +0 -1
- package/dist/core/timing/clock.d.ts +0 -43
- package/dist/core/timing/clock.d.ts.map +0 -1
- package/dist/core/timing/clock.js +0 -78
- package/dist/core/timing/clock.js.map +0 -1
- package/dist/core/timing/index.d.ts +0 -3
- package/dist/core/timing/index.d.ts.map +0 -1
- package/dist/core/timing/index.js +0 -3
- package/dist/core/timing/index.js.map +0 -1
- package/dist/core/timing/scheduler.d.ts +0 -72
- package/dist/core/timing/scheduler.d.ts.map +0 -1
- package/dist/core/timing/scheduler.js +0 -163
- package/dist/core/timing/scheduler.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/wrapper/react/index.d.ts +0 -5
- package/dist/wrapper/react/index.d.ts.map +0 -1
- package/dist/wrapper/react/index.js +0 -3
- package/dist/wrapper/react/index.js.map +0 -1
- package/dist/wrapper/react/samcan-player.d.ts +0 -26
- package/dist/wrapper/react/samcan-player.d.ts.map +0 -1
- package/dist/wrapper/react/samcan-player.js +0 -19
- package/dist/wrapper/react/samcan-player.js.map +0 -1
- package/dist/wrapper/react/use-samcan-player.d.ts +0 -33
- package/dist/wrapper/react/use-samcan-player.d.ts.map +0 -1
- package/dist/wrapper/react/use-samcan-player.js +0 -65
- package/dist/wrapper/react/use-samcan-player.js.map +0 -1
- package/readme.md +0 -96
|
@@ -1,502 +0,0 @@
|
|
|
1
|
-
import { ImageNode } from "../scene/nodes/imagenode";
|
|
2
|
-
import { AssetError } from "../error/asseterror";
|
|
3
|
-
/**
|
|
4
|
-
* AssetManager handles loading, caching, and lifecycle management of assets
|
|
5
|
-
* such as images, fonts, and audio files.
|
|
6
|
-
* Requirement 10.5: Provides error handling, placeholder assets, and retry logic
|
|
7
|
-
*/
|
|
8
|
-
export class AssetManager {
|
|
9
|
-
_assets = new Map();
|
|
10
|
-
_loadingPromises = new Map();
|
|
11
|
-
_placeholderImage = null;
|
|
12
|
-
_assetDependencies = new Map(); // artboardId -> Set of assetIds
|
|
13
|
-
_eventListeners = new Map();
|
|
14
|
-
/**
|
|
15
|
-
* Get readonly access to loaded assets
|
|
16
|
-
*/
|
|
17
|
-
get loadedAssets() {
|
|
18
|
-
return this._assets;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Register an event listener for asset events
|
|
22
|
-
* @param eventType - The type of event to listen for
|
|
23
|
-
* @param callback - The callback function to invoke when the event occurs
|
|
24
|
-
*/
|
|
25
|
-
on(eventType, callback) {
|
|
26
|
-
let listeners = this._eventListeners.get(eventType);
|
|
27
|
-
if (!listeners) {
|
|
28
|
-
listeners = new Set();
|
|
29
|
-
this._eventListeners.set(eventType, listeners);
|
|
30
|
-
}
|
|
31
|
-
listeners.add(callback);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Unregister an event listener
|
|
35
|
-
* @param eventType - The type of event to stop listening for
|
|
36
|
-
* @param callback - The callback function to remove
|
|
37
|
-
*/
|
|
38
|
-
off(eventType, callback) {
|
|
39
|
-
const listeners = this._eventListeners.get(eventType);
|
|
40
|
-
if (listeners) {
|
|
41
|
-
listeners.delete(callback);
|
|
42
|
-
if (listeners.size === 0) {
|
|
43
|
-
this._eventListeners.delete(eventType);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Emit an asset event to all registered listeners
|
|
49
|
-
* @param event - The event to emit
|
|
50
|
-
*/
|
|
51
|
-
_emitEvent(event) {
|
|
52
|
-
const listeners = this._eventListeners.get(event.type);
|
|
53
|
-
if (listeners) {
|
|
54
|
-
for (const callback of listeners) {
|
|
55
|
-
try {
|
|
56
|
-
callback(event);
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
// Prevent listener errors from breaking the asset manager
|
|
60
|
-
console.error(`Error in asset event listener for ${event.type}:`, error);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Get a 1x1 placeholder image for fallback scenarios
|
|
67
|
-
*/
|
|
68
|
-
getPlaceholderImage() {
|
|
69
|
-
if (!this._placeholderImage) {
|
|
70
|
-
// Create a 1x1 transparent PNG data URL
|
|
71
|
-
const dataUrl = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2NgYGD4DwABBAEAwgMZAAAAAElFTkSuQmCC";
|
|
72
|
-
const img = new Image();
|
|
73
|
-
img.src = dataUrl;
|
|
74
|
-
this._placeholderImage = {
|
|
75
|
-
id: "__placeholder__",
|
|
76
|
-
type: "image",
|
|
77
|
-
url: dataUrl,
|
|
78
|
-
loaded: true,
|
|
79
|
-
width: 1,
|
|
80
|
-
height: 1,
|
|
81
|
-
data: img,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
return this._placeholderImage;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Load an image with optional fallback URL and retry logic
|
|
88
|
-
* @param url - The URL of the image to load
|
|
89
|
-
* @param options - Optional configuration including fallback URL and retry settings
|
|
90
|
-
* @returns Promise that resolves to the loaded image asset
|
|
91
|
-
*/
|
|
92
|
-
async loadImage(url, options) {
|
|
93
|
-
try {
|
|
94
|
-
const asset = await this.load(url, "image", options);
|
|
95
|
-
return asset;
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
// Try fallback URL if provided
|
|
99
|
-
if (options?.fallbackUrl) {
|
|
100
|
-
try {
|
|
101
|
-
const fallbackAsset = await this.load(options.fallbackUrl, "image", options);
|
|
102
|
-
return fallbackAsset;
|
|
103
|
-
}
|
|
104
|
-
catch (fallbackError) {
|
|
105
|
-
// Return placeholder if fallback also fails
|
|
106
|
-
return this.getPlaceholderImage();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
// Return placeholder on failure
|
|
110
|
-
return this.getPlaceholderImage();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Load a font with optional fallback URL and retry logic
|
|
115
|
-
* @param url - The URL of the font file to load
|
|
116
|
-
* @param family - The font family name to use
|
|
117
|
-
* @param options - Optional configuration including fallback URL, retry settings, and font descriptors
|
|
118
|
-
* @returns Promise that resolves to the loaded font asset
|
|
119
|
-
*/
|
|
120
|
-
async loadFont(url, family, options) {
|
|
121
|
-
const loadOptions = {
|
|
122
|
-
...options,
|
|
123
|
-
family,
|
|
124
|
-
};
|
|
125
|
-
try {
|
|
126
|
-
const asset = await this.load(url, "font", loadOptions);
|
|
127
|
-
return asset;
|
|
128
|
-
}
|
|
129
|
-
catch (error) {
|
|
130
|
-
// Try fallback URL if provided
|
|
131
|
-
if (options?.fallbackUrl) {
|
|
132
|
-
try {
|
|
133
|
-
const fallbackAsset = await this.load(options.fallbackUrl, "font", loadOptions);
|
|
134
|
-
return fallbackAsset;
|
|
135
|
-
}
|
|
136
|
-
catch (fallbackError) {
|
|
137
|
-
const assetError = fallbackError instanceof AssetError
|
|
138
|
-
? fallbackError
|
|
139
|
-
: AssetError.fontLoadFailed(family, "Failed to load from primary and fallback URLs", fallbackError instanceof Error
|
|
140
|
-
? fallbackError
|
|
141
|
-
: undefined);
|
|
142
|
-
throw assetError;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
// Re-throw as AssetError if not already
|
|
146
|
-
if (error instanceof AssetError) {
|
|
147
|
-
throw error;
|
|
148
|
-
}
|
|
149
|
-
throw AssetError.fontLoadFailed(family, error instanceof Error ? error.message : String(error), error instanceof Error ? error : undefined);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Load an asset from a URL with retry logic
|
|
154
|
-
* @param url - The URL of the asset to load
|
|
155
|
-
* @param type - The type of asset (image, font, audio)
|
|
156
|
-
* @param options - Optional configuration for asset loading including retry settings
|
|
157
|
-
* @returns Promise that resolves to the loaded asset
|
|
158
|
-
*/
|
|
159
|
-
async load(url, type, options) {
|
|
160
|
-
// Generate ID from URL (use URL as ID for simplicity)
|
|
161
|
-
const id = this._generateId(url);
|
|
162
|
-
// Return cached asset if already loaded
|
|
163
|
-
const cached = this._assets.get(id);
|
|
164
|
-
if (cached?.loaded) {
|
|
165
|
-
return cached;
|
|
166
|
-
}
|
|
167
|
-
// Return existing loading promise if already in progress
|
|
168
|
-
const loadingPromise = this._loadingPromises.get(id);
|
|
169
|
-
if (loadingPromise) {
|
|
170
|
-
return loadingPromise;
|
|
171
|
-
}
|
|
172
|
-
// Emit load-start event
|
|
173
|
-
this._emitEvent({
|
|
174
|
-
type: "load-start",
|
|
175
|
-
assetId: id,
|
|
176
|
-
assetUrl: url,
|
|
177
|
-
assetType: type,
|
|
178
|
-
timestamp: new Date(),
|
|
179
|
-
});
|
|
180
|
-
// Start new load operation with retry logic
|
|
181
|
-
const maxRetries = options?.maxRetries ?? 3;
|
|
182
|
-
const retryDelay = options?.retryDelay ?? 1000;
|
|
183
|
-
const promise = this._loadAssetWithRetry(id, url, type, options, maxRetries, retryDelay);
|
|
184
|
-
this._loadingPromises.set(id, promise);
|
|
185
|
-
try {
|
|
186
|
-
const asset = await promise;
|
|
187
|
-
this._assets.set(id, asset);
|
|
188
|
-
// Emit load-success event
|
|
189
|
-
this._emitEvent({
|
|
190
|
-
type: "load-success",
|
|
191
|
-
assetId: id,
|
|
192
|
-
assetUrl: url,
|
|
193
|
-
assetType: type,
|
|
194
|
-
timestamp: new Date(),
|
|
195
|
-
});
|
|
196
|
-
return asset;
|
|
197
|
-
}
|
|
198
|
-
catch (error) {
|
|
199
|
-
// Emit load-error event
|
|
200
|
-
const assetError = error instanceof AssetError
|
|
201
|
-
? error
|
|
202
|
-
: AssetError.loadFailed(url, type, error instanceof Error
|
|
203
|
-
? error.message
|
|
204
|
-
: String(error), error instanceof Error ? error : undefined);
|
|
205
|
-
this._emitEvent({
|
|
206
|
-
type: "load-error",
|
|
207
|
-
assetId: id,
|
|
208
|
-
assetUrl: url,
|
|
209
|
-
assetType: type,
|
|
210
|
-
error: assetError,
|
|
211
|
-
timestamp: new Date(),
|
|
212
|
-
});
|
|
213
|
-
throw assetError;
|
|
214
|
-
}
|
|
215
|
-
finally {
|
|
216
|
-
this._loadingPromises.delete(id);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Load an asset with retry logic
|
|
221
|
-
* @param id - The asset ID
|
|
222
|
-
* @param url - The URL of the asset to load
|
|
223
|
-
* @param type - The type of asset
|
|
224
|
-
* @param options - Optional configuration for asset loading
|
|
225
|
-
* @param maxRetries - Maximum number of retry attempts
|
|
226
|
-
* @param retryDelay - Delay in milliseconds between retries
|
|
227
|
-
* @returns Promise that resolves to the loaded asset
|
|
228
|
-
*/
|
|
229
|
-
async _loadAssetWithRetry(id, url, type, options, maxRetries, retryDelay) {
|
|
230
|
-
let lastError = null;
|
|
231
|
-
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
232
|
-
try {
|
|
233
|
-
// Attempt to load the asset
|
|
234
|
-
return await this._loadAsset(id, url, type, options);
|
|
235
|
-
}
|
|
236
|
-
catch (error) {
|
|
237
|
-
lastError =
|
|
238
|
-
error instanceof Error ? error : new Error(String(error));
|
|
239
|
-
// If this is not the last attempt, emit retry event and wait
|
|
240
|
-
if (attempt < maxRetries) {
|
|
241
|
-
this._emitEvent({
|
|
242
|
-
type: "load-retry",
|
|
243
|
-
assetId: id,
|
|
244
|
-
assetUrl: url,
|
|
245
|
-
assetType: type,
|
|
246
|
-
retryAttempt: attempt + 1,
|
|
247
|
-
timestamp: new Date(),
|
|
248
|
-
});
|
|
249
|
-
// Wait before retrying (exponential backoff)
|
|
250
|
-
await this._delay(retryDelay * Math.pow(2, attempt));
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
// All retries failed, throw the last error
|
|
255
|
-
throw lastError;
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* Delay helper for retry logic
|
|
259
|
-
* @param ms - Milliseconds to delay
|
|
260
|
-
*/
|
|
261
|
-
_delay(ms) {
|
|
262
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Get a loaded asset by ID
|
|
266
|
-
* @param id - The asset ID
|
|
267
|
-
* @returns The asset if loaded, null otherwise
|
|
268
|
-
*/
|
|
269
|
-
get(id) {
|
|
270
|
-
return this._assets.get(id) ?? null;
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Unload an asset and free its resources
|
|
274
|
-
* @param id - The asset ID to unload
|
|
275
|
-
*/
|
|
276
|
-
unload(id) {
|
|
277
|
-
const asset = this._assets.get(id);
|
|
278
|
-
if (!asset) {
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
// Clean up asset-specific resources
|
|
282
|
-
if (asset.type === "image") {
|
|
283
|
-
const imageAsset = asset;
|
|
284
|
-
// Revoke object URLs if using ImageBitmap
|
|
285
|
-
if (typeof ImageBitmap !== "undefined" &&
|
|
286
|
-
imageAsset.data instanceof ImageBitmap) {
|
|
287
|
-
imageAsset.data.close();
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
else if (asset.type === "font") {
|
|
291
|
-
const fontAsset = asset;
|
|
292
|
-
// Remove font from document fonts
|
|
293
|
-
if (typeof document !== "undefined" && document.fonts) {
|
|
294
|
-
document.fonts.delete(fontAsset.fontFace);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
this._assets.delete(id);
|
|
298
|
-
// Emit unload event
|
|
299
|
-
this._emitEvent({
|
|
300
|
-
type: "unload",
|
|
301
|
-
assetId: id,
|
|
302
|
-
assetUrl: asset.url,
|
|
303
|
-
assetType: asset.type,
|
|
304
|
-
timestamp: new Date(),
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* Preload multiple assets in parallel
|
|
309
|
-
* @param urls - Array of URLs to preload with their types
|
|
310
|
-
* @returns Promise that resolves when all assets are loaded
|
|
311
|
-
*/
|
|
312
|
-
async preload(urls) {
|
|
313
|
-
const promises = urls.map(({ url, type, ...options }) => this.load(url, type, options));
|
|
314
|
-
await Promise.all(promises);
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Track that an artboard uses a specific asset
|
|
318
|
-
* @param artboardId - The ID of the artboard
|
|
319
|
-
* @param assetId - The ID of the asset being used
|
|
320
|
-
*/
|
|
321
|
-
trackAssetUsage(artboardId, assetId) {
|
|
322
|
-
let dependencies = this._assetDependencies.get(artboardId);
|
|
323
|
-
if (!dependencies) {
|
|
324
|
-
dependencies = new Set();
|
|
325
|
-
this._assetDependencies.set(artboardId, dependencies);
|
|
326
|
-
}
|
|
327
|
-
dependencies.add(assetId);
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* Remove asset usage tracking for an artboard
|
|
331
|
-
* @param artboardId - The ID of the artboard
|
|
332
|
-
* @param assetId - The ID of the asset to stop tracking (optional, removes all if not specified)
|
|
333
|
-
*/
|
|
334
|
-
untrackAssetUsage(artboardId, assetId) {
|
|
335
|
-
if (assetId) {
|
|
336
|
-
const dependencies = this._assetDependencies.get(artboardId);
|
|
337
|
-
if (dependencies) {
|
|
338
|
-
dependencies.delete(assetId);
|
|
339
|
-
if (dependencies.size === 0) {
|
|
340
|
-
this._assetDependencies.delete(artboardId);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
345
|
-
this._assetDependencies.delete(artboardId);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* Get all assets used by a specific artboard
|
|
350
|
-
* @param artboardId - The ID of the artboard
|
|
351
|
-
* @returns Array of asset IDs used by the artboard
|
|
352
|
-
*/
|
|
353
|
-
getArtboardAssets(artboardId) {
|
|
354
|
-
const dependencies = this._assetDependencies.get(artboardId);
|
|
355
|
-
return dependencies ? Array.from(dependencies) : [];
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* Get all artboards that use a specific asset
|
|
359
|
-
* @param assetId - The ID of the asset
|
|
360
|
-
* @returns Array of artboard IDs that use the asset
|
|
361
|
-
*/
|
|
362
|
-
getAssetArtboards(assetId) {
|
|
363
|
-
const artboards = [];
|
|
364
|
-
for (const [artboardId, dependencies] of this._assetDependencies) {
|
|
365
|
-
if (dependencies.has(assetId)) {
|
|
366
|
-
artboards.push(artboardId);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
return artboards;
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* Get all asset dependencies as a map
|
|
373
|
-
* @returns ReadonlyMap of artboard IDs to sets of asset IDs
|
|
374
|
-
*/
|
|
375
|
-
getAllDependencies() {
|
|
376
|
-
return this._assetDependencies;
|
|
377
|
-
}
|
|
378
|
-
/**
|
|
379
|
-
* Clear all asset dependency tracking
|
|
380
|
-
*/
|
|
381
|
-
clearDependencies() {
|
|
382
|
-
this._assetDependencies.clear();
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Collect all asset IDs used in a scene graph
|
|
386
|
-
* @param node - The root node to scan (typically an Artboard)
|
|
387
|
-
* @returns Array of unique asset IDs found in the scene graph
|
|
388
|
-
*/
|
|
389
|
-
collectSceneAssets(node) {
|
|
390
|
-
const assetIds = new Set();
|
|
391
|
-
this._collectSceneAssetsRecursive(node, assetIds);
|
|
392
|
-
return Array.from(assetIds);
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* Recursively collect asset IDs from a scene graph
|
|
396
|
-
*/
|
|
397
|
-
_collectSceneAssetsRecursive(node, assetIds) {
|
|
398
|
-
// Check if this node uses an asset
|
|
399
|
-
if (node instanceof ImageNode) {
|
|
400
|
-
const imageData = node.imageData;
|
|
401
|
-
// If imageData is a string, it's an asset ID or URL
|
|
402
|
-
if (typeof imageData === "string") {
|
|
403
|
-
const assetId = this._generateId(imageData);
|
|
404
|
-
assetIds.add(assetId);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
// Recursively check children
|
|
408
|
-
for (const child of node.children) {
|
|
409
|
-
this._collectSceneAssetsRecursive(child, assetIds);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
/**
|
|
413
|
-
* Generate a unique ID for an asset based on its URL
|
|
414
|
-
*/
|
|
415
|
-
_generateId(url) {
|
|
416
|
-
// Use URL as ID for now - could be enhanced with hashing
|
|
417
|
-
return url;
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Internal method to load an asset based on type
|
|
421
|
-
*/
|
|
422
|
-
async _loadAsset(id, url, type, options) {
|
|
423
|
-
switch (type) {
|
|
424
|
-
case "image":
|
|
425
|
-
return this._loadImage(id, url);
|
|
426
|
-
case "font":
|
|
427
|
-
if (!options?.family) {
|
|
428
|
-
throw AssetError.loadFailed(url, type, "Font family name is required");
|
|
429
|
-
}
|
|
430
|
-
return this._loadFont(id, url, options.family, options);
|
|
431
|
-
case "audio":
|
|
432
|
-
throw AssetError.loadFailed(url, type, "Audio loading not yet implemented");
|
|
433
|
-
default:
|
|
434
|
-
throw AssetError.loadFailed(url, type, `Unknown asset type: ${type}`);
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Load an image asset
|
|
439
|
-
*/
|
|
440
|
-
async _loadImage(id, url) {
|
|
441
|
-
return new Promise((resolve, reject) => {
|
|
442
|
-
const img = new Image();
|
|
443
|
-
img.onload = () => {
|
|
444
|
-
const asset = {
|
|
445
|
-
id,
|
|
446
|
-
type: "image",
|
|
447
|
-
url,
|
|
448
|
-
loaded: true,
|
|
449
|
-
width: img.naturalWidth,
|
|
450
|
-
height: img.naturalHeight,
|
|
451
|
-
data: img,
|
|
452
|
-
};
|
|
453
|
-
resolve(asset);
|
|
454
|
-
};
|
|
455
|
-
img.onerror = (event) => {
|
|
456
|
-
const errorMessage = event instanceof ErrorEvent
|
|
457
|
-
? event.message
|
|
458
|
-
: "Failed to load image";
|
|
459
|
-
reject(AssetError.loadFailed(url, "image", errorMessage || "Network error or invalid image format"));
|
|
460
|
-
};
|
|
461
|
-
// Enable CORS if needed
|
|
462
|
-
img.crossOrigin = "anonymous";
|
|
463
|
-
img.src = url;
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
/**
|
|
467
|
-
* Load a font asset using the FontFace API
|
|
468
|
-
*/
|
|
469
|
-
async _loadFont(id, url, family, options) {
|
|
470
|
-
// Check if FontFace API is available
|
|
471
|
-
if (typeof FontFace === "undefined") {
|
|
472
|
-
throw AssetError.fontLoadFailed(family, "FontFace API is not available in this environment");
|
|
473
|
-
}
|
|
474
|
-
// Create FontFace with descriptors
|
|
475
|
-
const fontFace = new FontFace(family, `url(${url})`, {
|
|
476
|
-
weight: options?.weight ?? "normal",
|
|
477
|
-
style: options?.style ?? "normal",
|
|
478
|
-
display: options?.display ?? "auto",
|
|
479
|
-
});
|
|
480
|
-
try {
|
|
481
|
-
// Load the font
|
|
482
|
-
const loadedFontFace = await fontFace.load();
|
|
483
|
-
// Add to document fonts if available
|
|
484
|
-
if (typeof document !== "undefined" && document.fonts) {
|
|
485
|
-
document.fonts.add(loadedFontFace);
|
|
486
|
-
}
|
|
487
|
-
const asset = {
|
|
488
|
-
id,
|
|
489
|
-
type: "font",
|
|
490
|
-
url,
|
|
491
|
-
loaded: true,
|
|
492
|
-
family,
|
|
493
|
-
fontFace: loadedFontFace,
|
|
494
|
-
};
|
|
495
|
-
return asset;
|
|
496
|
-
}
|
|
497
|
-
catch (error) {
|
|
498
|
-
throw AssetError.fontLoadFailed(family, error instanceof Error ? error.message : String(error), error instanceof Error ? error : undefined);
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
//# sourceMappingURL=assetmanager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assetmanager.js","sourceRoot":"","sources":["../../../core/asset/assetmanager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AA2ChD;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACb,OAAO,GAAuB,IAAI,GAAG,EAAE,CAAA;IACvC,gBAAgB,GAAgC,IAAI,GAAG,EAAE,CAAA;IACzD,iBAAiB,GAA6B,IAAI,CAAA;IAClD,kBAAkB,GAA6B,IAAI,GAAG,EAAE,CAAA,CAAC,gCAAgC;IACzF,eAAe,GACnB,IAAI,GAAG,EAAE,CAAA;IAEb;;OAEG;IACH,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,OAAO,CAAA;IACvB,CAAC;IAED;;;;OAIG;IACH,EAAE,CAAC,SAAyB,EAAE,QAA4B;QACtD,IAAI,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QACnD,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,SAAS,GAAG,IAAI,GAAG,EAAE,CAAA;YACrB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QAClD,CAAC;QACD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAC3B,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,SAAyB,EAAE,QAA4B;QACvD,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QACrD,IAAI,SAAS,EAAE,CAAC;YACZ,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YAC1B,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;gBACvB,IAAI,CAAC,eAAe,CAAC,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,cAAc,CAAC,CAAA;YACtC,CAAC;YAED,MAAM,KAAK,GAAc;gBACrB,EAAE;gBACF,IAAI,EAAE,MAAM;gBACZ,GAAG;gBACH,MAAM,EAAE,IAAI;gBACZ,MAAM;gBACN,QAAQ,EAAE,cAAc;aAC3B,CAAA;YAED,OAAO,KAAK,CAAA;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,UAAU,CAAC,cAAc,CAC3B,MAAM,EACN,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACtD,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAC7C,CAAA;QACL,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/asset/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA"}
|
package/dist/core/asset/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/asset/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { AssetType } from "../serialization";
|
|
2
|
-
/**
|
|
3
|
-
* Base asset interface for runtime asset management
|
|
4
|
-
*/
|
|
5
|
-
export interface Asset {
|
|
6
|
-
readonly id: string;
|
|
7
|
-
readonly type: AssetType;
|
|
8
|
-
readonly url: string;
|
|
9
|
-
readonly loaded: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Runtime image asset with bitmap data
|
|
13
|
-
* Extends the renderer's ImageAsset with asset management metadata
|
|
14
|
-
*/
|
|
15
|
-
export interface RuntimeImageAsset extends Asset {
|
|
16
|
-
readonly type: "image";
|
|
17
|
-
readonly width: number;
|
|
18
|
-
readonly height: number;
|
|
19
|
-
readonly data: HTMLImageElement | ImageBitmap;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Font asset with FontFace
|
|
23
|
-
*/
|
|
24
|
-
export interface FontAsset extends Asset {
|
|
25
|
-
readonly type: "font";
|
|
26
|
-
readonly family: string;
|
|
27
|
-
readonly fontFace: FontFace;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Audio asset (placeholder for future implementation)
|
|
31
|
-
*/
|
|
32
|
-
export interface AudioAsset extends Asset {
|
|
33
|
-
readonly type: "audio";
|
|
34
|
-
readonly data: AudioBuffer;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../core/asset/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;GAEG;AACH,MAAM,WAAW,KAAK;IAClB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,WAAW,CAAA;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAC7B"}
|
package/dist/core/asset/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../core/asset/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Command, CommandCategory, CommandValidationResult } from "./command";
|
|
2
|
-
/**
|
|
3
|
-
* Abstract base class for commands that provides common functionality
|
|
4
|
-
* and default implementations for validation
|
|
5
|
-
*/
|
|
6
|
-
declare abstract class BaseCommand<T = unknown> implements Command<T> {
|
|
7
|
-
abstract name: string;
|
|
8
|
-
abstract description: string;
|
|
9
|
-
abstract category: CommandCategory;
|
|
10
|
-
canUndo: boolean;
|
|
11
|
-
abstract execute(args: T[]): void;
|
|
12
|
-
abstract undo(): void;
|
|
13
|
-
/**
|
|
14
|
-
* Default validation implementation - can be overridden by subclasses
|
|
15
|
-
* @param args Arguments to validate
|
|
16
|
-
* @returns Validation result
|
|
17
|
-
*/
|
|
18
|
-
validate(args: T[]): CommandValidationResult;
|
|
19
|
-
/**
|
|
20
|
-
* Helper method to create validation errors
|
|
21
|
-
*/
|
|
22
|
-
protected createValidationError(...errors: string[]): CommandValidationResult;
|
|
23
|
-
/**
|
|
24
|
-
* Helper method to validate required arguments
|
|
25
|
-
*/
|
|
26
|
-
protected validateRequiredArgs(args: T[], minCount: number): CommandValidationResult;
|
|
27
|
-
}
|
|
28
|
-
export { BaseCommand };
|
|
29
|
-
//# sourceMappingURL=basecommand.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"basecommand.d.ts","sourceRoot":"","sources":["../../../core/command/basecommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,eAAe,EACf,uBAAuB,EAC1B,MAAM,WAAW,CAAA;AAElB;;;GAGG;AACH,uBAAe,WAAW,CAAC,CAAC,GAAG,OAAO,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAA;IAClC,OAAO,UAAO;IAEd,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI;IACjC,QAAQ,CAAC,IAAI,IAAI,IAAI;IAErB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,uBAAuB;IAK5C;;OAEG;IACH,SAAS,CAAC,qBAAqB,CAC3B,GAAG,MAAM,EAAE,MAAM,EAAE,GACpB,uBAAuB;IAO1B;;OAEG;IACH,SAAS,CAAC,oBAAoB,CAC1B,IAAI,EAAE,CAAC,EAAE,EACT,QAAQ,EAAE,MAAM,GACjB,uBAAuB;CAQ7B;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Abstract base class for commands that provides common functionality
|
|
3
|
-
* and default implementations for validation
|
|
4
|
-
*/
|
|
5
|
-
class BaseCommand {
|
|
6
|
-
canUndo = true;
|
|
7
|
-
/**
|
|
8
|
-
* Default validation implementation - can be overridden by subclasses
|
|
9
|
-
* @param args Arguments to validate
|
|
10
|
-
* @returns Validation result
|
|
11
|
-
*/
|
|
12
|
-
validate(args) {
|
|
13
|
-
// Default implementation - no validation errors
|
|
14
|
-
return { valid: true };
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Helper method to create validation errors
|
|
18
|
-
*/
|
|
19
|
-
createValidationError(...errors) {
|
|
20
|
-
return {
|
|
21
|
-
valid: false,
|
|
22
|
-
errors,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Helper method to validate required arguments
|
|
27
|
-
*/
|
|
28
|
-
validateRequiredArgs(args, minCount) {
|
|
29
|
-
if (args.length < minCount) {
|
|
30
|
-
return this.createValidationError(`Expected at least ${minCount} argument(s), got ${args.length}`);
|
|
31
|
-
}
|
|
32
|
-
return { valid: true };
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
export { BaseCommand };
|
|
36
|
-
//# sourceMappingURL=basecommand.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"basecommand.js","sourceRoot":"","sources":["../../../core/command/basecommand.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAe,WAAW;IAItB,OAAO,GAAG,IAAI,CAAA;IAKd;;;;OAIG;IACH,QAAQ,CAAC,IAAS;QACd,gDAAgD;QAChD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;IAED;;OAEG;IACO,qBAAqB,CAC3B,GAAG,MAAgB;QAEnB,OAAO;YACH,KAAK,EAAE,KAAK;YACZ,MAAM;SACT,CAAA;IACL,CAAC;IAED;;OAEG;IACO,oBAAoB,CAC1B,IAAS,EACT,QAAgB;QAEhB,IAAI,IAAI,CAAC,MAAM,GAAG,QAAQ,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC,qBAAqB,CAC7B,qBAAqB,QAAQ,qBAAqB,IAAI,CAAC,MAAM,EAAE,CAClE,CAAA;QACL,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;CACJ;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|