canopycms 0.3.0 → 0.3.2
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.
- package/CHANGELOG.md +66 -41
- package/dist/api/branch.js +4 -31
- package/dist/authorization/branch.js +3 -4
- package/dist/editor/components/EntryHeader.js +2 -3
- package/dist/editor/shell/EditorShell.d.ts +3 -1
- package/dist/editor/shell/EditorShell.js +3 -1
- package/dist/editor/shell/OverlayHeader.js +4 -4
- package/dist/editor/shell/SidePanelHost.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,9 +5,9 @@ packages release together, at one version.
|
|
|
5
5
|
|
|
6
6
|
## This build
|
|
7
7
|
|
|
8
|
-
Version `0.3.
|
|
8
|
+
Version `0.3.2`, built from [`cb2de67`](https://github.com/safeinsights/canopycms/tree/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d).
|
|
9
9
|
|
|
10
|
-
Its entries are [0.3.
|
|
10
|
+
Its entries are [0.3.2](#032), under **Released**.
|
|
11
11
|
|
|
12
12
|
If you upgraded from a build on another branch, compare the `<!-- changeset: … -->` slugs in your previous build's `CHANGELOG.md` (`npm pack canopycms@<old>` fetches it) with this one's: entries whose slug your old file lacks are new to you.
|
|
13
13
|
|
|
@@ -24,7 +24,7 @@ Each entry has up to three parts:
|
|
|
24
24
|
`node_modules/canopycms/CHANGELOG.md`, assembled for that build: its **This build** section lists
|
|
25
25
|
what is new since the previous int on the same branch, or on a stable release links its entries, and its links point at the commit the build
|
|
26
26
|
came from. The copy in the repository holds released history and the entries from before changesets;
|
|
27
|
-
every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/
|
|
27
|
+
every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/.changeset/README.md) until a stable release
|
|
28
28
|
moves it here.
|
|
29
29
|
|
|
30
30
|
**Find your starting point.** From a stable pin, start at the first version under **Released**
|
|
@@ -62,6 +62,31 @@ entries under **Released**.
|
|
|
62
62
|
|
|
63
63
|
## Released
|
|
64
64
|
|
|
65
|
+
### 0.3.2
|
|
66
|
+
|
|
67
|
+
#### The content panel's header lines up with the entry header
|
|
68
|
+
|
|
69
|
+
<!-- changeset: shell-header-heights -->
|
|
70
|
+
|
|
71
|
+
_First in 0.3.2._
|
|
72
|
+
|
|
73
|
+
**What changed.** The content panel's header and the entry header beside it now share one fixed
|
|
74
|
+
height, so their bottom borders line up whatever the height of the controls inside each.
|
|
75
|
+
|
|
76
|
+
### 0.3.1
|
|
77
|
+
|
|
78
|
+
#### The branch list shows exactly the branches you can open
|
|
79
|
+
|
|
80
|
+
<!-- changeset: branch-list-follows-access-check -->
|
|
81
|
+
|
|
82
|
+
_First in 0.3.1._
|
|
83
|
+
|
|
84
|
+
**What changed.** The branch list now includes a branch only when branch access grants it, so
|
|
85
|
+
the two can no longer disagree. Under `defaultBranchAccess: 'allow'`, a colleague's branch with
|
|
86
|
+
no ACL now appears in your list, and opening it no longer shows "Not available · read-only" with
|
|
87
|
+
Save locked while its content loads. A branch whose explicit ACL leaves out its own creator no
|
|
88
|
+
longer appears in that creator's list, matching the access check that already refused them.
|
|
89
|
+
|
|
65
90
|
### 0.3.0
|
|
66
91
|
|
|
67
92
|
#### The branch bar's tooltips open beside their controls
|
|
@@ -430,7 +455,7 @@ URL.
|
|
|
430
455
|
2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
|
|
431
456
|
`app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
|
|
432
457
|
route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
|
|
433
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
458
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#live-preview)).
|
|
434
459
|
3. A test reading view content from the route's server HTML must load the page in a browser.
|
|
435
460
|
Server output rendered during a preview request carries the signed-in asset prefix; keep it out
|
|
436
461
|
of cross-request caches (`unstable_cache`, module memos).
|
|
@@ -445,7 +470,7 @@ kept site styles ahead of Mantine's in the preview.
|
|
|
445
470
|
server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
|
|
446
471
|
path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
|
|
447
472
|
refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
|
|
448
|
-
[Live Preview](https://github.com/safeinsights/canopycms/blob/
|
|
473
|
+
[Live Preview](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#live-preview).
|
|
449
474
|
|
|
450
475
|
**To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
|
|
451
476
|
as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
|
|
@@ -527,7 +552,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
|
|
|
527
552
|
fields are nested or renamed, pass the AI config's `seo` the same object you pass
|
|
528
553
|
`createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
|
|
529
554
|
place. A field that links to a hidden section by plain URL needs a field transform; the README
|
|
530
|
-
shows [the recipe](https://github.com/safeinsights/canopycms/blob/
|
|
555
|
+
shows [the recipe](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#ai-content-configuration).
|
|
531
556
|
|
|
532
557
|
**Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
|
|
533
558
|
|
|
@@ -549,7 +574,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
|
|
|
549
574
|
field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
|
|
550
575
|
`MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
|
|
551
576
|
`{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
|
|
552
|
-
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/
|
|
577
|
+
[MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#mdx-content-cannot-run-code).
|
|
553
578
|
|
|
554
579
|
**To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
|
|
555
580
|
`mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
|
|
@@ -686,7 +711,7 @@ a format check.
|
|
|
686
711
|
|
|
687
712
|
- (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
|
|
688
713
|
re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
|
|
689
|
-
([reference](https://github.com/safeinsights/canopycms/blob/
|
|
714
|
+
([reference](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#definecanopyconfig-options)).
|
|
690
715
|
- (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
|
|
691
716
|
the PR-body section every user who edited the branch, not only the submitter; settings commits
|
|
692
717
|
(permissions, groups) carry the acting user's trailer.
|
|
@@ -710,7 +735,7 @@ saves only push the branch, and no failing PR task lands in System health.
|
|
|
710
735
|
that entry type goes unavailable: the editor says so, and its entries answer 503 with
|
|
711
736
|
`code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
|
|
712
737
|
worker holds the base branch for up to 30 minutes while that lasts; see
|
|
713
|
-
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/
|
|
738
|
+
[New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
|
|
714
739
|
Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
|
|
715
740
|
`ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
|
|
716
741
|
|
|
@@ -748,7 +773,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
|
|
|
748
773
|
new stack needs no steps.
|
|
749
774
|
|
|
750
775
|
**What changed.** (int.109) Detailed in
|
|
751
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
776
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
|
|
752
777
|
bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
|
|
753
778
|
refusing clients without TLS or IAM, replacing the worker's
|
|
754
779
|
`AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
|
|
@@ -802,10 +827,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
|
|
|
802
827
|
with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
|
|
803
828
|
unchanged.
|
|
804
829
|
- `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
|
|
805
|
-
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/
|
|
830
|
+
[Worker-down alarm](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#worker-down-alarm).
|
|
806
831
|
|
|
807
832
|
**To adopt.** Optional. For parameter-only change sets, see
|
|
808
|
-
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/
|
|
833
|
+
[Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
|
|
809
834
|
`alarmTopic`.
|
|
810
835
|
|
|
811
836
|
**Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
|
|
@@ -816,7 +841,7 @@ worker, and a hand-built alarm on the worker log group.
|
|
|
816
841
|
**What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
|
|
817
842
|
swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
|
|
818
843
|
`alarmTopic` if set; a retried step names itself when it gives up. See
|
|
819
|
-
[The worker instance](https://github.com/safeinsights/canopycms/blob/
|
|
844
|
+
[The worker instance](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#the-worker-instance).
|
|
820
845
|
|
|
821
846
|
**To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
|
|
822
847
|
not Template first and the worker contract stays at 1.
|
|
@@ -882,7 +907,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
|
|
|
882
907
|
|
|
883
908
|
**To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
|
|
884
909
|
mirror, so the root volume needs room for two
|
|
885
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
910
|
+
([details](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#the-worker-instance)).
|
|
886
911
|
|
|
887
912
|
#### The worker follows a rebased or deleted GitHub branch
|
|
888
913
|
|
|
@@ -904,7 +929,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
|
|
|
904
929
|
bundle-only roll is safe.
|
|
905
930
|
|
|
906
931
|
**To adopt.** Parameter mode: gate bundle-only rolls on the contract
|
|
907
|
-
([recipe](https://github.com/safeinsights/canopycms/blob/
|
|
932
|
+
([recipe](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
|
|
908
933
|
`WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
|
|
909
934
|
copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
|
|
910
935
|
|
|
@@ -921,8 +946,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
|
|
|
921
946
|
template, then roll the bundle; on an older template it stops with `template too old for this
|
|
922
947
|
bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
|
|
923
948
|
takes `worker/`'s three units and `gateway.env.example`
|
|
924
|
-
([steps](https://github.com/safeinsights/canopycms/blob/
|
|
925
|
-
[checklist](https://github.com/safeinsights/canopycms/blob/
|
|
949
|
+
([steps](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
|
|
950
|
+
[checklist](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#first-deploy-checklist).
|
|
926
951
|
|
|
927
952
|
#### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
|
|
928
953
|
|
|
@@ -933,7 +958,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
|
|
|
933
958
|
`X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
|
|
934
959
|
its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
|
|
935
960
|
marked `noindex`. The editor's default preview is same-origin and unaffected. See
|
|
936
|
-
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/
|
|
961
|
+
[Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
|
|
937
962
|
|
|
938
963
|
**To adopt.** If you wired the Function URL into your own distribution by hand, delete those
|
|
939
964
|
behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
|
|
@@ -1109,7 +1134,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
|
|
|
1109
1134
|
**To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
|
|
1110
1135
|
apply the same rule here, for example `referenceLink: (target, { body }) =>
|
|
1111
1136
|
!body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
|
|
1112
|
-
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
1137
|
+
[AI Content Configuration](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#ai-content-configuration).
|
|
1113
1138
|
|
|
1114
1139
|
**Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
|
|
1115
1140
|
change its link.
|
|
@@ -1184,7 +1209,7 @@ _First in int.115._
|
|
|
1184
1209
|
entry the base branch also changed, the "updated on the base branch" notice and the branch's
|
|
1185
1210
|
conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
|
|
1186
1211
|
base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
|
|
1187
|
-
and Unpublishing](https://github.com/safeinsights/canopycms/blob/
|
|
1212
|
+
and Unpublishing](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#drafts-and-unpublishing) section covers long-lived branches and
|
|
1188
1213
|
unpublishing.
|
|
1189
1214
|
|
|
1190
1215
|
#### The editor calls the content drawer "All content"
|
|
@@ -1496,7 +1521,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
|
|
|
1496
1521
|
The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
|
|
1497
1522
|
|
|
1498
1523
|
**To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
|
|
1499
|
-
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/
|
|
1524
|
+
`{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#stamping-a-publication-date).
|
|
1500
1525
|
|
|
1501
1526
|
**Now deletable.** A build step or hook that writes a missing publication date into new entries.
|
|
1502
1527
|
|
|
@@ -1543,7 +1568,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
|
|
|
1543
1568
|
stored at, and `react-split-pane` is no longer a dependency.
|
|
1544
1569
|
`EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
|
|
1545
1570
|
no longer exported from `canopycms/client`. See
|
|
1546
|
-
[Your root layout](https://github.com/safeinsights/canopycms/blob/
|
|
1571
|
+
[Your root layout](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#editor-customization).
|
|
1547
1572
|
|
|
1548
1573
|
**To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
|
|
1549
1574
|
instead, which lays out its own panes. Hiding your site chrome on the editor route is now
|
|
@@ -1654,7 +1679,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
|
|
|
1654
1679
|
**To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
|
|
1655
1680
|
`ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
|
|
1656
1681
|
own pages, mount the hook as in
|
|
1657
|
-
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/
|
|
1682
|
+
[Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
|
|
1658
1683
|
Your own Server Actions in the CMS build still 403 behind OAC.
|
|
1659
1684
|
|
|
1660
1685
|
**Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
|
|
@@ -1695,12 +1720,12 @@ fast naming the ARN, the field and the keys present, never a value.
|
|
|
1695
1720
|
**To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
|
|
1696
1721
|
prop. The scaffolded stack fills them from the repository _variables_
|
|
1697
1722
|
`CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
|
|
1698
|
-
([why the prefix](https://github.com/safeinsights/canopycms/blob/
|
|
1723
|
+
([why the prefix](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
|
|
1699
1724
|
adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
|
|
1700
1725
|
lines to `.github/workflows/deploy-cms.yml`, or re-runs the generator and diffs. `cdk synth` refuses a `…JsonField` prop without its `…SecretArn`, and an ARN carrying the ECS `:KEY::` suffix
|
|
1701
1726
|
(also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
|
|
1702
1727
|
resource's configuration, readable by anyone who can describe it. Only `CLERK_SECRET_KEY` goes through Secrets Manager; `CLERK_JWT_KEY` and the publishable
|
|
1703
|
-
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
1728
|
+
key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#security-model)).
|
|
1704
1729
|
|
|
1705
1730
|
**Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
|
|
1706
1731
|
worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
|
|
@@ -1712,7 +1737,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
|
|
|
1712
1737
|
`githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
|
|
1713
1738
|
nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
|
|
1714
1739
|
anyone holding an App's key can mint a token for any of its installations
|
|
1715
|
-
([why](https://github.com/safeinsights/canopycms/blob/
|
|
1740
|
+
([why](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
|
|
1716
1741
|
|
|
1717
1742
|
**To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
|
|
1718
1743
|
`githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
|
|
@@ -1725,7 +1750,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
1725
1750
|
`verify` checks an existing installation's permissions: run it, since an App missing a
|
|
1726
1751
|
permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
|
|
1727
1752
|
never edits an existing JSON secret (create one and point the JSON-field prop at it)
|
|
1728
|
-
([details](https://github.com/safeinsights/canopycms/blob/
|
|
1753
|
+
([details](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
|
|
1729
1754
|
2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
|
|
1730
1755
|
of the three is refused at synth, and so is an App alongside a token.
|
|
1731
1756
|
3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
|
|
@@ -1736,7 +1761,7 @@ anyone holding an App's key can mint a token for any of its installations
|
|
|
1736
1761
|
|
|
1737
1762
|
The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
|
|
1738
1763
|
IAM policy automatically, so you need not add it to `secretsArns`. See
|
|
1739
|
-
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/
|
|
1764
|
+
[Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#authenticating-as-a-github-app).
|
|
1740
1765
|
|
|
1741
1766
|
```bash
|
|
1742
1767
|
canopycms init-github-app create -- \
|
|
@@ -1784,7 +1809,7 @@ downloads the `.pem` from the App's settings page.
|
|
|
1784
1809
|
|
|
1785
1810
|
**What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
|
|
1786
1811
|
key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
|
|
1787
|
-
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/
|
|
1812
|
+
[Rotating a secret](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#rotating-a-secret).
|
|
1788
1813
|
|
|
1789
1814
|
**To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
|
|
1790
1815
|
GitHub App private key is still read only at boot: store the new key, replace the instance, and
|
|
@@ -1838,12 +1863,12 @@ also check the bucket policy for its grant.
|
|
|
1838
1863
|
5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
|
|
1839
1864
|
Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
|
|
1840
1865
|
`webpack` and it can read your Next version. A webpack build still fails its image transforms
|
|
1841
|
-
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/
|
|
1866
|
+
([Dual Build Support](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#dual-build-support)).
|
|
1842
1867
|
|
|
1843
1868
|
**Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
|
|
1844
1869
|
function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
|
|
1845
1870
|
function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
|
|
1846
|
-
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/
|
|
1871
|
+
on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#where-the-image-is-built)).
|
|
1847
1872
|
|
|
1848
1873
|
**To adopt.**
|
|
1849
1874
|
|
|
@@ -1872,7 +1897,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
|
|
|
1872
1897
|
|
|
1873
1898
|
**What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
|
|
1874
1899
|
replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
|
|
1875
|
-
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
1900
|
+
uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#media-configuration) for the
|
|
1876
1901
|
CloudFront behavior it expects.
|
|
1877
1902
|
|
|
1878
1903
|
**To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
|
|
@@ -1897,7 +1922,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
|
|
|
1897
1922
|
bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
|
|
1898
1923
|
`Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
|
|
1899
1924
|
`AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
|
|
1900
|
-
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/
|
|
1925
|
+
pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#cross-account-asset-bucket).
|
|
1901
1926
|
|
|
1902
1927
|
**To adopt.** Optional:
|
|
1903
1928
|
|
|
@@ -2007,7 +2032,7 @@ public JWKS PEM, used only to verify signatures.
|
|
|
2007
2032
|
to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
|
|
2008
2033
|
deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
|
|
2009
2034
|
`clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
|
|
2010
|
-
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/
|
|
2035
|
+
`clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/docs/deploying-to-aws.md#security-model)).
|
|
2011
2036
|
|
|
2012
2037
|
#### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
|
|
2013
2038
|
|
|
@@ -2106,7 +2131,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
|
|
|
2106
2131
|
Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
|
|
2107
2132
|
no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
|
|
2108
2133
|
`AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
|
|
2109
|
-
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/
|
|
2134
|
+
is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#media-configuration)). Two traps:
|
|
2110
2135
|
|
|
2111
2136
|
- Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
|
|
2112
2137
|
a nested route prefix and emits zero params, building green.
|
|
@@ -2265,7 +2290,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
|
|
|
2265
2290
|
`withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
|
|
2266
2291
|
`canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
|
|
2267
2292
|
`createNextCanopyContext`'s result. See
|
|
2268
|
-
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/
|
|
2293
|
+
[Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#sitemap-and-seo-metadata). Every routable entry type is in
|
|
2269
2294
|
the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
|
|
2270
2295
|
sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
|
|
2271
2296
|
filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
|
|
@@ -2322,7 +2347,7 @@ underscore-prefixed files are skipped.
|
|
|
2322
2347
|
|
|
2323
2348
|
**What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
|
|
2324
2349
|
`defaultPathAccess: { read: 'allow' }`
|
|
2325
|
-
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/
|
|
2350
|
+
([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#public-read-on-server-deployments)).
|
|
2326
2351
|
|
|
2327
2352
|
**To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
|
|
2328
2353
|
consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
|
|
@@ -2375,7 +2400,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
|
|
|
2375
2400
|
**What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
|
|
2376
2401
|
gives one template's value type) requires exactly
|
|
2377
2402
|
one component per block template name when written as an object literal. See
|
|
2378
|
-
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/
|
|
2403
|
+
[Block Component Registries](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#block-component-registries) and
|
|
2379
2404
|
`apps/example1/app/components/PostView.tsx`.
|
|
2380
2405
|
|
|
2381
2406
|
```ts
|
|
@@ -2397,7 +2422,7 @@ templates against the schema.
|
|
|
2397
2422
|
|
|
2398
2423
|
**What changed.** Spreading a `const` field array into several schemas, and nesting
|
|
2399
2424
|
`defineInlineFieldGroup()` inside a block template, are documented
|
|
2400
|
-
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/
|
|
2425
|
+
([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
|
|
2401
2426
|
identity helper for them.
|
|
2402
2427
|
|
|
2403
2428
|
```ts
|
|
@@ -2416,7 +2441,7 @@ field by composing from the same `const` field object.
|
|
|
2416
2441
|
A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
|
|
2417
2442
|
it, and listings do with
|
|
2418
2443
|
[`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
|
|
2419
|
-
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/
|
|
2444
|
+
(0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#shared--referenced-blocks).
|
|
2420
2445
|
|
|
2421
2446
|
**Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
|
|
2422
2447
|
|
|
@@ -2438,7 +2463,7 @@ Not retro-documented, apart from these:
|
|
|
2438
2463
|
|
|
2439
2464
|
#### The registry is keyed by entry-type name (0.0.42)
|
|
2440
2465
|
|
|
2441
|
-
**What changed.** `createEntrySchemaRegistry` keys are the entry-type names that `.collection.json` files name in `entry.schema`, and `EntryTypesFromRegistry` derives the typed entry-type map from them. Schema-variable keys (`{ postSchema }`) still work but derive nothing; [README's registry convention](https://github.com/safeinsights/canopycms/blob/
|
|
2466
|
+
**What changed.** `createEntrySchemaRegistry` keys are the entry-type names that `.collection.json` files name in `entry.schema`, and `EntryTypesFromRegistry` derives the typed entry-type map from them. Schema-variable keys (`{ postSchema }`) still work but derive nothing; [README's registry convention](https://github.com/safeinsights/canopycms/blob/cb2de67d9d4750e462d2cbb636433dfb0ba2d34d/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
|
|
2442
2467
|
|
|
2443
2468
|
**To adopt.**
|
|
2444
2469
|
|
package/dist/api/branch.js
CHANGED
|
@@ -34,7 +34,7 @@ const updateBranchAccessBodySchema = z.object({
|
|
|
34
34
|
allowedUsers: z.array(z.string()).optional(),
|
|
35
35
|
allowedGroups: z.array(z.string()).optional(),
|
|
36
36
|
});
|
|
37
|
-
import { isPrivileged, isAdmin,
|
|
37
|
+
import { isPrivileged, isAdmin, loadPathPermissions, getBranchProtection, getBranchWriteProtection, } from '../authorization/index.js';
|
|
38
38
|
import { operatingStrategy } from '../operating-mode/index.js';
|
|
39
39
|
/**
|
|
40
40
|
* Returns true if:
|
|
@@ -405,36 +405,9 @@ export const listBranchesHandler = async (ctx, req) => {
|
|
|
405
405
|
// editor matches defaultBranch against registry names, so return the form
|
|
406
406
|
// that can actually be found there.
|
|
407
407
|
const defaultBranch = sanitizeBranchName(ctx.services.config.defaultActiveBranch ?? baseBranchOf(ctx.services.config));
|
|
408
|
-
//
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
}
|
|
412
|
-
// Regular users see the base branch and the branches they created or were given access to
|
|
413
|
-
const visibleBranches = allBranches.filter((context) => {
|
|
414
|
-
const branch = context.branch;
|
|
415
|
-
// Ahead of every grant below, as in checkBranchAccessWithDefault.
|
|
416
|
-
if (isLockedOutOfBranch(branch.access, req.user.groups)) {
|
|
417
|
-
return false;
|
|
418
|
-
}
|
|
419
|
-
// The protected base branch is where every user lands by default; always
|
|
420
|
-
// show it (read-only) so the editor can render its protected state.
|
|
421
|
-
if (getBranchProtection(ctx.services.config, branch.name, branch.baseBranch).isProtected) {
|
|
422
|
-
return true;
|
|
423
|
-
}
|
|
424
|
-
// User created the branch
|
|
425
|
-
if (branch.createdBy === req.user.userId) {
|
|
426
|
-
return true;
|
|
427
|
-
}
|
|
428
|
-
// User is in allowedUsers
|
|
429
|
-
if (branch.access?.allowedUsers?.includes(req.user.userId)) {
|
|
430
|
-
return true;
|
|
431
|
-
}
|
|
432
|
-
// User's group is in allowedGroups
|
|
433
|
-
if (branch.access?.allowedGroups?.some((groupId) => req.user.groups?.includes(groupId))) {
|
|
434
|
-
return true;
|
|
435
|
-
}
|
|
436
|
-
return false;
|
|
437
|
-
});
|
|
408
|
+
// The access check is the rule: the list shows exactly the branches it grants, so the editor
|
|
409
|
+
// never lists a branch it cannot open, nor leaves out one it can.
|
|
410
|
+
const visibleBranches = allBranches.filter((context) => ctx.services.checkBranchAccess(context, req.user).allowed);
|
|
438
411
|
return branchListResponse(ctx, req, visibleBranches, defaultBranch);
|
|
439
412
|
};
|
|
440
413
|
/**
|
|
@@ -25,10 +25,9 @@ export function checkBranchAccessWithDefault(context, user, defaultAccess = 'den
|
|
|
25
25
|
const hasUserConstraint = !!access.allowedUsers?.length;
|
|
26
26
|
const hasGroupConstraint = !!access.allowedGroups?.length;
|
|
27
27
|
if (!hasUserConstraint && !hasGroupConstraint) {
|
|
28
|
-
// The branch creator owns their own un-ACL'd branch, as
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
// read a file on it. Scoped to the no-ACL case on purpose -- an EXPLICIT
|
|
28
|
+
// The branch creator owns their own un-ACL'd branch, as canDeleteBranch and
|
|
29
|
+
// canModifyBranchAccess also grant: without it, under 'deny' a creator could
|
|
30
|
+
// delete their branch and rewrite its ACL but not read a file on it. Scoped to the no-ACL case on purpose -- an EXPLICIT
|
|
32
31
|
// allowlist omitting the creator still denies them, which is how an admin
|
|
33
32
|
// locks down a branch someone else created.
|
|
34
33
|
if (context.branch.createdBy === user.userId) {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Box, Group } from '@mantine/core';
|
|
4
|
-
import { SHELL_REGION_BORDER } from '../shell/EditorShell.js';
|
|
4
|
+
import { SHELL_HEADER_HEIGHT, SHELL_REGION_BORDER } from '../shell/EditorShell.js';
|
|
5
5
|
import { describeBranchLock } from '../branch-lock.js';
|
|
6
6
|
import { EntryBreadcrumb } from './EntryBreadcrumb.js';
|
|
7
7
|
import { EntrySaveButton } from './EntrySaveButton.js';
|
|
8
|
-
const ENTRY_HEADER_HEIGHT = 48;
|
|
9
8
|
/** The open entry's breadcrumb, menu, unsaved dot and "Read-only" chip, then Save, over the panes. */
|
|
10
9
|
export function EntryHeader({ currentEntry, entryLoading = false, branchName, busy, breadcrumbSegments, onCollectionOpen, onEntryReveal, navigatorToggleRef, onFileReload, onFileDiscardDraft, onEntryRename, onEntryDelete, onSave, saveAllRunning, saving = false, savedSignal, savedHere = false, hasUnsavedChanges, entryHasDraft = hasUnsavedChanges, draftStorageFailed = false, entryReadOnly = false, entryUnavailable = false, branchStatus, branchReadOnly = false, branchWriteBlocked = false, branchLoading = false, branchPending = false, branchMissing = false, }) {
|
|
11
10
|
const branchLockReason = describeBranchLock({
|
|
@@ -25,7 +24,7 @@ export function EntryHeader({ currentEntry, entryLoading = false, branchName, bu
|
|
|
25
24
|
: !currentEntry
|
|
26
25
|
? 'Open an entry to save it.'
|
|
27
26
|
: (entryLockReason ?? (!hasUnsavedChanges ? 'No changes to save.' : '')));
|
|
28
|
-
return (_jsxs(Group, { component: "section", "aria-label": "Entry", "data-testid": "entry-header", gap: "xs", wrap: "nowrap", justify: "space-between", px: "sm",
|
|
27
|
+
return (_jsxs(Group, { component: "section", "aria-label": "Entry", "data-testid": "entry-header", gap: "xs", wrap: "nowrap", justify: "space-between", px: "sm", h: SHELL_HEADER_HEIGHT, style: {
|
|
29
28
|
flexShrink: 0,
|
|
30
29
|
borderBottom: SHELL_REGION_BORDER,
|
|
31
30
|
background: 'var(--mantine-color-body)',
|
|
@@ -9,11 +9,13 @@ export interface EditorShellProps {
|
|
|
9
9
|
}
|
|
10
10
|
/** The line between two shell regions, as under the top bar. */
|
|
11
11
|
export declare const SHELL_REGION_BORDER = "1px solid var(--canopy-input-border)";
|
|
12
|
+
/** The content panel's header and the entry header, set outright so their bottom borders line up. */
|
|
13
|
+
export declare const SHELL_HEADER_HEIGHT = 49;
|
|
12
14
|
/**
|
|
13
15
|
* Every resizable divider in the shell, the panel's and the panes', shows this many pixels wide.
|
|
14
16
|
* Its pointer target is wider, `DIVIDER_TARGET_PX`. A finger's reaches 6px past each side of the
|
|
15
17
|
* bar: under the panes' separator, the narrow window's overlay panel keeps its header's close
|
|
16
|
-
* button clear, as that header
|
|
18
|
+
* button clear, as that header centres it 10px below its top.
|
|
17
19
|
*/
|
|
18
20
|
export declare const DIVIDER_WIDTH_PX = 4;
|
|
19
21
|
export declare const DIVIDER_TARGET_PX: {
|
|
@@ -6,11 +6,13 @@ import { RemoveScroll } from 'react-remove-scroll';
|
|
|
6
6
|
import { useHideHostChrome } from './host-chrome.js';
|
|
7
7
|
/** The line between two shell regions, as under the top bar. */
|
|
8
8
|
export const SHELL_REGION_BORDER = '1px solid var(--canopy-input-border)';
|
|
9
|
+
/** The content panel's header and the entry header, set outright so their bottom borders line up. */
|
|
10
|
+
export const SHELL_HEADER_HEIGHT = 49;
|
|
9
11
|
/**
|
|
10
12
|
* Every resizable divider in the shell, the panel's and the panes', shows this many pixels wide.
|
|
11
13
|
* Its pointer target is wider, `DIVIDER_TARGET_PX`. A finger's reaches 6px past each side of the
|
|
12
14
|
* bar: under the panes' separator, the narrow window's overlay panel keeps its header's close
|
|
13
|
-
* button clear, as that header
|
|
15
|
+
* button clear, as that header centres it 10px below its top.
|
|
14
16
|
*/
|
|
15
17
|
export const DIVIDER_WIDTH_PX = 4;
|
|
16
18
|
export const DIVIDER_TARGET_PX = { fine: 12, coarse: 16 };
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Drawer, Group } from '@mantine/core';
|
|
4
4
|
/**
|
|
5
|
-
* The header of every right-hand drawer,
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* The header of every right-hand drawer, ruled like the content panel's header: a 16px semibold
|
|
6
|
+
* title, a default-size close button and a 1px rule, its `xs` padding making `SHELL_HEADER_HEIGHT`.
|
|
7
|
+
* As the drawer's own `Drawer.Header`, its title labels the dialog and it stays pinned while the
|
|
8
|
+
* body scrolls.
|
|
9
9
|
*/
|
|
10
10
|
const OverlayHeader = ({ title, adornment, titleRef, titleTabIndex, }) => (_jsxs(Drawer.Header, { mih: 0, px: "md", py: "xs", style: { borderBlockEnd: '1px solid var(--canopy-input-border)' }, children: [_jsx(Drawer.Title, { ref: titleRef, tabIndex: titleTabIndex, fw: 600, fz: "md", miw: 0, children: _jsxs(Group, { component: "span", gap: "xs", wrap: "nowrap", children: [title, adornment] }) }), _jsx(Drawer.CloseButton, { "aria-label": "Close" })] }));
|
|
11
11
|
/**
|
|
@@ -4,7 +4,7 @@ import { useEffect, useId, useLayoutEffect, useRef, useState, } from 'react';
|
|
|
4
4
|
import { CloseButton, Group, Text, Tooltip, Transition } from '@mantine/core';
|
|
5
5
|
import { useReducedMotion, useWindowEvent } from '@mantine/hooks';
|
|
6
6
|
import { FOCUS_RETURN_ATTR, focusIfIdle } from '../utils/focus-return.js';
|
|
7
|
-
import { DIVIDER_COLOR, DIVIDER_TARGET_PX, DIVIDER_WIDTH_PX } from './EditorShell.js';
|
|
7
|
+
import { DIVIDER_COLOR, DIVIDER_TARGET_PX, DIVIDER_WIDTH_PX, SHELL_HEADER_HEIGHT, SHELL_REGION_BORDER, } from './EditorShell.js';
|
|
8
8
|
const KEY_STEP_PX = 16;
|
|
9
9
|
const RESIZING_ATTR = 'data-canopy-panel-resizing';
|
|
10
10
|
/** The drawers' slide: Mantine's `Transition` default. */
|
|
@@ -302,7 +302,7 @@ export function SidePanelHost({ title, mode, opened, width, minWidth, maxWidth,
|
|
|
302
302
|
}, onBlur: (event) => {
|
|
303
303
|
if (!event.currentTarget.contains(event.relatedTarget))
|
|
304
304
|
focusInside.current = false;
|
|
305
|
-
}, children: [_jsx("style", { children: PANEL_STYLES }), _jsxs(Group, { justify: "space-between", wrap: "nowrap", gap: "xs", px: "md",
|
|
305
|
+
}, children: [_jsx("style", { children: PANEL_STYLES }), _jsxs(Group, { justify: "space-between", wrap: "nowrap", gap: "xs", px: "md", h: SHELL_HEADER_HEIGHT, style: { flexShrink: 0, borderBlockEnd: SHELL_REGION_BORDER }, children: [_jsx(Text, { id: titleId, component: "h2", fw: 600, size: "md", m: 0, children: title }), _jsxs(Group, { gap: "xs", wrap: "nowrap", children: [actions, _jsx(Tooltip, { label: `Close ${title.toLowerCase()} panel`, children: _jsx(CloseButton, { "aria-label": `Close ${title.toLowerCase()} panel`, onClick: onClose }) })] })] }), _jsx("div", { style: { flex: 1, minHeight: 0, overflow: 'auto' }, children: children }), _jsx("div", { role: "separator", "aria-orientation": "vertical", "aria-label": `Resize ${title.toLowerCase()} panel`, "aria-controls": panelId, "aria-valuenow": Math.round(shownWidth), "aria-valuemin": minWidth, "aria-valuemax": maxWidth,
|
|
306
306
|
// A focusable separator is a window splitter, a widget; jsx-a11y counts every one static.
|
|
307
307
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
308
308
|
tabIndex: 0, className: "canopy-side-panel-separator", "data-dragging": dragWidth !== null || undefined, ...separatorHandlers })] })) })] }));
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CANOPYCMS_VERSION = "0.3.
|
|
1
|
+
export declare const CANOPYCMS_VERSION = "0.3.2";
|
package/dist/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Generated by scripts/bump-version.mjs, its only writer. The package builds with plain
|
|
2
2
|
// tsc (rootDir: src), so src/ cannot import ../package.json; version.test.ts keeps the two equal.
|
|
3
|
-
export const CANOPYCMS_VERSION = '0.3.
|
|
3
|
+
export const CANOPYCMS_VERSION = '0.3.2';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"//": "@codemirror/language, @lezer/highlight: workaround — @mdxeditor/editor uses cm6-theme-basic-light which peer-requires these but mdxeditor doesn't declare them as dependencies",
|
|
3
3
|
"name": "canopycms",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.2",
|
|
5
5
|
"description": "CanopyCMS core package: schema-driven content, branch-aware editing, and editor UI for Next.js.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|