Giter Site home page Giter Site logo

Comments (4)

leighhalliday avatar leighhalliday commented on May 24, 2024 1

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.

allmarkedup avatar allmarkedup commented on May 24, 2024

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.

leighhalliday avatar leighhalliday commented on May 24, 2024

Thank you @allmarkedup !! I'm happy to contribute by working on this if we're on the same page regarding direction!

from lookbook.

allmarkedup avatar allmarkedup commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.