Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sanity): content releases #7011

Draft
wants to merge 525 commits into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
525 commits
Select commit Hold shift + click to select a range
2193c5d
chore(structure): remove perspective from paneRouter (#7700)
pedrobonamin Oct 30, 2024
23986d6
fix(structure): update perspective param when creating a document in …
pedrobonamin Oct 30, 2024
d41e502
fix(core): disable eslint sanity import check
pedrobonamin Oct 30, 2024
aaee200
fix(structure): update pane heder create button
pedrobonamin Oct 30, 2024
0740e43
fix: workspace picker menu always uses default tone
jordanl17 Oct 30, 2024
bab7f63
refactor: type guard for draft perspective accepts string
jordanl17 Oct 30, 2024
44d6db4
Merge branch 'corel' of github.com:sanity-io/sanity into corel
jordanl17 Oct 30, 2024
551f03b
fix: adding minor padding to the empty state on releasesOverview
jordanl17 Oct 30, 2024
3f62333
fix: replacing the table with the placeholder when no releases
jordanl17 Oct 30, 2024
143fc17
feat: label with releaseType on dashboard
jordanl17 Oct 30, 2024
32de536
fix(core): update eslintrc, add ignored files
pedrobonamin Oct 30, 2024
b649a2b
feat: validation errors match prototype
jordanl17 Oct 30, 2024
f684bde
Merge branch 'corel' of github.com:sanity-io/sanity into corel
jordanl17 Oct 30, 2024
631db4d
fix(structure): render published title when perspective is published
pedrobonamin Oct 30, 2024
db5bb13
fix: resolving state update look due to unmemoized sticky params in u…
jordanl17 Oct 31, 2024
c7df229
fix: overflow menu uses default tone
jordanl17 Oct 31, 2024
c30f16a
fix: all dialogs in navbar use default tone
jordanl17 Oct 31, 2024
e69826a
chore(Releases): using i18n for Published perspective labels
jordanl17 Oct 31, 2024
2555fae
fix(core): use realitve import for isPublishedPerspective
pedrobonamin Oct 31, 2024
985e50d
feat(sanity): update inputs 2 (#7704)
RitaDias Oct 31, 2024
0793fc4
refactor(sanity): update areas where untitlted releases would show empty
RitaDias Oct 31, 2024
a3406be
fix(sanity): remove setting perspective when creating new release
RitaDias Oct 31, 2024
90fa911
refactor(sanity): update styling for disabled chips
RitaDias Oct 31, 2024
c1ab90b
fix(sanity): edit draft when in a bundle where the version doesn't exist
RitaDias Oct 31, 2024
ea421a4
refactor(core): create new relase, update tab section
RitaDias Oct 31, 2024
42600e2
fix(core): fix ability to close create release dialog on clickoutside
RitaDias Oct 31, 2024
c20249c
fix(core): missing translate for navbar
RitaDias Oct 31, 2024
40a1e5c
feat(releass): scroll version chip to viewport
jordanl17 Oct 31, 2024
3a93101
fix(releases): cannot exclude published perspective
jordanl17 Oct 31, 2024
319f4e1
fix(core): update usePerspective exclude
pedrobonamin Oct 31, 2024
f57e164
fix(releases): avoid 'No releases' message if there are archived rele…
bjoerge Oct 31, 2024
e52f487
feat(core): add ability to change release type
RitaDias Oct 31, 2024
330aebd
refactor(sanity): update padding props
RitaDias Oct 31, 2024
6310fa9
fix(core): remove onClose for the discarddialog
RitaDias Oct 31, 2024
e948947
fix: updated releases publish action
jordanl17 Oct 31, 2024
dcb570c
fic(core): update sanity/client, use bundlePerspective[]
pedrobonamin Oct 31, 2024
af0beba
fix(releases): disable footer actions for documents not part of curre…
bjoerge Oct 31, 2024
c83435e
fixup! fix(releases): disable footer actions for documents not part o…
bjoerge Oct 31, 2024
bf5e526
fix(releases): stay in release after discarding a version
bjoerge Oct 31, 2024
f45aa89
feat(releases): supporting selecting a publish time on scheduled rele…
jordanl17 Oct 31, 2024
66776f0
chore(core): remove local sanity/ui and sanity/icons files, link with…
pedrobonamin Oct 31, 2024
855407d
refactor(releases): rename getBundleIdFromReleaseId => getBundleIdFro…
bjoerge Oct 31, 2024
aef9dcc
refactor(releases): use async/await instead of then/void
bjoerge Oct 31, 2024
ea93fea
Merge branch 'next' into corel
bjoerge Nov 1, 2024
b73f2d8
fix(deps): remove unused dependency
bjoerge Nov 1, 2024
f909a7e
chore(deps): update presentation dependencies
pedrobonamin Nov 1, 2024
6680455
feat: calendar filter can be disabled when no releases
jordanl17 Nov 1, 2024
28304f7
feat(releases): navigating to release detail when release created fro…
jordanl17 Nov 1, 2024
1390141
refactor(releases): use actions API for (most of) release and versions
bjoerge Oct 31, 2024
0c2bbb2
fix: fetch either draft of published when adding document to release
bjoerge Nov 1, 2024
dc9e628
fix(test-studio): disable actions api for document operarations in te…
bjoerge Nov 1, 2024
af5370d
feat(core): add duplicate action to the versions
RitaDias Nov 4, 2024
df8bf4d
fix(core): issue displaying the footer actions when document doesn't …
RitaDias Nov 4, 2024
fe87c5a
fix(sanity): fix issue where creating version from version was breaking
RitaDias Nov 4, 2024
d308098
fix(sanity): prevent adding versions to scheduled / scheduling releases
RitaDias Nov 4, 2024
55997fb
refactor(releases): move releases store into core/releases
bjoerge Nov 1, 2024
dc16512
fix(releases): fix mock paths
bjoerge Nov 1, 2024
4b870e1
refactor(releases): move useReleasesStore out of legacy
bjoerge Nov 1, 2024
ee198ab
chore(ci): revert unintentional edits from merge
bjoerge Nov 1, 2024
ebfc5c3
chore(releases): remove _version field from documents
bjoerge Nov 1, 2024
5fc8720
chore(releases): remove unused import
bjoerge Nov 1, 2024
2199dae
fix(sanity): prevent adding versions to scheduled / scheduling releas…
RitaDias Nov 4, 2024
f50524d
fix(sanity): fix chip select state when adding banners
RitaDias Nov 4, 2024
ed1169a
chore(deps): update visual-editing to latest
pedrobonamin Nov 4, 2024
5174074
fix(structure): move banners position
pedrobonamin Nov 4, 2024
15045d4
chore(deps): update visual-editing to latest
pedrobonamin Nov 4, 2024
daca134
chore(deps): update visual-editing to latest again
pedrobonamin Nov 4, 2024
b223327
chore(router): remove perspective state from router (#7749)
pedrobonamin Nov 5, 2024
49310e8
Merge branch 'next' into corel
bjoerge Nov 5, 2024
d670fe9
fix(ci): avoid literal as const package exports due to etl error
bjoerge Nov 5, 2024
9745162
Merge branch 'next' into corel
bjoerge Nov 5, 2024
90ca666
refactor(sanity): update date format
RitaDias Nov 6, 2024
10dea69
fix(sanity): issue where the scheduled for banner was appearing in re…
RitaDias Nov 6, 2024
b5fc349
fix(sanity): update header paddings to reduce document switch flickering
RitaDias Nov 6, 2024
327db99
Merge branch 'next' into corel
bjoerge Nov 6, 2024
2d3951a
test(core): fix reference e2e test (#7772)
RitaDias Nov 7, 2024
7146342
refactor(core): move some documentPerspective components from structu…
RitaDias Nov 7, 2024
264d4c9
refactor(core): rename dialogs (#7774)
RitaDias Nov 7, 2024
daede00
refactor(sanity): fix date formating, add locked chips and locked doc…
RitaDias Nov 7, 2024
a634563
chore(core): remove corel details screen top border
pedrobonamin Nov 8, 2024
1fe9d31
Merge branch 'next' into corel
bjoerge Nov 8, 2024
3e3e17c
fix(sanity): published references shown as drafts in reference inputs
RitaDias Nov 11, 2024
90331e6
Merge branch 'next' into corel
bjoerge Nov 11, 2024
b5ce373
fix(core): update releases table empty state
pedrobonamin Nov 11, 2024
fdea1cd
chore: [remove before merge]: tweak pnpm overrides
bjoerge Nov 11, 2024
79bc048
chore: regenerate lockfile
bjoerge Nov 11, 2024
e3e2a34
fix(sanity): fix issue where the input change wasn't impacting the ca…
RitaDias Nov 12, 2024
9a38017
refactor(sanity): add ability to change padding to dateTimeInput
RitaDias Nov 12, 2024
4ccbf7e
fix(core): update getPublishDateFromRelease, add ScheduledRelease typ…
pedrobonamin Nov 12, 2024
65673fa
fix: issue with the US formatting used by formatRelative when no loca…
jordanl17 Nov 13, 2024
78b8316
Merge branch 'next' into corel
bjoerge Nov 13, 2024
d46e8c9
feat(sanity): Add timezones to create release and to the release deta…
RitaDias Nov 13, 2024
e16fdfb
chore(sanity): only call getPublishDateFromRelease if the release typ…
RitaDias Nov 14, 2024
d830411
fix(sanity): issue with draft being selected when it shouldn't
RitaDias Nov 14, 2024
6b9fe6e
Merge branch 'next' into corel
bjoerge Nov 15, 2024
78c3214
refactor: move to system-only release documents (#7824)
bjoerge Nov 15, 2024
eea0283
fix(releases): fix broken query
bjoerge Nov 15, 2024
474bfba
feat(releases): adding correct confirmation dialog to archive release…
jordanl17 Nov 18, 2024
1a0c038
test(releases): turning on most of ReleasesOverview tests
jordanl17 Nov 18, 2024
8171a71
Merge branch 'corel' of github.com:sanity-io/sanity into corel
jordanl17 Nov 18, 2024
89137be
fix: skipping broken releasesOverview tests due to unknown issues
jordanl17 Nov 18, 2024
ca2bf71
test(releases): comprehensive testing on release nav (#7840)
jordanl17 Nov 19, 2024
ff28a57
test(releases): calendar tests for releases overview (#7850)
jordanl17 Nov 20, 2024
3a29f90
fix(core): update metadata property name, add delay after creation
pedrobonamin Nov 20, 2024
2cc67f8
fix(core): update slug validator to account for version documents
pedrobonamin Nov 20, 2024
a3dc693
test: resolving mismatch on snapshot for updated slugValidator (#7855)
jordanl17 Nov 21, 2024
0c715af
fix(sanity): add ability to search version documents from AddDocument…
RitaDias Nov 21, 2024
dbdee62
test(sanity): update and re-write unit tests (CreateReleaseDialog/use…
RitaDias Nov 21, 2024
4c753b3
test(sanity): re-add checkoutPair tests
RitaDias Nov 21, 2024
c893edc
test(sanity): update and activate corel tests (#7860)
RitaDias Nov 21, 2024
e78b029
fix(releases): can only add documents to active releases
jordanl17 Nov 21, 2024
20034ee
fix(releases): untitled releases have placeholder in breadcrumb
jordanl17 Nov 21, 2024
07c92c7
Merge branch 'corel' of github.com:sanity-io/sanity into corel
jordanl17 Nov 21, 2024
7a6ff5f
feat(releases): timezone selection updates filtering and dateTime dis…
jordanl17 Nov 21, 2024
237694b
fix: release tables can sort by strings and dates
jordanl17 Nov 22, 2024
465c105
fix: table styling on headers
jordanl17 Nov 22, 2024
e64ea96
fix: table styling on headers
jordanl17 Nov 22, 2024
41a63c8
fix(core): remove timeout and retry from releases store (#7866)
pedrobonamin Nov 22, 2024
027aabf
fix: support creating version with initial value (#7878)
bjoerge Nov 26, 2024
3e700a8
Merge branch 'next' into corel
bjoerge Nov 26, 2024
3057e2b
feat: Start in Create button is now enabled by default (#7884)
snorrees Nov 26, 2024
25eb4f2
Revert "feat: Start in Create button is now enabled by default (#7884)"
snorrees Nov 26, 2024
735f831
test(sanity): ReleaseSummary tests (#7870)
RitaDias Nov 26, 2024
12b308d
fix: when selected perspective is not active, remove perspective from…
jordanl17 Nov 26, 2024
e1b455e
fix: resolving ts error on DocumentStatusLine
jordanl17 Nov 26, 2024
157150f
Merge branch 'next' into corel
bjoerge Nov 27, 2024
170fdd3
fix: calendar filter tests using today's date
jordanl17 Nov 27, 2024
9de21db
fix: opt-out @tanstack/react-virtual from React Compiler
jordanl17 Nov 28, 2024
97f610e
fix(releases): only throw error when release type is scheduled but no…
jordanl17 Nov 28, 2024
6bd667f
fix(structure): add support to edit live documents in published persp…
pedrobonamin Nov 28, 2024
2cfed5e
refactor(sanity): simplify releases plugin document action composition
juice49 Nov 28, 2024
58ff054
feat(sanity): add `action.compare-versions` string
juice49 Nov 28, 2024
8ac1d1c
fix: react compiler and the Symbol prop value in ToneIcon renamed to …
jordanl17 Nov 29, 2024
7a4b7a3
Merge branch 'corel' of github.com:sanity-io/sanity into corel
jordanl17 Nov 29, 2024
5deba91
fix(core): `VersionOriginType` to `DocumentVariantType` (#7924)
pedrobonamin Dec 2, 2024
229ecf3
Merge branch 'next' into corel
bjoerge Dec 2, 2024
f5cedf1
fix(core): when publishing a release unpin it (#7925)
pedrobonamin Dec 2, 2024
28e91ea
Merge branch 'next' into corel
bjoerge Dec 4, 2024
8b93392
fix(deps): remove @sanity/ui and @sanity/icons overrides
bjoerge Dec 2, 2024
38a3aa2
fix(deps): remove pnpm override
bjoerge Dec 3, 2024
dbdbee3
refactor(sanity): remove bundle-prefix, move away from bundlePerspective
bjoerge Dec 3, 2024
100b646
fix(sanity): fix ts errors after sanity/ui upgrade
bjoerge Dec 3, 2024
edd4897
refactor: address PR feedback
bjoerge Dec 3, 2024
5113189
chore(structure): fix lint error
bjoerge Dec 3, 2024
c829d7e
fix(structure): fix pane header padding issue
bjoerge Dec 4, 2024
75bbf61
fix: use the latest `corel` version of `@sanity/presentation` (#7941)
stipsan Dec 4, 2024
e26f7ce
fix: disable api actions for visual editing test studio
bjoerge Dec 4, 2024
1f4d553
chore(deps): upgrade to @sanity/[email protected]
bjoerge Dec 4, 2024
241a34d
feat(releases): support delete release server action (#7943)
jordanl17 Dec 5, 2024
03fa5c1
fix(sanity): fix issue where you could click the published chip even …
RitaDias Dec 5, 2024
1087b3e
fix(structure): live edit documents need to be editable in published …
pedrobonamin Dec 5, 2024
f3a73eb
test(e2e): update unpublish test to match update (#7951)
RitaDias Dec 5, 2024
19e999d
fix(deps): bump `@sanity/presentation` to `1.19.5-release.3` (#7956)
stipsan Dec 5, 2024
e9a1674
fix(sanity): fix issue where you could click the published chip even …
RitaDias Dec 5, 2024
5677b53
feat(releases): unschedule release from release menu button menu (#7954)
jordanl17 Dec 6, 2024
351a6a4
fix(sanity): issue with the publish chip disable + update tests (#7968)
RitaDias Dec 6, 2024
89a0b59
fix(deps): bump `@sanity/presentation` to `1.19.8-release.0` (#7970)
stipsan Dec 6, 2024
d37b324
Merge branch 'next' into corel
bjoerge Dec 6, 2024
1ae808e
feat(sanity): add unpublish document to release (#7947)
RitaDias Dec 6, 2024
e696576
chore(cli): remove v2 test fixtures
bjoerge Dec 6, 2024
d0579da
chore(cli): remove v2 test branches
bjoerge Dec 6, 2024
74f1754
test(cli): make it easier to configure token for running cli tests lo…
bjoerge Dec 6, 2024
6a9d4c3
test(cli): increase test timeouts
bjoerge Dec 6, 2024
4f2194b
fix(releases): blocking UI elements that allow for adding documents t…
jordanl17 Dec 6, 2024
c6e5ee5
chore(core): remove `releaseStack` from releasesStore (#7990)
pedrobonamin Dec 9, 2024
7b28097
feat(core): adds events based history (#7922)
pedrobonamin Dec 9, 2024
7406916
fix(structure): enable published chip for live edit documents (#8000)
pedrobonamin Dec 10, 2024
14c3097
chore(core): add new function getTransactionsLogs (#8004)
pedrobonamin Dec 10, 2024
089c5eb
fix(core): documents history fixes (#8007)
pedrobonamin Dec 10, 2024
f991463
feat(core): corel publish 2 action - test (#8015)
pedrobonamin Dec 11, 2024
63b2792
feat: showing documents in archived and published releases (#7994)
jordanl17 Dec 11, 2024
7198895
Merge branch 'next' into corel
bjoerge Dec 12, 2024
1a6483d
fix(core): update pnpm lock file
pedrobonamin Dec 12, 2024
ea86580
fix(core): release events types are lowercase (#8024)
pedrobonamin Dec 12, 2024
2bd96f6
feat(core): releases history (#7973)
pedrobonamin Dec 13, 2024
b9d599f
feat(core): option to exclude draft perspective (#8028)
pedrobonamin Dec 13, 2024
bcfe37f
fix(core): catch error for release events
pedrobonamin Dec 13, 2024
2800b1d
chore(core): refactor usePerspective hook (#8029)
pedrobonamin Dec 13, 2024
0dee912
fix(releases): stabilising observable for archived and published vers…
jordanl17 Dec 14, 2024
f5f6824
feat(releases): reverting releases (#8008)
jordanl17 Dec 14, 2024
e99f431
fix: `WebSocket is closed before the connection is established` warni…
stipsan Dec 18, 2024
5769c3e
fix(deps): Update dev-non-major (#8100)
renovate[bot] Dec 18, 2024
3eea18c
chore(deps): update dependency turbo to ^2.3.3 (#8099)
renovate[bot] Dec 18, 2024
10e89f3
feat(typegen): add support for astro (#8098)
sgulseth Dec 18, 2024
0fddbf8
fix(deps): update dependency @sanity/icons to ^3.5.5 (#8106)
renovate[bot] Dec 19, 2024
34bf7f6
chore(deps): update typescript-tooling (#8104)
renovate[bot] Dec 19, 2024
27a942e
chore(deps): update dependency @sanity/tsdoc to v1.0.153 (#8107)
renovate[bot] Dec 19, 2024
f0d988f
fix(deps): update dependency react-rx to ^4.1.10 (#8109)
renovate[bot] Dec 19, 2024
d60b451
fix(deps): update dependency @sanity/ui to ^2.10.12 (#8108)
renovate[bot] Dec 19, 2024
67abc06
fix(deps): update dependency @sanity/icons to ^3.5.5 (#8105)
renovate[bot] Dec 19, 2024
1adb6e3
Merge branch 'next' into corel
bjoerge Dec 19, 2024
8c79998
fix(field): Use jsx stead of createElement
bjoerge Dec 19, 2024
2c997b3
fix(deps): unpin vitest version
bjoerge Dec 19, 2024
f613af6
fix(field): Use jsx stead of createElement
bjoerge Dec 19, 2024
5a58f2d
chore: bump presentation (#8119)
stipsan Dec 20, 2024
12c37ca
test(releases): fixing issues with virtual list and releases overview…
jordanl17 Dec 20, 2024
d6c6663
fix(releases): when reverting, published versions are used to derive …
jordanl17 Dec 20, 2024
be255dc
chore: updating release telemetry to conform to style guides (#8135)
jordanl17 Dec 23, 2024
cd2d8ac
fix(releases): hiding calendar on release picker dialog when not sche…
jordanl17 Dec 24, 2024
91ac9b0
fix(releases): remounting the title/description form for release when…
jordanl17 Dec 24, 2024
6c1a71e
feat(releases): published label; unarchive server action; and fixture…
jordanl17 Dec 25, 2024
c4c664f
chore: merge next into corel (#8139)
jordanl17 Dec 27, 2024
303c3d4
refactor: releasesOverview into utils and smaller components for cale…
jordanl17 Dec 27, 2024
c784561
chore: removing deprecated motion for motion.create (#8145)
jordanl17 Dec 27, 2024
5ff3aae
chore(core): remove unused PerspectiveBadge component (#8152)
pedrobonamin Jan 2, 2025
8245993
fix(core): do not throw if schemaType is not found (#8163)
pedrobonamin Jan 3, 2025
9d0d549
fix(structure): add opt out option from releases in DocumentPaneProvi…
pedrobonamin Jan 3, 2025
0a29d00
Merge remote-tracking branch 'origin/next' into corel
pedrobonamin Jan 3, 2025
b512378
fix(core): replace sanity imports in corel for relative paths
pedrobonamin Jan 3, 2025
e9a5002
fix(structure): add support to force a version for the pane provider …
pedrobonamin Jan 3, 2025
5d3ba18
chore: disabling actions API for staging dataset
jordanl17 Jan 7, 2025
c6c0085
chore: enabling events API for staging dataset
jordanl17 Jan 7, 2025
3184656
Merge branch 'corel' of github.com:sanity-io/sanity into corel
jordanl17 Jan 7, 2025
4f85a54
Merge remote-tracking branch 'origin/next' into corel
pedrobonamin Jan 8, 2025
bae10ef
fix(core): update types to match with react-19
pedrobonamin Jan 8, 2025
35011d0
refactor: useBundleDocuments only invoked when release menu is opened…
jordanl17 Jan 9, 2025
89eb4df
test: longer timeout for flakes on ReleaseDashboardFooter.test
jordanl17 Jan 9, 2025
a332233
chore: using motion.create in calendar filter
jordanl17 Jan 9, 2025
e363892
refactor: removing unnecessary use of useBundleDocuments in ReleaseMe…
jordanl17 Jan 10, 2025
afb4f7c
Merge remote-tracking branch 'origin/next' into corel
pedrobonamin Jan 13, 2025
249c72e
chore(test-studio): restore sanity assist in presentation studio
pedrobonamin Jan 13, 2025
28b2418
chore(core): update commentsProvider to receive releaseId
pedrobonamin Jan 13, 2025
c6dfca6
fix(core): use comments version id where necessary
pedrobonamin Jan 13, 2025
91b805c
chore(core): corel-324 request access screen rebase fix
pedrobonamin Jan 13, 2025
a7ebc3c
chore: Pr small cleanup
pedrobonamin Jan 13, 2025
278dca4
fix(test): revert author schema changes
pedrobonamin Jan 13, 2025
ed37a55
fix(core): update ui-components button props
pedrobonamin Jan 13, 2025
4d4aba8
fix(core): support serverDocumentActions flag in plugins (#8233)
pedrobonamin Jan 13, 2025
66626eb
Merge remote-tracking branch 'origin/next' into corel
pedrobonamin Jan 14, 2025
b2330a6
Merge remote-tracking branch 'origin/next' into corel
pedrobonamin Jan 15, 2025
489120f
feat(sanity): add release layering support to `groq2024` search strategy
juice49 Jan 13, 2025
640033c
fix(test): restore skipped tests (#8278)
pedrobonamin Jan 15, 2025
5a98259
fix(core): remove useBundleDeletedToast, move to usePerspective hook …
pedrobonamin Jan 15, 2025
d52c0ac
fix(structure): only reset history params if needed (#8284)
pedrobonamin Jan 16, 2025
cc1dc74
fix: forcing all search strategies to use vX API whilst releases not …
jordanl17 Jan 16, 2025
da1979a
feat: releases overview shows total docs in release (#8232)
jordanl17 Jan 16, 2025
c0e41c5
fix: restore package json sanity/ui reference (#8287)
pedrobonamin Jan 16, 2025
287f032
chore: updating test studio dependencies to versions to support corel…
jordanl17 Jan 16, 2025
10dc77f
chore: merge next into corel (#8303)
jordanl17 Jan 16, 2025
4d7ea9e
Revert "chore: merge next into corel" (#8306)
jordanl17 Jan 16, 2025
0b96e34
Merge branch 'next' into corel
jordanl17 Jan 16, 2025
3a35e46
fix(deps): upgrade `@sanity/presentation` to v1.22.1-release.0 (#8296)
stipsan Jan 16, 2025
1501203
Merge remote-tracking branch 'origin/next' into corel
pedrobonamin Jan 17, 2025
86ecfa7
Merge branch 'next' into corel
jordanl17 Jan 17, 2025
4b2d6c8
test(e2e): update reference tests for corel (#8314)
RitaDias Jan 17, 2025
bc92a49
Merge branch 'next' into corel
jordanl17 Jan 17, 2025
d4112d7
feat(sanity): use API `vX` when executing actions
juice49 Jan 16, 2025
e2cf16d
fix(sanity): editing version document using Actions API
juice49 Jan 16, 2025
edbb298
feat(test-studio): enable Actions API
juice49 Jan 16, 2025
b47e306
Merge remote-tracking branch 'origin/next' into corel
pedrobonamin Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ const config = {
'sortOrder',
'status',
'group',
'textWeight',
'showChangesBy',
],
},
},
Expand Down
4 changes: 2 additions & 2 deletions dev/test-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@portabletext/block-tools": "^1.0.2",
"@portabletext/editor": "^1.21.5",
"@portabletext/react": "^3.0.0",
"@sanity/assist": "^3.0.2",
"@sanity/assist": "^3.1.0",
"@sanity/client": "^6.25.0",
"@sanity/color": "^3.0.0",
"@sanity/color-input": "^4.0.1",
Expand All @@ -34,7 +34,7 @@
"@sanity/logos": "^2.1.2",
"@sanity/migrate": "workspace:*",
"@sanity/preview-url-secret": "^2.0.0",
"@sanity/react-loader": "^1.8.3",
"@sanity/react-loader": "^1.10.35",
"@sanity/tsdoc": "1.0.169",
"@sanity/types": "workspace:*",
"@sanity/ui": "^2.11.2",
Expand Down
2 changes: 2 additions & 0 deletions dev/test-studio/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export default defineConfig([
dataset: 'playground',
plugins: [sharedSettings()],
basePath: '/playground',
beta: {eventsAPI: {enabled: true}},
},
{
name: 'listener-events',
Expand Down Expand Up @@ -253,6 +254,7 @@ export default defineConfig([
plugins: [sharedSettings()],
basePath: '/staging',
apiHost: 'https://api.sanity.work',
beta: {eventsAPI: {enabled: true}},
auth: {
loginMethod: 'token',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/@sanity/types/src/schema/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export interface PrepareViewOptions {

/** @public */
export interface PreviewValue {
_id?: string
_createdAt?: string
_updatedAt?: string
title?: string
subtitle?: string
description?: string
Expand Down
1 change: 1 addition & 0 deletions packages/sanity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@
"rimraf": "^5.0.10",
"rxjs": "^7.8.0",
"rxjs-exhaustmap-with-trailing": "^2.1.1",
"rxjs-mergemap-array": "^0.1.0",
"sanity-diff-patch": "^4.0.0",
"scroll-into-view-if-needed": "^3.0.3",
"semver": "^7.3.5",
Expand Down
11 changes: 11 additions & 0 deletions packages/sanity/src/_singletons/context/EventsContext.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {createContext} from 'sanity/_createContext'

import type {EventsStore} from '../../core/store/events/types'

/**
* @internal
*/
export const EventsContext = createContext<EventsStore | null>(
'sanity/_singletons/context/events',
null,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {createContext} from 'sanity/_createContext'

import type {ReleasesMetadataContextValue} from '../../core/releases/contexts/ReleasesMetadataProvider'

/**
* @internal
* @hidden
*/
export const ReleasesMetadataContext = createContext<ReleasesMetadataContextValue | null>(
'sanity/_singletons/context/releases-metadata',
null,
)
11 changes: 11 additions & 0 deletions packages/sanity/src/_singletons/context/ReleasesTableContext.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {createContext} from 'sanity/_createContext'

import type {TableContextValue} from '../../core/releases/tool/components/Table/TableProvider'

/**
* @internal
*/
export const TableContext = createContext<TableContextValue | null>(
'sanity/_singletons/context/releases-table',
null,
)
3 changes: 3 additions & 0 deletions packages/sanity/src/_singletons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export * from './context/DocumentFieldActionsContext'
export * from './context/DocumentIdContext'
export * from './context/DocumentPaneContext'
export * from './context/DocumentSheetListContext'
export * from './context/EventsContext'
export * from './context/FieldActionsContext'
export * from './context/FormBuilderContext'
export * from './context/FormCallbacksContext'
Expand Down Expand Up @@ -51,6 +52,8 @@ export * from './context/PresentationSharedStateContext'
export * from './context/PreviewCardContext'
export * from './context/ReferenceInputOptionsContext'
export * from './context/ReferenceItemRefContext'
export * from './context/ReleasesMetadataContext'
export * from './context/ReleasesTableContext'
export * from './context/ResourceCacheContext'
export * from './context/ReviewChangesContext'
export * from './context/RouterContext'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {type ReleaseId} from '@sanity/client'
import {type Path} from '@sanity/types'
import {orderBy} from 'lodash'
import {memo, type ReactNode, useCallback, useMemo, useState} from 'react'
Expand All @@ -6,7 +7,7 @@ import {CommentsContext} from 'sanity/_singletons'
import {useEditState, useSchema, useUserListWithPermissions} from '../../../hooks'
import {useCurrentUser} from '../../../store'
import {useAddonDataset, useWorkspace} from '../../../studio'
import {getPublishedId} from '../../../util'
import {getPublishedId, getVersionId} from '../../../util'
import {
type CommentOperationsHookOptions,
useCommentOperations,
Expand Down Expand Up @@ -43,6 +44,7 @@ export interface CommentsProviderProps {
children: ReactNode
documentId: string
documentType: string
releaseId?: ReleaseId
type: CommentsType
sortOrder: 'asc' | 'desc'

Expand Down Expand Up @@ -78,20 +80,23 @@ export const CommentsProvider = memo(function CommentsProvider(props: CommentsPr
selectedCommentId,
isConnecting,
onPathOpen,
releaseId,
} = props
const commentsEnabled = useCommentsEnabled()
const [status, setStatus] = useState<CommentStatus>('open')
const {client, createAddonDataset, isCreatingDataset} = useAddonDataset()
const publishedId = getPublishedId(documentId)
const editState = useEditState(publishedId, documentType, 'low')
const versionOrPublishedId = releaseId ? getVersionId(documentId, releaseId) : publishedId
const editState = useEditState(publishedId, documentType, 'low', releaseId)
const schemaType = useSchema().get(documentType)
const currentUser = useCurrentUser()

const {name: workspaceName, dataset, projectId} = useWorkspace()

const documentValue = useMemo(() => {
if (releaseId) return editState.version
return editState.draft || editState.published
}, [editState.draft, editState.published])
}, [editState.version, editState.draft, editState.published, releaseId])

const documentRevisionId = useMemo(() => documentValue?._rev, [documentValue])

Expand All @@ -112,7 +117,8 @@ export const CommentsProvider = memo(function CommentsProvider(props: CommentsPr
error,
loading,
} = useCommentsStore({
documentId: publishedId,
documentId,
releaseId,
client,
transactionsIdMap,
onLatestTransactionIdReceived: handleOnLatestTransactionIdReceived,
Expand Down Expand Up @@ -229,7 +235,7 @@ export const CommentsProvider = memo(function CommentsProvider(props: CommentsPr
client,
currentUser,
dataset,
documentId: publishedId,
documentId: versionOrPublishedId,
documentRevisionId,
documentType,
getComment,
Expand Down Expand Up @@ -257,7 +263,7 @@ export const CommentsProvider = memo(function CommentsProvider(props: CommentsPr
client,
currentUser,
dataset,
publishedId,
versionOrPublishedId,
documentRevisionId,
documentType,
getComment,
Expand All @@ -277,7 +283,7 @@ export const CommentsProvider = memo(function CommentsProvider(props: CommentsPr

const ctxValue = useMemo(
(): CommentsContextValue => ({
documentId,
documentId: versionOrPublishedId,
documentType,

isCreatingDataset,
Expand Down Expand Up @@ -310,7 +316,7 @@ export const CommentsProvider = memo(function CommentsProvider(props: CommentsPr
mentionOptions,
}),
[
documentId,
versionOrPublishedId,
documentType,
isCreatingDataset,
status,
Expand Down
19 changes: 15 additions & 4 deletions packages/sanity/src/core/comments/store/useCommentsStore.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import {type ListenEvent, type ListenOptions, type SanityClient} from '@sanity/client'
import {
type ListenEvent,
type ListenOptions,
type ReleaseId,
type SanityClient,
} from '@sanity/client'
import {useCallback, useEffect, useMemo, useReducer, useRef, useState} from 'react'
import {catchError, of} from 'rxjs'

import {getPublishedId} from '../../util'
import {getPublishedId, getVersionId} from '../../util'
import {type CommentDocument, type Loadable} from '../types'
import {commentsReducer, type CommentsReducerAction, type CommentsReducerState} from './reducer'

Expand All @@ -14,6 +19,7 @@ export interface CommentsStoreOptions {
documentId: string
onLatestTransactionIdReceived: (documentId: DocumentId) => void
transactionsIdMap: Map<DocumentId, TransactionId>
releaseId?: ReleaseId
}

interface CommentsStoreReturnType extends Loadable<CommentDocument[]> {
Expand Down Expand Up @@ -56,15 +62,20 @@ const QUERY_SORT_ORDER = `order(${SORT_FIELD} ${SORT_ORDER})`
const QUERY = `*[${QUERY_FILTERS.join(' && ')}] ${QUERY_PROJECTION} | ${QUERY_SORT_ORDER}`

export function useCommentsStore(opts: CommentsStoreOptions): CommentsStoreReturnType {
const {client, documentId, onLatestTransactionIdReceived, transactionsIdMap} = opts
const {client, documentId, onLatestTransactionIdReceived, transactionsIdMap, releaseId} = opts

const [state, dispatch] = useReducer(commentsReducer, INITIAL_STATE)
const [loading, setLoading] = useState<boolean>(client !== null)
const [error, setError] = useState<Error | null>(null)

const didInitialFetch = useRef<boolean>(false)

const params = useMemo(() => ({documentId: getPublishedId(documentId)}), [documentId])
const params = useMemo(
() => ({
documentId: releaseId ? getVersionId(documentId, releaseId) : getPublishedId(documentId),
}),
[documentId, releaseId],
)

const initialFetch = useCallback(async () => {
if (!client) {
Expand Down
Loading
Loading