From f5ad5ff60f5def4c001c5f95498ce55f66fd726a Mon Sep 17 00:00:00 2001 From: mattcompiles Date: Mon, 1 Jun 2020 09:36:46 +1000 Subject: [PATCH] feat: Add paramType config to use standard search queries (#161) Co-authored-by: Michael Taranto --- .github/workflows/preview-site.yml | 2 +- README.md | 1 + cypress/integration/editor.js | 5 + cypress/integration/smoke.js | 6 +- cypress/integration/snippets.js | 6 +- cypress/integration/toolbar.js | 5 + cypress/integration/urlHandling.js | 71 ++++++++--- cypress/projects/basic/playroom.config.js | 1 + cypress/projects/themed/components.js | 27 +++++ cypress/projects/themed/playroom.config.js | 10 ++ cypress/projects/themed/serve.json | 3 + cypress/projects/themed/snippets.js | 22 ++++ cypress/projects/themed/themes.js | 2 + cypress/support/index.js | 17 --- cypress/support/utils.js | 16 +++ lib/provideDefaultConfig.js | 1 + package.json | 23 ++-- src/Playroom/Frame.js | 44 ------- src/Playroom/Frame.tsx | 38 ++++++ src/Playroom/Frames/Frames.tsx | 13 +- src/Playroom/Frames/Iframe.tsx | 4 +- src/Playroom/Preview.tsx | 49 +++----- src/Playroom/WindowPortal/index.tsx | 2 +- src/StoreContext/StoreContext.tsx | 6 +- src/config.ts | 5 + src/index.d.ts | 1 + src/index.js | 3 +- src/utils/getParamsFromQuery.ts | 10 -- src/utils/params.ts | 37 ++++++ src/utils/usePreviewUrl.ts | 6 +- utils/index.d.ts | 4 + utils/index.js | 8 +- yarn.lock | 131 ++++++++++++++++++++- 33 files changed, 427 insertions(+), 152 deletions(-) create mode 100644 cypress/projects/themed/components.js create mode 100644 cypress/projects/themed/playroom.config.js create mode 100644 cypress/projects/themed/serve.json create mode 100644 cypress/projects/themed/snippets.js create mode 100644 cypress/projects/themed/themes.js delete mode 100644 src/Playroom/Frame.js create mode 100644 src/Playroom/Frame.tsx create mode 100644 src/config.ts delete mode 100644 src/utils/getParamsFromQuery.ts create mode 100644 src/utils/params.ts diff --git a/.github/workflows/preview-site.yml b/.github/workflows/preview-site.yml index be1e2432..3ffafe2c 100644 --- a/.github/workflows/preview-site.yml +++ b/.github/workflows/preview-site.yml @@ -24,7 +24,7 @@ jobs: run: yarn --frozen-lockfile - name: Build - run: yarn example:braid:build + run: yarn preview:build - name: Deploy to surge run: yarn deploy-preview -d playroom--${GITHUB_SHA}.surge.sh diff --git a/README.md b/README.md index c765d037..25a6b77d 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ module.exports = { widths: [320, 375, 768, 1024], port: 9000, openBrowser: true, + paramType: 'search', // default is 'hash' exampleCode: `