Git Product home page Git Product logo

filament-peek's Introduction

Peek

Build Status Latest Stable Version Total Downloads License

A Filament plugin to add a full-screen preview modal to your Panel pages. The modal can be used before saving to preview a modified record.

Screenshots of the edit page and preview modal

Installation

You can install the package via composer:

composer require pboivin/filament-peek:"^2.0"

Register a FilamentPeekPlugin instance in your Panel provider:

use Pboivin\FilamentPeek\FilamentPeekPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            FilamentPeekPlugin::make(),
        ]);
}

Then, publish the assets:

php artisan filament:assets

Upgrading from 1.x

Follow the steps in the Upgrade Guide.

Compatibility

Peek Status Filament PHP
1.x Bugfixes only ^2.0 ^8.0
2.x Current version ^3.0 ^8.1

Please feel free to report any issues you encounter with Peek in this repository. I'll work with you to determine where the issue is coming from.

Demo Projects

Here are a few example projects available to give this plugin a try:

Repository Description
filament-peek-demo Content previews on a simple Filament project with Laravel Blade views.
filament-peek-demo-with-astro Content previews on a more complex project with Filament as "headless CMS", and Astro on the front-end. (Work in progress)
Log1x/filament-starter A great starting point for TALL stack projects using Filament. Implements content previews using full-page Livewire components.

Documentation

The documentation is available in the 'docs' directory on GitHub:

FAQ and Known Issues

I've started compiling some notes and solutions to common issues in Discussions. Feel free to contribute your own tips and tricks.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

Acknowledgements

The initial idea is heavily inspired by module previews in Twill CMS.

License

The MIT License (MIT). Please see License File for more information.

filament-peek's People

Contributors

atmonshi avatar bambamboole avatar dependabot[bot] avatar fdt2k avatar github-actions[bot] avatar kennyhorna avatar pboivin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

filament-peek's Issues

[v1.1.0] Possible problem in Safari

Hello, i have admin panel on domain ex: admin.com and Next.js project on front.com
So i use preview like this https://github.com/pboivin/filament-peek/blob/2.x/docs/page-previews.md#filament-as-headless-cms

in Chrome everything is working, but in Safari i see 404 error with console errors

Blocked a frame with origin "front.com" from accessing a frame with origin "admin.com". Protocols, domains, and ports must match.

SecurityError: Blocked a frame with origin "admin.com" from accessing a cross-origin frame. Protocols, domains, and ports must match.

Also, open preview link in safari - everything is working again. Only in Preview i have errors

not working in view page.

following up with #3

it worked by adding to my view page

    protected function preparePreviewModalData(): array
    {
        return [
            $this->getPreviewModalDataRecordKey() => $this->getRecord(),
            'isPeekPreviewModal' => true,
        ];
    }

Issues with Builder Preview

Hello there,

I hope you're doing well.

I noticed that there's an issue with Builder Preview. If you click on the builder preview multiple times, instead of opening the builder preview it will open the preview Modal.

You can reproduce this in the demo itself, I used https://github.com/pboivin/filament-peek-demo and was able to replicate it.

Steps to replicate:

1 - Setup the demo locally by following the documentation in https://github.com/pboivin/filament-peek-demo
2 - Go to any post entry (for example, http://127.0.0.1:8000/admin/posts/1/edit)
3 - Click on Preview Content Blocks

  • The Builder Preview will open which is the expected behavior
    4 - Now Click on Discard, and click on the same button Preview Content Blocks
  • The Preview Modal will show instead of the Builder Preview. Which is not the expected Behavior.

Is this a known issue or just me facing it?

Kindest Regards,

Moustafa

Scrolling Not Allowed By Default

The README states:

By default, only scrolling is allowed in the preview iframe.

This appears to not be the case. When allowIframePointerEvents config is set to false the iframe gets the pointer-events: none CSS property set which prevents all interaction with the iframe including scrolling.

Tested in FireFox and Chromium.

It appears the only way to get scrolling and nothing else is to add the pointer-events declaration to the template as described further on in the README.

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.