First concept

This commit is contained in:
will
2026-04-02 19:13:46 +01:00
commit 1da5da43e1
9785 changed files with 2077949 additions and 0 deletions

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