@edv4h/usketch-plugin-sync-localstorage-yjs 1.0.1 → 2.0.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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +17 -19
- package/dist/plugin.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAsB,MAAM,eAAe,CAAC"}
|
package/dist/plugin.d.ts
CHANGED
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAK3D,wBAAgB,+BAA+B,IAAI,aAAa,CAoB/D"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { createYjsSync } from "./yjs-sync.js";
|
|
2
2
|
const DOC_NAME = "usketch-default";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
};
|
|
3
|
+
export function createSyncLocalstorageYjsPlugin() {
|
|
4
|
+
return {
|
|
5
|
+
id: "usketch-plugin-sync-localstorage-yjs",
|
|
6
|
+
name: "ローカル永続化 (Yjs + IndexedDB)",
|
|
7
|
+
async setup(ctx) {
|
|
8
|
+
const handle = createYjsSync(ctx.store, DOC_NAME);
|
|
9
|
+
// Expose sync status on window for DebugHUD to pick up
|
|
10
|
+
globalThis.__usketchSyncStatus = handle.status;
|
|
11
|
+
// Wait for IndexedDB restoration before continuing plugin setup chain
|
|
12
|
+
await handle.whenSynced;
|
|
13
|
+
return () => {
|
|
14
|
+
handle.destroy();
|
|
15
|
+
delete globalThis.__usketchSyncStatus;
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
22
20
|
//# sourceMappingURL=plugin.js.map
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AAEnC,MAAM,UAAU,+BAA+B;IAC9C,OAAO;QACN,EAAE,EAAE,sCAAsC;QAC1C,IAAI,EAAE,2BAA2B;QAEjC,KAAK,CAAC,KAAK,CAAC,GAAG;YACd,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAElD,uDAAuD;YACtD,UAAsC,CAAC,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;YAE5E,sEAAsE;YACtE,MAAM,MAAM,CAAC,UAAU,CAAC;YAExB,OAAO,GAAG,EAAE;gBACX,MAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,OAAQ,UAAsC,CAAC,mBAAmB,CAAC;YACpE,CAAC,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edv4h/usketch-plugin-sync-localstorage-yjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"y-indexeddb": "^9.0.0",
|
|
16
16
|
"yjs": "^13.6.0",
|
|
17
|
-
"@edv4h/usketch-shared": "
|
|
17
|
+
"@edv4h/usketch-shared": "3.0.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"fake-indexeddb": "^6.0.0",
|