Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tiptap/extension-image

Package Overview
Dependencies
Maintainers
4
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-image - npm Package Compare versions

Comparing version 2.3.2 to 2.4.0

7

dist/index.js
import { Node, mergeAttributes, nodeInputRule } from '@tiptap/core';
/**
* Matches an image to a ![image](src "title") on input.
*/
const inputRegex = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;
/**
* This extension allows you to insert images.
* @see https://www.tiptap.dev/api/nodes/image
*/
const Image = Node.create({

@@ -5,0 +12,0 @@ name: 'image',

@@ -7,3 +7,10 @@ (function (global, factory) {

/**
* Matches an image to a ![image](src "title") on input.
*/
const inputRegex = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;
/**
* This extension allows you to insert images.
* @see https://www.tiptap.dev/api/nodes/image
*/
const Image = core.Node.create({

@@ -10,0 +17,0 @@ name: 'image',

import { Node } from '@tiptap/core';
export interface ImageOptions {
/**
* Controls if the image node should be inline or not.
* @default false
* @example true
*/
inline: boolean;
/**
* Controls if base64 images are allowed. Enable this if you want to allow
* base64 image urls in the `src` attribute.
* @default false
* @example true
*/
allowBase64: boolean;
/**
* HTML attributes to add to the image element.
* @default {}
* @example { class: 'foo' }
*/
HTMLAttributes: Record<string, any>;

@@ -12,2 +28,7 @@ }

* Add an image
* @param options The image attributes
* @example
* editor
* .commands
* .setImage({ src: 'https://tiptap.dev/logo.png', alt: 'tiptap', title: 'tiptap logo' })
*/

@@ -22,3 +43,10 @@ setImage: (options: {

}
/**
* Matches an image to a ![image](src "title") on input.
*/
export declare const inputRegex: RegExp;
/**
* This extension allows you to insert images.
* @see https://www.tiptap.dev/api/nodes/image
*/
export declare const Image: Node<ImageOptions, any>;

4

package.json
{
"name": "@tiptap/extension-image",
"description": "image extension for tiptap",
"version": "2.3.2",
"version": "2.4.0",
"homepage": "https://tiptap.dev",

@@ -32,3 +32,3 @@ "keywords": [

"devDependencies": {
"@tiptap/core": "^2.3.2"
"@tiptap/core": "^2.4.0"
},

@@ -35,0 +35,0 @@ "peerDependencies": {

@@ -8,4 +8,22 @@ import {

export interface ImageOptions {
/**
* Controls if the image node should be inline or not.
* @default false
* @example true
*/
inline: boolean,
/**
* Controls if base64 images are allowed. Enable this if you want to allow
* base64 image urls in the `src` attribute.
* @default false
* @example true
*/
allowBase64: boolean,
/**
* HTML attributes to add to the image element.
* @default {}
* @example { class: 'foo' }
*/
HTMLAttributes: Record<string, any>,

@@ -19,2 +37,7 @@ }

* Add an image
* @param options The image attributes
* @example
* editor
* .commands
* .setImage({ src: 'https://tiptap.dev/logo.png', alt: 'tiptap', title: 'tiptap logo' })
*/

@@ -26,4 +49,11 @@ setImage: (options: { src: string, alt?: string, title?: string }) => ReturnType,

/**
* Matches an image to a ![image](src "title") on input.
*/
export const inputRegex = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/
/**
* This extension allows you to insert images.
* @see https://www.tiptap.dev/api/nodes/image
*/
export const Image = Node.create<ImageOptions>({

@@ -30,0 +60,0 @@ name: 'image',

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc