Initial project upload

This commit is contained in:
Mohamed Mathar Irfan
2026-07-28 17:57:02 +05:30
commit ed6610d5d8
23919 changed files with 3003316 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