initial commit. phase 1 complete

This commit is contained in:
2026-05-05 20:45:19 +02:00
parent d9c68313a0
commit 89e058ffac
20631 changed files with 3224610 additions and 43 deletions
+30
View File
@@ -0,0 +1,30 @@
import { staticGenerationAsyncStorage } from "./static-generation-async-storage.external";
import { trackDynamicDataAccessed } from "../../server/app-render/dynamic-rendering";
export class DraftMode {
get isEnabled() {
return this._provider.isEnabled;
}
enable() {
const store = staticGenerationAsyncStorage.getStore();
if (store) {
// We we have a store we want to track dynamic data access to ensure we
// don't statically generate routes that manipulate draft mode.
trackDynamicDataAccessed(store, "draftMode().enable()");
}
return this._provider.enable();
}
disable() {
const store = staticGenerationAsyncStorage.getStore();
if (store) {
// We we have a store we want to track dynamic data access to ensure we
// don't statically generate routes that manipulate draft mode.
trackDynamicDataAccessed(store, "draftMode().disable()");
}
return this._provider.disable();
}
constructor(provider){
this._provider = provider;
}
}
//# sourceMappingURL=draft-mode.js.map