castle-web-cli 0.4.145 → 0.4.147

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.
@@ -207,7 +207,12 @@ export function SingleEditor({ path, editor, editorModule }) {
207
207
  // in which case the write lands on the fork. Lock the UI to match so an editor
208
208
  // doesn't collect keystrokes / clicks that can never be saved.
209
209
  const forkedPaths = useForkedPaths();
210
- const isWritable = (p) => !isImportedFile(p) || forkedPaths.has(p);
210
+ // A viewer looking at a published deck's source has nowhere to write at all --
211
+ // no serve, no working copy. The host page says so before this bundle runs, so
212
+ // it folds into the same predicate rather than becoming a second notion of
213
+ // read-only.
214
+ const viewerOnly = typeof window !== 'undefined' && window.__castleReadOnly === true;
215
+ const isWritable = (p) => !viewerOnly && (!isImportedFile(p) || forkedPaths.has(p));
211
216
  const readOnly = !isWritable(path);
212
217
  const { schedule, hasPending, saveState } = useFileSaver(isWritable);
213
218
  // Live deck files; our own in-flight (debounced, unsaved) edits win over the
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "../../sdk": {
34
34
  "name": "castle-web-sdk",
35
- "version": "0.4.15",
35
+ "version": "0.4.18",
36
36
  "devDependencies": {
37
37
  "eslint": "^9.0.0",
38
38
  "jscpd": "^4.0.5",
@@ -72,5 +72,5 @@
72
72
  "autoUpdateWhenImported": true,
73
73
  "deckId": "JH0SclbPVP0y",
74
74
  "cardId": "eXfAaUdbSU5A",
75
- "publishedVersion": "2026-08-25T17:58:41.575Z"
75
+ "publishedVersion": "2026-08-27T18:04:56.551Z"
76
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "castle-web-cli",
3
- "version": "0.4.145",
3
+ "version": "0.4.147",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "castle-web": "./dist/index.js"