@gogitcms/editor 0.23.0 → 0.26.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/app/src/App.tsx +36 -12
- package/npm-shrinkwrap.json +36 -36
- package/package.json +6 -6
package/app/src/App.tsx
CHANGED
|
@@ -2373,10 +2373,10 @@ function useBranchImport(repositoryId?: string, branchId?: string) {
|
|
|
2373
2373
|
const [live, setLive] = useState<BranchImportState | null>(null);
|
|
2374
2374
|
// Tracks the previous render's `running`, to spot the moment an import lands.
|
|
2375
2375
|
const wasRunning = useRef(false);
|
|
2376
|
-
// A branch switch invalidates the previous branch's live state
|
|
2377
|
-
//
|
|
2378
|
-
//
|
|
2379
|
-
//
|
|
2376
|
+
// A branch switch invalidates the previous branch's live state. The `branchId`
|
|
2377
|
+
// check below is what actually makes that safe — this only frees the memory —
|
|
2378
|
+
// because an effect runs a render too late to keep the switching render from
|
|
2379
|
+
// reading it.
|
|
2380
2380
|
useEffect(() => { setLive(null); wasRunning.current = false; }, [repositoryId, branchId]);
|
|
2381
2381
|
useSubscription(BRANCH_IMPORT_PROGRESS, {
|
|
2382
2382
|
variables,
|
|
@@ -2390,16 +2390,40 @@ function useBranchImport(repositoryId?: string, branchId?: string) {
|
|
|
2390
2390
|
},
|
|
2391
2391
|
});
|
|
2392
2392
|
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
//
|
|
2396
|
-
//
|
|
2397
|
-
//
|
|
2398
|
-
//
|
|
2399
|
-
// import
|
|
2393
|
+
// Every answer names the branch it describes, and anything naming a different
|
|
2394
|
+
// one is discarded. Both sources outlive the render that switches branches —
|
|
2395
|
+
// `live` until its reset effect runs, `data` for as long as Apollo holds the
|
|
2396
|
+
// previous variables' result — so without this the switching render answers
|
|
2397
|
+
// for the branch just left. That is not a cosmetic flash: on the way onto a
|
|
2398
|
+
// newly created branch it reports "already imported", the gate opens, and the
|
|
2399
|
+
// editor mounts and caches an empty `collections` for a branch whose import
|
|
2400
|
+
// has not run yet — an empty editor that never fills in.
|
|
2401
|
+
const answer = live ?? data?.branchImport ?? null;
|
|
2402
|
+
const state: BranchImportState | null =
|
|
2403
|
+
answer && answer.branchId === branchId ? answer : null;
|
|
2404
|
+
|
|
2405
|
+
// An import that just landed replaced this branch's content, so drop what the
|
|
2406
|
+
// cache believes about it and re-read the lists.
|
|
2407
|
+
//
|
|
2408
|
+
// Eviction is not redundant with the refetch: `refetchQueries` only reaches
|
|
2409
|
+
// MOUNTED queries, and the editor is unmounted behind the first-import gate.
|
|
2410
|
+
// Without it, a `collections` answer cached before the import landed would
|
|
2411
|
+
// still be there when the gate opens and the editor mounts.
|
|
2412
|
+
//
|
|
2413
|
+
// Open documents are deliberately left out of both. Replacing the text under
|
|
2414
|
+
// an editor that may hold unsaved edits is worse than showing content one
|
|
2415
|
+
// import behind, and the import's own notification already says something
|
|
2416
|
+
// changed.
|
|
2400
2417
|
useEffect(() => {
|
|
2401
2418
|
if (!state) return;
|
|
2402
|
-
if (wasRunning.current && !state.running)
|
|
2419
|
+
if (wasRunning.current && !state.running) {
|
|
2420
|
+
for (const fieldName of ["collections", "documents", "documentCount", "mediaSets", "media", "mediaCount", "mediaFacets"]) {
|
|
2421
|
+
apollo.cache.evict({ id: "ROOT_QUERY", fieldName });
|
|
2422
|
+
}
|
|
2423
|
+
apollo.cache.gc();
|
|
2424
|
+
// REPOSITORIES carries the branch's projects, which arrive with the import.
|
|
2425
|
+
void apollo.refetchQueries({ include: [REPOSITORIES, COLLECTIONS, DOCUMENTS, DOCUMENT_COUNT] });
|
|
2426
|
+
}
|
|
2403
2427
|
wasRunning.current = state.running;
|
|
2404
2428
|
}, [state?.running, apollo]);
|
|
2405
2429
|
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gogitcms/editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@gogitcms/editor",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.26.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@apollo/client": "^3.11.8",
|
|
12
12
|
"@handlewithcare/react-prosemirror": "^3.2.7",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"node": ">=20"
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
|
-
"@gogitcms/gitcms-local-darwin-arm64": "0.
|
|
51
|
-
"@gogitcms/gitcms-local-darwin-x64": "0.
|
|
52
|
-
"@gogitcms/gitcms-local-linux-arm64": "0.
|
|
53
|
-
"@gogitcms/gitcms-local-linux-x64": "0.
|
|
54
|
-
"@gogitcms/gitcms-local-win32-x64": "0.
|
|
50
|
+
"@gogitcms/gitcms-local-darwin-arm64": "0.26.0",
|
|
51
|
+
"@gogitcms/gitcms-local-darwin-x64": "0.26.0",
|
|
52
|
+
"@gogitcms/gitcms-local-linux-arm64": "0.26.0",
|
|
53
|
+
"@gogitcms/gitcms-local-linux-x64": "0.26.0",
|
|
54
|
+
"@gogitcms/gitcms-local-win32-x64": "0.26.0"
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"node_modules/@apollo/client": {
|
|
@@ -751,9 +751,9 @@
|
|
|
751
751
|
}
|
|
752
752
|
},
|
|
753
753
|
"node_modules/@gogitcms/gitcms-local-darwin-arm64": {
|
|
754
|
-
"version": "0.
|
|
755
|
-
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-darwin-arm64/-/gitcms-local-darwin-arm64-0.
|
|
756
|
-
"integrity": "sha512-
|
|
754
|
+
"version": "0.26.0",
|
|
755
|
+
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-darwin-arm64/-/gitcms-local-darwin-arm64-0.26.0.tgz",
|
|
756
|
+
"integrity": "sha512-nY+iDSkE5DHBCIhW8zXHsXf7Lg4jhycuGmBROnYOm8d7EO8AtrWkgeLZQRxN5tn+oTvuf8ULZAYJzhtsESHfvg==",
|
|
757
757
|
"cpu": [
|
|
758
758
|
"arm64"
|
|
759
759
|
],
|
|
@@ -764,9 +764,9 @@
|
|
|
764
764
|
]
|
|
765
765
|
},
|
|
766
766
|
"node_modules/@gogitcms/gitcms-local-darwin-x64": {
|
|
767
|
-
"version": "0.
|
|
768
|
-
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-darwin-x64/-/gitcms-local-darwin-x64-0.
|
|
769
|
-
"integrity": "sha512-
|
|
767
|
+
"version": "0.26.0",
|
|
768
|
+
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-darwin-x64/-/gitcms-local-darwin-x64-0.26.0.tgz",
|
|
769
|
+
"integrity": "sha512-NhXzSOMtK5CcapXf7RwgedVTBZRUyE5nFyhwe/cls52k2CeKebuXcOAdzqZig7Goc2MbdXjne5cJg1DssQj65Q==",
|
|
770
770
|
"cpu": [
|
|
771
771
|
"x64"
|
|
772
772
|
],
|
|
@@ -777,9 +777,9 @@
|
|
|
777
777
|
]
|
|
778
778
|
},
|
|
779
779
|
"node_modules/@gogitcms/gitcms-local-linux-arm64": {
|
|
780
|
-
"version": "0.
|
|
781
|
-
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-linux-arm64/-/gitcms-local-linux-arm64-0.
|
|
782
|
-
"integrity": "sha512-
|
|
780
|
+
"version": "0.26.0",
|
|
781
|
+
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-linux-arm64/-/gitcms-local-linux-arm64-0.26.0.tgz",
|
|
782
|
+
"integrity": "sha512-ZzADRlGhbCxiabx3ZCLXNgHz/mS0S+RWeROCRTfYJ5qECGoF2nFR9Oc6XH5mAxZUjDuC0rk5e+PQ0UnMW5bEbA==",
|
|
783
783
|
"cpu": [
|
|
784
784
|
"arm64"
|
|
785
785
|
],
|
|
@@ -790,9 +790,9 @@
|
|
|
790
790
|
]
|
|
791
791
|
},
|
|
792
792
|
"node_modules/@gogitcms/gitcms-local-linux-x64": {
|
|
793
|
-
"version": "0.
|
|
794
|
-
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-linux-x64/-/gitcms-local-linux-x64-0.
|
|
795
|
-
"integrity": "sha512-
|
|
793
|
+
"version": "0.26.0",
|
|
794
|
+
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-linux-x64/-/gitcms-local-linux-x64-0.26.0.tgz",
|
|
795
|
+
"integrity": "sha512-LJcnM3x6l7Px41WE15qB9FotsjBm6RvcFdHZvERf06n5wM3D6X6XN/Q8tcqT4s1QgULzQkBucqxTM40Gq4ntXA==",
|
|
796
796
|
"cpu": [
|
|
797
797
|
"x64"
|
|
798
798
|
],
|
|
@@ -803,9 +803,9 @@
|
|
|
803
803
|
]
|
|
804
804
|
},
|
|
805
805
|
"node_modules/@gogitcms/gitcms-local-win32-x64": {
|
|
806
|
-
"version": "0.
|
|
807
|
-
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-win32-x64/-/gitcms-local-win32-x64-0.
|
|
808
|
-
"integrity": "sha512-
|
|
806
|
+
"version": "0.26.0",
|
|
807
|
+
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-win32-x64/-/gitcms-local-win32-x64-0.26.0.tgz",
|
|
808
|
+
"integrity": "sha512-ytM6bPrLzBFVle9VaROTaTCLkPJ0DVU5JgsTqMEcp4n4lAVTY2REs9P4evADF7405qxnTJDm+ljzQBFEfgG88A==",
|
|
809
809
|
"cpu": [
|
|
810
810
|
"x64"
|
|
811
811
|
],
|
|
@@ -982,12 +982,12 @@
|
|
|
982
982
|
}
|
|
983
983
|
},
|
|
984
984
|
"node_modules/@posthog/core": {
|
|
985
|
-
"version": "1.
|
|
986
|
-
"resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.
|
|
987
|
-
"integrity": "sha512
|
|
985
|
+
"version": "1.49.0",
|
|
986
|
+
"resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.49.0.tgz",
|
|
987
|
+
"integrity": "sha512-+Ejf6sZ2wI9F37rOrPxoI90mydOw5O/YKjAgWMkkuuQRHGwyfXugxsD/+CVI4Yymg8LujHr0C/KXJvWDJYgwWQ==",
|
|
988
988
|
"license": "MIT",
|
|
989
989
|
"dependencies": {
|
|
990
|
-
"@posthog/types": "^1.
|
|
990
|
+
"@posthog/types": "^1.407.0"
|
|
991
991
|
}
|
|
992
992
|
},
|
|
993
993
|
"node_modules/@posthog/types": {
|
|
@@ -3898,9 +3898,9 @@
|
|
|
3898
3898
|
"peer": true
|
|
3899
3899
|
},
|
|
3900
3900
|
"node_modules/node-releases": {
|
|
3901
|
-
"version": "2.0.
|
|
3902
|
-
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.
|
|
3903
|
-
"integrity": "sha512-
|
|
3901
|
+
"version": "2.0.54",
|
|
3902
|
+
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.54.tgz",
|
|
3903
|
+
"integrity": "sha512-YHs7BmmcsdAI5Ozuf8JZo6PT0mv2GIWC9vMfvUC3dp65M8hn7Ux8CPL+2oBI7juNuj9d0ndhTcznq2ODBps9cQ==",
|
|
3904
3904
|
"license": "MIT",
|
|
3905
3905
|
"engines": {
|
|
3906
3906
|
"node": ">=18"
|
|
@@ -4071,13 +4071,13 @@
|
|
|
4071
4071
|
"license": "MIT"
|
|
4072
4072
|
},
|
|
4073
4073
|
"node_modules/posthog-js": {
|
|
4074
|
-
"version": "1.
|
|
4075
|
-
"resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.
|
|
4076
|
-
"integrity": "sha512-
|
|
4074
|
+
"version": "1.422.0",
|
|
4075
|
+
"resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.422.0.tgz",
|
|
4076
|
+
"integrity": "sha512-m2mg6SLFZs9L2/L+a8+aeraR0LyijMrXLuwSbgfSeBLjHe99C4IR11Q2DV7R5qktVTwSx0Dg2kdMosx35/FfwQ==",
|
|
4077
4077
|
"license": "(Apache-2.0 AND MIT)",
|
|
4078
4078
|
"dependencies": {
|
|
4079
4079
|
"@posthog/browser-common": "^0.6.0",
|
|
4080
|
-
"@posthog/core": "^1.
|
|
4080
|
+
"@posthog/core": "^1.49.0",
|
|
4081
4081
|
"@posthog/types": "^1.407.0",
|
|
4082
4082
|
"core-js": "^3.49.0",
|
|
4083
4083
|
"dompurify": "^3.4.13",
|
|
@@ -5056,9 +5056,9 @@
|
|
|
5056
5056
|
}
|
|
5057
5057
|
},
|
|
5058
5058
|
"node_modules/terser": {
|
|
5059
|
-
"version": "5.51.
|
|
5060
|
-
"resolved": "https://registry.npmjs.org/terser/-/terser-5.51.
|
|
5061
|
-
"integrity": "sha512-
|
|
5059
|
+
"version": "5.51.2",
|
|
5060
|
+
"resolved": "https://registry.npmjs.org/terser/-/terser-5.51.2.tgz",
|
|
5061
|
+
"integrity": "sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==",
|
|
5062
5062
|
"license": "BSD-2-Clause",
|
|
5063
5063
|
"peer": true,
|
|
5064
5064
|
"dependencies": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gogitcms/editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "Terminal UI for setting up and running the Go·Git CMS content editor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@gogitcms/frontend": "workspace:*"
|
|
66
66
|
},
|
|
67
67
|
"optionalDependencies": {
|
|
68
|
-
"@gogitcms/gitcms-local-darwin-arm64": "0.
|
|
69
|
-
"@gogitcms/gitcms-local-darwin-x64": "0.
|
|
70
|
-
"@gogitcms/gitcms-local-linux-arm64": "0.
|
|
71
|
-
"@gogitcms/gitcms-local-linux-x64": "0.
|
|
72
|
-
"@gogitcms/gitcms-local-win32-x64": "0.
|
|
68
|
+
"@gogitcms/gitcms-local-darwin-arm64": "0.26.0",
|
|
69
|
+
"@gogitcms/gitcms-local-darwin-x64": "0.26.0",
|
|
70
|
+
"@gogitcms/gitcms-local-linux-arm64": "0.26.0",
|
|
71
|
+
"@gogitcms/gitcms-local-linux-x64": "0.26.0",
|
|
72
|
+
"@gogitcms/gitcms-local-win32-x64": "0.26.0"
|
|
73
73
|
}
|
|
74
74
|
}
|