Skip to content

Commit 7c95836

Browse files
authored
Allow setting readOnly mode in Quick Editor (#6731)
1 parent ea60a52 commit 7c95836

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

.changeset/tall-needles-marry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/workers-editor-shared": patch
3+
---
4+
5+
chore: add readOnly property to WorkerLoaded event allowing us to put the editor into a read only state when loading a Worker.

packages/quick-edit-extension/src/cfs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ declare module "*.bin" {
198198
create: true,
199199
overwrite: true,
200200
suppressChannelUpdate: true,
201+
readOnly: files.readOnly,
201202
});
202203
}
203204
if (this.readRoot !== null) {

packages/quick-edit-extension/src/ipc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface WorkerLoaded {
1212
path: string;
1313
contents: Uint8Array;
1414
}[];
15+
readOnly?: boolean;
1516
}
1617

1718
// Sent when a user updates a file

packages/workers-editor-shared/lib/ipc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface WorkerLoaded {
1212
path: string;
1313
contents: Uint8Array;
1414
}[];
15+
readOnly?: boolean;
1516
}
1617

1718
// Sent when a user updates a file

0 commit comments

Comments
 (0)