canopycms 0.2.0 → 0.3.1

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +213 -41
  2. package/dist/api/branch.d.ts +2 -2
  3. package/dist/api/branch.js +4 -31
  4. package/dist/authorization/branch.js +3 -4
  5. package/dist/cli/cli.js +0 -18
  6. package/dist/cli/generate-ai-content.js +0 -6
  7. package/dist/cli/init.js +0 -6
  8. package/dist/editor/BranchManager.d.ts +2 -0
  9. package/dist/editor/BranchManager.js +3 -3
  10. package/dist/editor/Editor.js +253 -128
  11. package/dist/editor/EntryNavigator.d.ts +44 -9
  12. package/dist/editor/EntryNavigator.js +275 -103
  13. package/dist/editor/branch-lock.d.ts +42 -0
  14. package/dist/editor/branch-lock.js +79 -0
  15. package/dist/editor/branch-status.d.ts +0 -6
  16. package/dist/editor/branch-status.js +0 -10
  17. package/dist/editor/components/BranchNotAvailableNotice.d.ts +11 -0
  18. package/dist/editor/components/BranchNotAvailableNotice.js +10 -0
  19. package/dist/editor/components/BranchPill.d.ts +3 -18
  20. package/dist/editor/components/BranchPill.js +7 -10
  21. package/dist/editor/components/EditorHeader.d.ts +24 -52
  22. package/dist/editor/components/EditorHeader.js +151 -71
  23. package/dist/editor/components/EditorRail.d.ts +8 -8
  24. package/dist/editor/components/EditorRail.js +7 -5
  25. package/dist/editor/components/EntryBreadcrumb.d.ts +5 -1
  26. package/dist/editor/components/EntryBreadcrumb.js +3 -3
  27. package/dist/editor/components/EntryHeader.d.ts +60 -0
  28. package/dist/editor/components/EntryHeader.js +45 -0
  29. package/dist/editor/components/EntrySaveButton.d.ts +24 -0
  30. package/dist/editor/components/EntrySaveButton.js +101 -0
  31. package/dist/editor/components/NoEditPermissionNotice.d.ts +1 -1
  32. package/dist/editor/components/NoEditPermissionNotice.js +1 -1
  33. package/dist/editor/components/RetryToastMessage.d.ts +3 -1
  34. package/dist/editor/components/RetryToastMessage.js +8 -4
  35. package/dist/editor/components/SaveAllButton.d.ts +25 -0
  36. package/dist/editor/components/SaveAllButton.js +81 -0
  37. package/dist/editor/components/UnsavedMark.d.ts +1 -1
  38. package/dist/editor/components/UnsavedMark.js +1 -1
  39. package/dist/editor/components/index.d.ts +1 -1
  40. package/dist/editor/components/index.js +1 -1
  41. package/dist/editor/copy.d.ts +0 -1
  42. package/dist/editor/copy.js +0 -1
  43. package/dist/editor/editor-utils.d.ts +2 -2
  44. package/dist/editor/editor-utils.js +2 -2
  45. package/dist/editor/entry-search.d.ts +10 -16
  46. package/dist/editor/entry-search.js +4 -24
  47. package/dist/editor/hooks/useBranchManager.d.ts +7 -3
  48. package/dist/editor/hooks/useBranchManager.js +13 -9
  49. package/dist/editor/hooks/useEntryManager.d.ts +3 -0
  50. package/dist/editor/hooks/useEntryManager.js +10 -3
  51. package/dist/editor/shell/ActivityRail.d.ts +4 -0
  52. package/dist/editor/shell/ActivityRail.js +13 -4
  53. package/dist/editor/shell/EditorShell.d.ts +6 -7
  54. package/dist/editor/shell/EditorShell.js +9 -13
  55. package/dist/editor/shell/PaneLayout.d.ts +1 -0
  56. package/dist/editor/shell/PaneLayout.js +23 -5
  57. package/dist/editor/shell/SidePanelHost.d.ts +11 -4
  58. package/dist/editor/shell/SidePanelHost.js +95 -7
  59. package/dist/editor/shell/TopBar.d.ts +4 -4
  60. package/dist/editor/shell/TopBar.js +6 -3
  61. package/dist/editor/utils/focus-return.d.ts +10 -2
  62. package/dist/editor/utils/focus-return.js +40 -6
  63. package/dist/operating-mode/client-safe-strategy.d.ts +1 -6
  64. package/dist/operating-mode/client-safe-strategy.js +1 -10
  65. package/dist/operating-mode/types.d.ts +0 -3
  66. package/dist/version.d.ts +1 -1
  67. package/dist/version.js +1 -1
  68. package/package.json +1 -1
  69. package/dist/editor/components/BranchLockBanner.d.ts +0 -23
  70. package/dist/editor/components/BranchLockBanner.js +0 -66
  71. package/dist/editor/components/QuickOpenPalette.d.ts +0 -28
  72. package/dist/editor/components/QuickOpenPalette.js +0 -71
  73. package/dist/editor/components/SaveSplitButton.d.ts +0 -31
  74. package/dist/editor/components/SaveSplitButton.js +0 -121
@@ -9,8 +9,10 @@ export interface EntryNavItem {
9
9
  title?: string;
10
10
  /** Matched by the filter; the last segment of `path` when absent. */
11
11
  slug?: string;
12
- /** The row's second line: the entry's type, or "Missing" (`entryStatusLabel`). */
12
+ /** The entry's type, or "Missing" (`entryStatusLabel`): its second line, with `route`. */
13
13
  status?: string;
14
+ /** The entry's route (`buildPreviewRoute`); its second line omits it when `noPage` or `missing`. */
15
+ route?: string;
14
16
  /** The entry's file is gone: its second line is error text. */
15
17
  missing?: boolean;
16
18
  /** The entry has no page on the site, so its menu changes its slug rather than its URL. */
@@ -75,16 +77,49 @@ export interface EntryNavigatorProps {
75
77
  readOnlyReason?: string;
76
78
  /** Entry paths with unsaved changes; each shows a dot, and so does every collection holding one. */
77
79
  dirtyPaths?: ReadonlySet<string>;
78
- /**
79
- * A collection to bring into view: any filter clears, its ancestors and itself expand, and its
80
- * row takes focus. `seq` makes a repeat ask for the same collection a new one.
81
- */
82
- revealCollection?: {
80
+ /** A row to bring into view, or (`changed`) the unsaved entries; `onRevealed` once done. */
81
+ reveal?: ContentPanelReveal;
82
+ /** The reveal is done, or its row is not in the tree. */
83
+ onRevealed?: () => void;
84
+ /** The All / Changed control shows only with this; Changed lists the entries in `dirtyPaths`. */
85
+ onChangedOnlyChange?: (changedOnly: boolean) => void;
86
+ changedOnly?: boolean;
87
+ /** Entries with unsaved changes, counting drafts whose entries the tree doesn't list yet. */
88
+ unsavedCount?: number;
89
+ /** The named unsaved entries; Changed offers any the tree has no row for beneath it. */
90
+ unsavedEntries?: ReadonlyArray<{
83
91
  path: string;
84
- seq: number;
92
+ label: string;
93
+ }>;
94
+ /** The branch's entry list failed to load, so Changed can't name what is unsaved. */
95
+ entryListFailed?: boolean;
96
+ /** The bar's "Not available" row: an empty tree says so, with `onSwitchBranch`, not "No content". */
97
+ branchNotAvailable?: boolean;
98
+ onSwitchBranch?: () => void;
99
+ /** Takes Enter's first match in the filter in place of `onSelect`. */
100
+ onFilterEnter?: (path: string) => void;
101
+ /** Escape in the empty filter. Without it, Escape there does nothing here. */
102
+ onFilterEscape?: () => void;
103
+ onRowMenuOpen?: () => void;
104
+ filterRef?: React.Ref<HTMLInputElement>;
105
+ /** The shortcut that focuses the filter, as the platform writes it ("⌘P") and for `aria-keyshortcuts`. */
106
+ filterShortcut?: {
107
+ label: string;
108
+ keys: string;
85
109
  };
86
- /** The reveal is done, or its collection is not in the tree. */
87
- onRevealed?: () => void;
88
110
  }
111
+ /**
112
+ * A collection or entry reveal clears the query, switches Changed back to All, expands the row's
113
+ * ancestors (and a collection itself) and focuses the row. A `changed` reveal clears the query
114
+ * only, for Changed set alongside it. `seq` makes a repeat ask a new one.
115
+ */
116
+ export type ContentPanelReveal = {
117
+ kind: 'collection' | 'entry';
118
+ path: string;
119
+ seq: number;
120
+ } | {
121
+ kind: 'changed';
122
+ seq: number;
123
+ };
89
124
  export declare const EntryNavigator: React.FC<EntryNavigatorProps>;
90
125
  export default EntryNavigator;