Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Added an embed mode which works via the URL, not any data in our db #323

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

mattpocock
Copy link
Contributor

@mattpocock mattpocock commented Nov 29, 2021

Comment pasted here for ease:

/**
 * Displays a view-only page which can render a machine
 * to the canvas from the URL
 *
 * Use this example URL: http://localhost:3000/viz/view-only?machine=N4IglgdmAuYIYBsQC4QHcD2aQBoQGdo5oBTfFUTbZYAXzwhOrttqA
 *
 * This is for loading OG images quickly, and for many other applications
 * such as embedding comments in PR's parsed using xstate-parser
 *
 * To create the machine hash, use the lzString.compressToEncodedURIComponent
 * function on a JSON.stringified machine config.
 *
 * You can also use the typical embed controls
 */

@mattpocock mattpocock requested a review from farskid November 29, 2021 10:27
@changeset-bot
Copy link

changeset-bot bot commented Nov 29, 2021

⚠️ No Changeset found

Latest commit: 317bb3e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Nov 29, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/statelyai/xstate-viz/EM7RPr5eG5k4TECRfFG1LR1hvvqV
✅ Preview: https://xstate-viz-git-matt-added-an-embed-mode-which-b61eb7-statelyai.vercel.app

src/App.tsx Outdated Show resolved Hide resolved
src/pages/view-only.tsx Outdated Show resolved Hide resolved
src/pages/view-only.tsx Outdated Show resolved Hide resolved
src/App.tsx Outdated Show resolved Hide resolved
src/pages/view-only.tsx Outdated Show resolved Hide resolved
src/pages/view-only.tsx Outdated Show resolved Hide resolved
src/pages/view-only.tsx Outdated Show resolved Hide resolved
src/pages/view-only.tsx Outdated Show resolved Hide resolved
src/pages/view-only.tsx Outdated Show resolved Hide resolved
mattpocock and others added 4 commits November 29, 2021 11:40
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
src/withReadyRouter.tsx Outdated Show resolved Hide resolved
Copy link
Member

@Andarist Andarist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have a test setup here in place, we could add a basic test for this feature

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>

const viewOnlyPageMachine = createMachine<{
query: NextRouter['query'];
}>({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants