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

More phenogrid features, scrollbar changes #372

Merged
merged 4 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const iframe = document.querySelector("iframe");
iframe.contentWindow.postMessage({ source: ["abc"], target: ["def"] }, "*");
```

#### Emits `MessageEvent<DOMRect>`
#### Emits `MessageEvent<{ width: number; height: number; }>`

Emitted when the size of the widget changes and on load.
Useful for setting the dimensions of your iframe container, for example:
Expand Down
36 changes: 3 additions & 33 deletions frontend/fixtures/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,38 +157,8 @@ export const handlers = [
),

/** any other request */
rest.get(/.*/, (req, res, ctx) => {
/** for certain exceptions, passthrough (let browser make a real request) */
const exceptions = [
/\.vue$/,
/\.js$/,
/\.ts$/,
/\.css$/,
/\.scss$/,
/\.html$/,
/\.mp4$/,
/\.svg$/,
/\.png$/,
/\.jpg$/,
/\.jpeg$/,
/\.gif$/,
/\.bmp$/,
/\.tiff$/,
/\.woff$/,
/\.json$/,
/\.jsonld$/,
/\.txt$/,
/site\.webmanifest/,
/medium\.com/,
/fonts\.googleapis\.com/,
];
if (exceptions.some((exception) => req.url.href.match(exception)))
return req.passthrough();

/**
* otherwise, throw error to make sure we never hit any api when mocking is
* enabled
*/
return res(ctx.status(500, "Non-mocked request " + req.url.pathname));
rest.get(/.*/, (req) => {
console.info("Non-mocked request", req.url.pathname);
return req.passthrough();
}),
];
Loading