Comments (4)
Thanks @allmarkedup that's exactly what I was hoping for :) I'll close this issue since for me at least it solves the feature request. If you want to re-open, go for it :) Thanks again!
from lookbook.
Hey @leighhalliday 👋
Yes you are correct, using the embeds externally requires some JavaScript to be included on the page - details of that are here: https://lookbook.build/guide/sharing/embeds#javascript but I totally agree it would be nice to be able to access the raw iframe URL too for places where that is not feasible. I'll look at adding that into the embed code panel (and also update the info in there to provide a bit more explanation about it all).
Using a plain iframe without the Lookbook JS does come with some disadvantages however. The iframe URLs are pretty hard to manually edit as they are basically encoded JSON (I actually wanted to change this before the v2 launch as it was not a great design decision but I decided to kick that particular can down the road a bit 🙂) but the main problem is that the iframe won't resize its height as the height of the embedded content changes. This is especially a problem with embeds that have been customised to display inspector panels as changing tabs can often result in a lot of height changes.
Obviously your hands are tied when adding to something like Notion but it's worth bearing in mind.
(I have just noticed this in the Embedly docs: https://docs.embed.ly/reference/provider-height-resizing - unfortunately Lookbook embeds can't be served via Embedly but I'll do some research to see if there is any sort of standard for notifying host pages about iframe content resizing events. This is basically the same technique that the Lookbook embed JS uses, just with a different postMessage format.)
Anyway, as long as people understand the disadvantages of going down the iframe-only route there is no reason not to make the URL a bit more accessible in the UI as you suggest, so that at least it is possible to add them to services like Notion.
Thanks for the suggestion and I'll update here when I've had a chance to add it in :-)
from lookbook.
Thank you @allmarkedup !! I'm happy to contribute by working on this if we're on the same page regarding direction!
from lookbook.
Thanks @leighhalliday - I missed your comment above but I've actually just got a PR up anyway that reworks the dropdown and displays the embed URL underneath the embed code.
I need to expand the docs a bit to include some info about manually using the embed URL in an iframe (and the downsides of not having automatic resizing etc) so it can be linked to from the dropdown. But in the meantime, is this the sort of thing you were thinking of? Was this the sort of thing you were looking for?
from lookbook.
Related Issues (20)
- Why does the preview filter ignore the path/folder structure? HOT 4
- Add the ability to hide a nested within a group. HOT 3
- Cannot choose display options in an embedded preview HOT 4
- Support better errors / web console instead of rescuing errors in Lookbook HOT 2
- undefined method `strftime' for nil:NilClass with nil datetime HOT 1
- Hidden scenarios within groups are not accessible via their URL
- Swap the order of Previews and Pages sections HOT 4
- Ability to search within pages section HOT 3
- X-Frame-Options always set to deny HOT 8
- Can't draw templates that require instance variables HOT 5
- Lookbook overrides ViewComponent `show_previews` config depending on load order HOT 3
- ActionView::Template::Error occurs when trying to render a template file with a partial HOT 5
- FEA: Support for Mailer Previews HOT 1
- Support configurable frame ancestors for embeds HOT 2
- Documentation request: mention support for Phlex in the README HOT 5
- Previews not rendering nested components HOT 2
- Better integration with Phlex HOT 1
- Version requirement for listen gem is not specified, and wrong version error is suppressed HOT 1
- Syntax error reporting in Lookbook HOT 2
- Sharing View Component Previews Across Multiple Projects Without Duplicating Files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lookbook.