@netless/appliance-plugin 1.1.42-beta.3 → 1.1.43-beta.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/READMA.zh-CN.md +23 -1
- package/README.md +24 -1
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +33 -30
- package/dist/{bridge-8P473Gy8.js → bridge-D68E09T9.js} +1 -1
- package/dist/{bridge-DKyR7grt.mjs → bridge-DcVN05tP.mjs} +1 -1
- package/dist/bridge.js +1 -1
- package/dist/bridge.mjs +1 -1
- package/dist/collector/collector.d.ts +50 -2
- package/dist/collector/types.d.ts +6 -0
- package/dist/component/svg/manager.d.ts +1 -0
- package/dist/component/svg/snapshot.d.ts +4 -1
- package/dist/component/textEditor/manager.d.ts +3 -0
- package/dist/core/backGroundThread/index.d.ts +6 -1
- package/dist/core/cameraTask.d.ts +45 -0
- package/dist/core/const.d.ts +4 -0
- package/dist/core/enum.d.ts +5 -1
- package/dist/core/error.d.ts +1 -0
- package/dist/core/fontFace.d.ts +5 -3
- package/dist/core/mainEngine.d.ts +230 -31
- package/dist/core/mainThread/base.d.ts +23 -2
- package/dist/core/mainThread/canvas2DReadback.d.ts +27 -0
- package/dist/core/mainThread/index.d.ts +12 -1
- package/dist/core/mainThread/snapshotThread.d.ts +11 -2
- package/dist/core/mainThread/subLocalThread.d.ts +12 -6
- package/dist/core/mainThread/subServiceThread.d.ts +5 -3
- package/dist/core/msgEvent/base.d.ts +4 -1
- package/dist/core/msgEvent/baseForWorker.d.ts +1 -1
- package/dist/core/msgEvent/copyNode/forWorker.d.ts +1 -1
- package/dist/core/msgEvent/forWorker.d.ts +1 -1
- package/dist/core/msgEvent/index.d.ts +5 -3
- package/dist/core/msgEvent/rotateNode/forMain.d.ts +1 -0
- package/dist/core/msgEvent/rotateNode/forWorker.d.ts +1 -1
- package/dist/core/msgEvent/scaleNode/forMain.d.ts +1 -0
- package/dist/core/msgEvent/scaleNode/forWorker.d.ts +1 -1
- package/dist/core/msgEvent/setColor/forMain.d.ts +1 -0
- package/dist/core/msgEvent/setColor/forWorker.d.ts +1 -1
- package/dist/core/msgEvent/setFont/forWorker.d.ts +1 -1
- package/dist/core/msgEvent/setLock/forWorker.d.ts +1 -1
- package/dist/core/msgEvent/setPoint/forWorker.d.ts +1 -1
- package/dist/core/msgEvent/setShape/forWorker.d.ts +1 -1
- package/dist/core/msgEvent/setZIndex/forWorker.d.ts +1 -1
- package/dist/core/msgEvent/translateNode/forMain.d.ts +1 -0
- package/dist/core/msgEvent/translateNode/forWorker.d.ts +1 -1
- package/dist/core/renderRuntimeFallback.d.ts +2 -0
- package/dist/core/rendererBusinessTask.d.ts +30 -0
- package/dist/core/serviceRenderScheduler.d.ts +33 -0
- package/dist/core/tools/base.d.ts +1 -1
- package/dist/core/tools/bitmapEraserFastPath.d.ts +8 -0
- package/dist/core/tools/eraserFaces.d.ts +24 -9
- package/dist/core/tools/image.d.ts +1 -0
- package/dist/core/tools/pencilEraserBitMap.d.ts +62 -14
- package/dist/core/tools/text.d.ts +2 -1
- package/dist/core/types.d.ts +64 -1
- package/dist/core/utils/indexDB.d.ts +3 -3
- package/dist/core/vNodeManager.d.ts +7 -0
- package/dist/core/worker/base.d.ts +52 -7
- package/dist/core/worker/fullWorkerLocal.d.ts +8 -2
- package/dist/core/worker/fullWorkerService.d.ts +7 -3
- package/dist/core/worker/renderCapabilityProbe.d.ts +54 -0
- package/dist/core/worker/simpleWorker.d.ts +2 -2
- package/dist/core/worker/snapshotWork.d.ts +1 -0
- package/dist/core/worker/workerManager.d.ts +17 -4
- package/dist/displayer/floatBar/selectorGesture.d.ts +2 -0
- package/dist/fullWorker.js +138 -139
- package/dist/index-BNHPCii1.mjs +4089 -0
- package/dist/index-B_vZ9d3x.mjs +55912 -0
- package/dist/index-C2AHqjj8.js +570 -0
- package/dist/index-CV8YaU3F.mjs +931 -0
- package/dist/index-CWDWQZBs.mjs +4088 -0
- package/dist/index-DChI1--R.js +1 -0
- package/dist/index-DFo0Gmfx.js +570 -0
- package/dist/index-DiLPVPwQ.js +1 -0
- package/dist/index-GBYM7kT5.js +1 -0
- package/dist/index-GZUDLXJC.js +1 -0
- package/dist/{index-C9wx0zmg.mjs → index-K_0NX6pD.mjs} +401 -263
- package/dist/index-NG5kKK1W.mjs +55920 -0
- package/dist/plugin/applianceMultiPlugin.d.ts +18 -3
- package/dist/plugin/applianceSinglePlugin.d.ts +18 -4
- package/dist/plugin/baseApplianceManager.d.ts +138 -12
- package/dist/plugin/baseViewContainerManager.d.ts +40 -3
- package/dist/plugin/bitmapEraserOptions.d.ts +9 -0
- package/dist/plugin/const.d.ts +4 -0
- package/dist/plugin/displayerView.d.ts +7 -7
- package/dist/plugin/initLogAggregator.d.ts +45 -0
- package/dist/plugin/multi/applianceMultiManager.d.ts +1 -0
- package/dist/plugin/multi/containerManager.d.ts +19 -1
- package/dist/plugin/pluginInstanceOwner.d.ts +1 -0
- package/dist/plugin/renderImageBitmapRetirement.d.ts +100 -0
- package/dist/plugin/renderRuntimeCache.d.ts +18 -0
- package/dist/plugin/renderSurface.d.ts +15 -0
- package/dist/plugin/renderingCompatibility.d.ts +21 -5
- package/dist/plugin/roomLifecycle.d.ts +12 -0
- package/dist/plugin/selectorApi.d.ts +8 -0
- package/dist/plugin/single/applianceSingleManager.d.ts +4 -0
- package/dist/plugin/types.d.ts +11 -14
- package/dist/plugin/utils.d.ts +8 -0
- package/dist/subWorker.js +136 -137
- package/dist/undo/index.d.ts +12 -3
- package/dist/undo/timing.d.ts +9 -4
- package/package.json +23 -8
- package/dist/index-BCvU2uMB.js +0 -570
- package/dist/index-BXnpbc6O.mjs +0 -48995
- package/dist/index-BrWufZZe.js +0 -1
- package/dist/index-BubEu09-.js +0 -1
- package/dist/index-C1ph7d6H.mjs +0 -789
- package/dist/index-CAXJpQEp.js +0 -570
- package/dist/index-D0bfakdd.js +0 -1
- package/dist/index-DcS9JJvi.mjs +0 -3266
- package/dist/index-Zu5juuhI.js +0 -1
- package/dist/index-k0AjJn1s.mjs +0 -48987
- package/dist/index-vWLQ-o4q.mjs +0 -3267
package/dist/undo/index.d.ts
CHANGED
|
@@ -36,14 +36,14 @@ export declare class UndoRedoMethod {
|
|
|
36
36
|
private pendingState;
|
|
37
37
|
private tickerEndWaiters;
|
|
38
38
|
private undoLifecycleListeners;
|
|
39
|
+
private pendingWaitCancels;
|
|
40
|
+
private destroyed;
|
|
39
41
|
private lifecycleCache;
|
|
40
42
|
private stackRevision;
|
|
41
43
|
private tickStartCaches;
|
|
42
44
|
private tickStartExcludeIds;
|
|
43
45
|
private readonly timingFix;
|
|
44
46
|
private readonly ackTimeout;
|
|
45
|
-
private readonly gracePeriodTimeout;
|
|
46
|
-
private readonly doingFallbackTimeout;
|
|
47
47
|
private isGlobalStackTransaction;
|
|
48
48
|
private pendingGlobalServiceData?;
|
|
49
49
|
private pendingArrayChanges;
|
|
@@ -55,6 +55,7 @@ export declare class UndoRedoMethod {
|
|
|
55
55
|
onUndoLifecycle(listener: (event: UndoLifecycleEvent) => void): () => void;
|
|
56
56
|
getPendingTickerSnapshots(scenePath: string): PendingTickerSnapshot[];
|
|
57
57
|
waitForUndoStackEnd(identity: UndoStackIdentity, stackEndTimeout: number): Promise<UndoStackEndEvent>;
|
|
58
|
+
waitForDataDone(identity: UndoStackIdentity, timeout?: number): Promise<void>;
|
|
58
59
|
waitForFinalizeRequested(identity: UndoStackIdentity, timeout: number): Promise<void>;
|
|
59
60
|
private emitUndoStepsUpdate;
|
|
60
61
|
private emitRedoStepsUpdate;
|
|
@@ -75,10 +76,17 @@ export declare class UndoRedoMethod {
|
|
|
75
76
|
private armAckTimeout;
|
|
76
77
|
private tryEnd;
|
|
77
78
|
private forceFlushPending;
|
|
78
|
-
private hasAnyAck;
|
|
79
79
|
private clearPendingState;
|
|
80
80
|
waitForTickerEnd(id: UndoStackId, timeout?: number): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Dispose only this View's local ticker machinery. This is intentionally
|
|
83
|
+
* different from cancelUndoTicker(): destroying a View must not manufacture
|
|
84
|
+
* a stack-end/no-change event or an Undo item.
|
|
85
|
+
*/
|
|
86
|
+
disposeViewTickers(reason?: "view-destroyed" | "plugin-destroyed"): void;
|
|
81
87
|
cancelUndoTicker(id: number, viewId: string, scenePath: string): void;
|
|
88
|
+
/** Cancel this View's current start-to-stack-end transaction after Clear. */
|
|
89
|
+
cancelViewUndoTicker(): void;
|
|
82
90
|
private getStartCache;
|
|
83
91
|
private getExcludeIds;
|
|
84
92
|
private resetLegacyTicker;
|
|
@@ -97,6 +105,7 @@ export declare class UndoRedoMethod {
|
|
|
97
105
|
undo(scenePath: string): number;
|
|
98
106
|
redo(scenePath: string): number;
|
|
99
107
|
clear(): void;
|
|
108
|
+
destroy(): void;
|
|
100
109
|
clearUndo(): void;
|
|
101
110
|
clearRedo(): void;
|
|
102
111
|
canUndo(): boolean;
|
package/dist/undo/timing.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { BaseCollectorReducerAction } from "../collector/types";
|
|
2
2
|
export declare const UndoScope_ClearAll = "__undo_scope_clear_all__";
|
|
3
|
+
export declare const resolveUndoFinalizeTimeout: (ackTimeout: number) => number;
|
|
4
|
+
export declare const resolveUndoStackEndTimeout: (ackTimeout: number) => number;
|
|
3
5
|
export declare enum UndoTickerSource {
|
|
4
6
|
DrawingPencil = "drawing:pencil",
|
|
5
7
|
DrawingArrow = "drawing:arrow",
|
|
@@ -58,13 +60,12 @@ export type PendingUndoTickerState = {
|
|
|
58
60
|
phase: LocalTransactionPhase;
|
|
59
61
|
ownerPromiseActive: boolean;
|
|
60
62
|
finalizeRequested: boolean;
|
|
63
|
+
finalizedAt?: number;
|
|
61
64
|
collectedScopeKeys: Set<string>;
|
|
62
65
|
scopeKeys: Set<string>;
|
|
63
66
|
ackedStorageKeys: Set<string>;
|
|
64
67
|
meta: AckMeta & Pick<ExpectedAcks, "copyAck" | "isWritable">;
|
|
65
68
|
ackTimer?: number;
|
|
66
|
-
graceTimer?: number;
|
|
67
|
-
fallbackTimer?: number;
|
|
68
69
|
};
|
|
69
70
|
export type UndoStackIdentity = {
|
|
70
71
|
viewId: string;
|
|
@@ -78,6 +79,11 @@ export type UndoFinalizeRequestedEvent = UndoStackIdentity & {
|
|
|
78
79
|
scopeMode: "static" | "dynamic";
|
|
79
80
|
finalizedAt: number;
|
|
80
81
|
};
|
|
82
|
+
export type UndoDataDoneEvent = UndoStackIdentity & {
|
|
83
|
+
phase: "data-done";
|
|
84
|
+
source: UndoTickerSource;
|
|
85
|
+
completedAt: number;
|
|
86
|
+
};
|
|
81
87
|
export type UndoStackEndEvent = UndoStackIdentity & {
|
|
82
88
|
phase: "stack-end";
|
|
83
89
|
source: UndoTickerSource;
|
|
@@ -92,7 +98,7 @@ export type UndoStackFailedEvent = UndoStackIdentity & {
|
|
|
92
98
|
missingRender: boolean;
|
|
93
99
|
missingStorageIds: string[];
|
|
94
100
|
};
|
|
95
|
-
export type UndoLifecycleEvent = UndoFinalizeRequestedEvent | UndoStackEndEvent | UndoStackFailedEvent;
|
|
101
|
+
export type UndoLifecycleEvent = UndoFinalizeRequestedEvent | UndoDataDoneEvent | UndoStackEndEvent | UndoStackFailedEvent;
|
|
96
102
|
export type PendingTickerSnapshot = UndoStackIdentity & {
|
|
97
103
|
source: UndoTickerSource;
|
|
98
104
|
startedAt: number;
|
|
@@ -113,7 +119,6 @@ export declare function createPendingUndoTickerState(params: {
|
|
|
113
119
|
viewId: string;
|
|
114
120
|
scenePath: string;
|
|
115
121
|
expectedAcks: ExpectedAcks;
|
|
116
|
-
fallbackTimer?: number;
|
|
117
122
|
}): PendingUndoTickerState;
|
|
118
123
|
export declare function mergeAckMeta(state: PendingUndoTickerState, meta?: AckMeta): void;
|
|
119
124
|
export declare function isPendingStateComplete(state: PendingUndoTickerState): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netless/appliance-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.43-beta.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"bridge.d.ts",
|
|
@@ -42,22 +42,34 @@
|
|
|
42
42
|
"example:lint": "pnpm --dir example lint",
|
|
43
43
|
"example:typecheck": "pnpm exec tsc --noEmit -p example/tsconfig.json",
|
|
44
44
|
"sync:fastboard-docs": "node scripts/sync-fastboard-docs.mjs",
|
|
45
|
-
"ci:check": "pnpm lint && pnpm test:auto-shape && pnpm test:rendering-compatibility && pnpm test:background-image-load:coverage && pnpm test:max-retries-type && pnpm test:background-image-query && pnpm test:current-scene-guard && pnpm test:init-ready && pnpm build && pnpm example:typecheck",
|
|
45
|
+
"ci:check": "pnpm lint && pnpm test:auto-shape && pnpm test:rendering-compatibility && pnpm test:render-runtime-fallback && pnpm test:image-bitmap-retirement && pnpm test:image-bitmap-diagnostic && pnpm test:service-sync-commit && pnpm test:init-await-boundaries && pnpm test:init-log-aggregation && pnpm test:background-image-load:coverage && pnpm test:max-retries-type && pnpm test:background-image-query && pnpm test:current-scene-guard && pnpm test:init-state-reconciliation && pnpm test:render-runtime-cache && pnpm test:init-ready && pnpm test:transaction-barrier && pnpm test:bitmap-eraser && pnpm test:undo-timing && pnpm build && pnpm example:typecheck",
|
|
46
46
|
"test:max-retries-type": "tsc -p tsconfig.types-test.json",
|
|
47
47
|
"test:text-editor-focus": "tsx scripts/textEditorFocus.test.ts",
|
|
48
|
-
"test:auto-shape": "tsx
|
|
49
|
-
"test:undo-timing": "tsx test/undoTiming.test.ts",
|
|
48
|
+
"test:auto-shape": "tsx scripts/autoShape.test.ts",
|
|
49
|
+
"test:undo-timing": "cross-env NODE_OPTIONS=--require=./scripts/registerAssetStubs.cjs tsx test/undoTiming.test.ts",
|
|
50
50
|
"test:undo-finalize": "tsx scripts/undoFinalize.test.ts",
|
|
51
51
|
"test:batch-scheduler": "tsx scripts/batchScheduler.test.ts",
|
|
52
52
|
"test:transaction-barrier": "cross-env NODE_OPTIONS=--require=./scripts/registerAssetStubs.cjs tsx scripts/transactionBarrier.test.ts",
|
|
53
53
|
"test:current-scene-guard": "tsx scripts/currentSceneGuard.test.ts",
|
|
54
54
|
"test:init-ready": "tsx scripts/initReadyBarrier.test.ts",
|
|
55
|
+
"test:init-state-reconciliation": "cross-env NODE_OPTIONS=--require=./scripts/registerAssetStubs.cjs tsx --tsconfig scripts/tsconfig.appliance-main.json scripts/initStateReconciliation.test.ts",
|
|
56
|
+
"test:render-runtime-cache": "cross-env NODE_OPTIONS=--require=./scripts/registerAssetStubs.cjs tsx scripts/renderRuntimeCache.test.ts",
|
|
57
|
+
"test:camera-main-thread-fallback": "cross-env NODE_OPTIONS=--require=./scripts/registerAssetStubs.cjs tsx --tsconfig scripts/tsconfig.appliance-main.json scripts/mainThreadCameraFallback.test.ts",
|
|
55
58
|
"test:init-reentry:stress": "playwright test tests/init-reentry.stress.spec.ts",
|
|
56
|
-
"test:
|
|
59
|
+
"test:renderer-pixel": "pnpm build:spritejs-runtime && tsx scripts/rendererPixel.test.ts",
|
|
60
|
+
"test:undo-timing:coverage": "cross-env NODE_OPTIONS=--require=./scripts/registerAssetStubs.cjs c8 --reporter=text --reporter=html --include=src/undo/timing.ts --check-coverage --statements 90 --lines 90 --branches 90 --functions 90 tsx test/undoTiming.test.ts",
|
|
57
61
|
"test:selector-api": "tsx test/selectorApi.test.ts",
|
|
58
62
|
"test:rendering-compatibility": "tsx scripts/renderingCompatibility.test.ts",
|
|
63
|
+
"test:render-runtime-fallback": "tsx scripts/renderRuntimeFallback.test.ts && cross-env NODE_OPTIONS=--require=./scripts/registerAssetStubs.cjs tsx --tsconfig scripts/tsconfig.appliance-main.json scripts/renderRuntimeFallbackMainEngine.test.ts",
|
|
64
|
+
"test:image-bitmap-retirement": "tsx scripts/renderImageBitmapRetirement.test.ts",
|
|
65
|
+
"test:image-bitmap-diagnostic": "cross-env NODE_OPTIONS=--require=./scripts/registerAssetStubs.cjs tsx --tsconfig scripts/tsconfig.appliance-main.json scripts/renderImageBitmapDiagnostic.test.ts",
|
|
66
|
+
"test:service-sync-commit": "cross-env NODE_OPTIONS=--require=./scripts/registerAssetStubs.cjs tsx scripts/serviceSyncCommit.test.ts",
|
|
67
|
+
"test:init-await-boundaries": "cross-env NODE_OPTIONS=--require=./scripts/registerAssetStubs.cjs tsx scripts/initAwaitBoundaries.test.ts",
|
|
68
|
+
"test:font-face-lifecycle": "tsx scripts/fontFaceLifecycle.test.ts",
|
|
69
|
+
"test:snapshot-lifecycle": "cross-env NODE_OPTIONS=--require=./scripts/registerAssetStubs.cjs tsx scripts/snapshotLifecycle.test.ts",
|
|
70
|
+
"test:init-log-aggregation": "tsx scripts/initLogAggregator.test.ts",
|
|
59
71
|
"test:cursor-appearance": "tsx scripts/cursorAppearance.test.ts",
|
|
60
|
-
"test:bitmap-eraser": "tsx scripts/bitmapEraserCapability.test.ts && tsx scripts/bitmapRasterGeometry.test.ts && tsx scripts/vNodeSpatialIndex.test.ts && tsx scripts/eraserFaces.test.ts",
|
|
72
|
+
"test:bitmap-eraser": "tsx scripts/bitmapEraserCapability.test.ts && tsx scripts/bitmapRasterGeometry.test.ts && cross-env NODE_OPTIONS=--require=./scripts/registerAssetStubs.cjs tsx scripts/vNodeSpatialIndex.test.ts && cross-env NODE_OPTIONS=--require=./scripts/registerAssetStubs.cjs tsx scripts/eraserFaces.test.ts",
|
|
61
73
|
"test:sync-logger": "tsx scripts/syncLogger.test.ts",
|
|
62
74
|
"test:background-image-load": "tsx scripts/backgroundImageLoadCoordinator.test.ts",
|
|
63
75
|
"test:background-image-query": "tsx scripts/backgroundImageQuery.test.ts",
|
|
@@ -68,7 +80,7 @@
|
|
|
68
80
|
"types:bundler": "tsc --emitDeclarationOnly",
|
|
69
81
|
"build:spritejs-runtime": "pnpm --dir ../spritejs compile:appliance",
|
|
70
82
|
"build:bridge": "vite build --config vite.config.bridge.js",
|
|
71
|
-
"build:bundler": "vite build --config vite.config.bundler.js && pnpm build:bridge && pnpm types:bundler",
|
|
83
|
+
"build:bundler": "vite build --config vite.config.bundler.js && node scripts/assertRenderRuntimeMarker.mjs && pnpm build:bridge && pnpm types:bundler",
|
|
72
84
|
"types:worker": "tsc --noEmit",
|
|
73
85
|
"build:worker:full": "vite build --config vite.config.worker-full.js",
|
|
74
86
|
"build:worker:sub": "vite build --config vite.config.worker-sub.js",
|
|
@@ -91,11 +103,13 @@
|
|
|
91
103
|
"@types/rbush": "4.0.0",
|
|
92
104
|
"@types/react": "^18.3.28",
|
|
93
105
|
"@types/react-dom": "^18.3.7",
|
|
106
|
+
"@types/spark-md5": "3.0.5",
|
|
94
107
|
"@typescript-eslint/eslint-plugin": "^8.39.0",
|
|
95
108
|
"@typescript-eslint/parser": "^8.39.0",
|
|
96
109
|
"@vitest/coverage-v8": "^4.1.9",
|
|
97
110
|
"c8": "^11.0.0",
|
|
98
111
|
"cross-env": "^7.0.3",
|
|
112
|
+
"eslint": "^9.39.4",
|
|
99
113
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
100
114
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
101
115
|
"jsdom": "^29.1.1",
|
|
@@ -110,7 +124,7 @@
|
|
|
110
124
|
"typescript": "^5.2.2",
|
|
111
125
|
"vite": "^5.0.0",
|
|
112
126
|
"vitest": "^4.1.9",
|
|
113
|
-
"white-web-sdk": "^2.16.
|
|
127
|
+
"white-web-sdk": "^2.16.58"
|
|
114
128
|
},
|
|
115
129
|
"peerDependencies": {
|
|
116
130
|
"@netless/window-manager": ">=1.0",
|
|
@@ -142,6 +156,7 @@
|
|
|
142
156
|
"react": "^16.8.0",
|
|
143
157
|
"react-dom": "^16.8.0",
|
|
144
158
|
"react-draggable": "4.5.0",
|
|
159
|
+
"spark-md5": "3.0.2",
|
|
145
160
|
"xss": "^1.0.15"
|
|
146
161
|
},
|
|
147
162
|
"directories": {
|