diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d82d21a40..dd3dffe90d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,9 @@ jobs: - name: Install dependencies run: yarn + - name: Run tests + run: yarn test + - name: Check linting and formatting run: | if yarn lint && yarn format:check; then diff --git a/package.json b/package.json index 7d25792f57..8cdb411a56 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "release:prepare": "git fetch --tags && conventional-recommended-bump -p angular | xargs yarn version:auto $1", "release:canary": "yarn release:prepare && node scripts/get-unstable-version canary | xargs yarn version:auto $1", "release-commit": "git add -u && git commit -m \"release: v${npm_package_version}\"", + "test": "turbo run test", "version": "lerna version --force-publish -y --no-push --no-changelog --no-git-tag-version $npm_package_version", "version:auto": "yarn version --no-git-tag-version --new-version $1", "changelog": "node scripts/create-changelog" diff --git a/packages/core/components/Puck/index.tsx b/packages/core/components/Puck/index.tsx index b730ecd62a..0f971591f8 100644 --- a/packages/core/components/Puck/index.tsx +++ b/packages/core/components/Puck/index.tsx @@ -19,7 +19,7 @@ import { Plugin } from "../../types/Plugin"; import { usePlaceholderStyle } from "../../lib/use-placeholder-style"; import { SidebarSection } from "../SidebarSection"; -import { Globe, Sidebar } from "react-feather"; +import { Globe, Sidebar, ChevronLeft, ChevronRight } from "react-feather"; import { Heading } from "../Heading"; import { IconButton } from "../IconButton/IconButton"; import { DropZone, DropZoneProvider, dropZoneContext } from "../DropZone"; @@ -30,6 +30,7 @@ import { LayerTree } from "../LayerTree"; import { findZonesForArea } from "../../lib/find-zones-for-area"; import { areaContainsZones } from "../../lib/area-contains-zones"; import { flushZones } from "../../lib/flush-zones"; +import { usePuckHistory } from "../../lib/use-puck-history"; const Field = () => {}; @@ -91,6 +92,11 @@ export function Puck({ flushZones(initialData) ); + const { canForward, canRewind, rewind, forward } = usePuckHistory({ + data, + dispatch, + }); + const [itemSelector, setItemSelector] = useState(null); const selectedItem = itemSelector ? getItem(itemSelector, data) : null; @@ -337,6 +343,36 @@ export function Puck({ justifyContent: "flex-end", }} > +
+ + + + + + +
{renderHeaderActions && renderHeaderActions({ data, dispatch })}