1.0.127 • Published 6 months ago

@rustyroad/editor v1.0.127

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

m# Rusty Road Editor

This is a WYSIWYG editor for the Rusty Road web framework.

It is an optional feature of the framework, and can be used to create and edit pages in a visual way.

Installation

Run the following command in your Rusty Road project directory:

rustyroad feature add grapesjs

Usage

This will generate an edit page for each page in your project. You can access it by going to /edit/<page-name>.

Development

This is a grapesjs plugin, and is built using the tailwind version.

To build the plugin, run the following command:

npm run build

This will launch the editor, which is only good for development purposes.

Publishing

To publish the plugin, run the following command:

npm run publish

This will build the plugin, and then publish it to npm. Ensure to update the version number in package.json before publishing as well as in the rustyroad project to load the latest version.

Note

The changes you publish will be available immediately in your editor as the editor loads the plugin from unpkg.

Only the javascript file is published, if you make changes to the javascript in the html file, you will need to copy them to the editor file.

Components

This project also includes reusable UI components.

Webinar Checkout (src/components/webinar-checkout-1.js)

This component provides a Stripe-powered checkout page specifically designed for purchasing a single item, like a webinar seat.

Usage:

The component is exported as a default asynchronous function that takes a product object as an argument and returns an HTML string for the checkout page.

import webinarCheckout from './src/components/webinar-checkout-1.js';

// Example product data structure (fetch this from your API)
const product = {
    "id": 3,
    "stripe_product_id": "prod_123", // Example
    "name": "Advanced Web Development Webinar",
    "description": "Join us for an in-depth look at modern web technologies.",
    "active": true,
    "attributes": [],
    "created_at": "2024-10-13T23:26:23.360301",
    "updated_at": "2024-10-13T23:26:23.360360",
    "images": [
        "https://example.com/webinar-image.jpg" // Optional image URL
    ],
    "metadata": "{}", // Example
    "price": 99.00,
    "currency": "usd"
};

// Generate the checkout HTML
const checkoutHtml = await webinarCheckout(product);

// Inject the HTML into your page
document.getElementById('checkout-container').innerHTML = checkoutHtml;

Required Setup:

  1. Stripe Publishable Key: Replace the placeholder pk_test_YOUR_PUBLISHABLE_KEY in src/components/webinar-checkout-1.js with your actual Stripe publishable key.
  2. Server-Side Payment Intent: You must create a server-side endpoint (e.g., /api/create-payment-intent) that:
    • Accepts a product ID (or necessary details).
    • Creates a Stripe Payment Intent for the correct amount and currency.
    • Returns the clientSecret of the Payment Intent.
  3. Fetch Client Secret: Modify the component to fetch this clientSecret from your endpoint and replace the placeholder pi_123_secret_PLACEHOLDER.
  4. Confirmation URL: Update the return_url in the confirmParams within the component's JavaScript to point to your actual order confirmation page (e.g., /order-confirmation).

License

MIT

1.0.62

6 months ago

1.0.61

6 months ago

1.0.60

6 months ago

1.0.66

6 months ago

1.0.65

6 months ago

1.0.64

6 months ago

1.0.63

6 months ago

1.0.69

6 months ago

1.0.68

6 months ago

1.0.67

6 months ago

0.2.13

7 months ago

0.2.12

7 months ago

0.2.11

7 months ago

0.2.10

7 months ago

1.0.73

6 months ago

1.0.72

6 months ago

1.0.71

6 months ago

1.0.70

6 months ago

1.0.77

6 months ago

1.0.76

6 months ago

1.0.75

6 months ago

1.0.74

6 months ago

1.0.79

6 months ago

1.0.78

6 months ago

1.0.39

6 months ago

1.0.38

6 months ago

1.0.40

6 months ago

1.0.44

6 months ago

1.0.43

6 months ago

1.0.42

6 months ago

1.0.41

6 months ago

1.0.48

6 months ago

1.0.47

6 months ago

1.0.46

6 months ago

1.0.45

6 months ago

1.0.49

6 months ago

1.0.51

6 months ago

1.0.50

6 months ago

1.0.55

6 months ago

1.0.54

6 months ago

1.0.53

6 months ago

1.0.52

6 months ago

1.0.59

6 months ago

1.0.58

6 months ago

1.0.57

6 months ago

1.0.56

6 months ago

1.0.19

6 months ago

1.0.2

6 months ago

1.0.18

6 months ago

1.0.1

6 months ago

1.0.101

6 months ago

1.0.17

6 months ago

1.0.0

6 months ago

1.0.100

6 months ago

1.0.16

6 months ago

1.0.107

6 months ago

1.0.106

6 months ago

1.0.9

6 months ago

1.0.109

6 months ago

1.0.8

6 months ago

1.0.108

6 months ago

1.0.7

6 months ago

1.0.103

6 months ago

1.0.6

6 months ago

1.0.102

6 months ago

1.0.5

6 months ago

1.0.105

6 months ago

1.0.4

6 months ago

1.0.104

6 months ago

1.0.3

6 months ago

1.0.22

6 months ago

1.0.21

6 months ago

1.0.20

6 months ago

1.0.26

6 months ago

1.0.25

6 months ago

1.0.24

6 months ago

1.0.23

6 months ago

1.0.29

6 months ago

1.0.28

6 months ago

1.0.27

6 months ago

1.0.33

6 months ago

1.0.32

6 months ago

1.0.31

6 months ago

1.0.30

6 months ago

1.0.37

6 months ago

1.0.36

6 months ago

1.0.35

6 months ago

1.0.34

6 months ago

1.0.121

6 months ago

1.0.120

6 months ago

1.0.123

6 months ago

1.0.122

6 months ago

1.0.125

6 months ago

1.0.124

6 months ago

1.0.127

6 months ago

1.0.126

6 months ago

1.0.80

6 months ago

1.0.84

6 months ago

1.0.83

6 months ago

1.0.82

6 months ago

1.0.81

6 months ago

1.0.88

6 months ago

1.0.87

6 months ago

1.0.86

6 months ago

1.0.85

6 months ago

1.0.89

6 months ago

1.0.110

6 months ago

1.0.112

6 months ago

1.0.111

6 months ago

1.0.114

6 months ago

1.0.113

6 months ago

1.0.115

6 months ago

1.0.91

6 months ago

1.0.90

6 months ago

1.0.95

6 months ago

1.0.94

6 months ago

1.0.93

6 months ago

1.0.92

6 months ago

1.0.99

6 months ago

1.0.11

6 months ago

0.2.7

7 months ago

1.0.98

6 months ago

1.0.10

6 months ago

1.0.97

6 months ago

0.2.9

7 months ago

1.0.96

6 months ago

0.2.8

7 months ago

1.0.15

6 months ago

1.0.14

6 months ago

1.0.13

6 months ago

1.0.12

6 months ago

0.2.1

1 year ago

0.2.6

1 year ago

0.2.3

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.0.2

2 years ago

0.0.1-alpha.0

2 years ago

0.0.1

2 years ago