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

@lexical/code

Package Overview
Dependencies
Maintainers
6
Versions
222
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/code - npm Package Compare versions

Comparing version 0.6.4 to 0.6.5

1

CodeHighlighter.d.ts

@@ -20,2 +20,3 @@ /**

import 'prismjs/components/prism-swift';
import 'prismjs/components/prism-typescript';
import { TextNode } from 'lexical';

@@ -22,0 +23,0 @@ declare type TokenContent = string | Token | (string | Token)[];

@@ -20,2 +20,3 @@ /**

import 'prismjs/components/prism-swift';
import 'prismjs/components/prism-typescript';
export declare const DEFAULT_CODE_LANGUAGE = "javascript";

@@ -22,0 +23,0 @@ declare type SerializedCodeHighlightNode = Spread<{

@@ -21,2 +21,3 @@ /**

import 'prismjs/components/prism-swift';
import 'prismjs/components/prism-typescript';
import { ElementNode } from 'lexical';

@@ -23,0 +24,0 @@ export declare type SerializedCodeNode = Spread<{

5

LexicalCode.dev.js

@@ -21,2 +21,3 @@ /**

require('prismjs/components/prism-swift');
require('prismjs/components/prism-typescript');
var utils = require('@lexical/utils');

@@ -46,2 +47,3 @@ var lexical = require('lexical');

swift: 'Swift',
typescript: 'TypeScript',
xml: 'XML'

@@ -54,3 +56,4 @@ };

python: 'py',
text: 'plain'
text: 'plain',
ts: 'typescript'
};

@@ -57,0 +60,0 @@ function normalizeCodeLang(lang) {

@@ -8,3 +8,3 @@ /**

'use strict';var e=require("prismjs");require("prismjs/components/prism-clike");require("prismjs/components/prism-javascript");require("prismjs/components/prism-markup");require("prismjs/components/prism-markdown");require("prismjs/components/prism-c");require("prismjs/components/prism-css");require("prismjs/components/prism-objectivec");require("prismjs/components/prism-sql");require("prismjs/components/prism-python");require("prismjs/components/prism-rust");require("prismjs/components/prism-swift");
var n=require("@lexical/utils"),u=require("lexical");let v={c:"C",clike:"C-like",css:"CSS",html:"HTML",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",xml:"XML"},x={javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain"};function y(a){return x[a]||a}
require("prismjs/components/prism-typescript");var n=require("@lexical/utils"),u=require("lexical");let v={c:"C",clike:"C-like",css:"CSS",html:"HTML",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},x={javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function y(a){return x[a]||a}
class z extends u.TextNode{constructor(a,b,c){super(a,c);this.__highlightType=b}static getType(){return"code-highlight"}static clone(a){return new z(a.__text,a.__highlightType||void 0,a.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(a){let b=super.createDOM(a);a=A(a.theme,this.__highlightType);n.addClassNamesToElement(b,a);return b}updateDOM(a,b,c){let d=super.updateDOM(a,b,c);a=A(c.theme,a.__highlightType);c=A(c.theme,this.__highlightType);a!==c&&(a&&n.removeClassNamesFromElement(b,

@@ -11,0 +11,0 @@ a),c&&n.addClassNamesToElement(b,c));return d}static importJSON(a){let b=B(a.text,a.highlightType);b.setFormat(a.format);b.setDetail(a.detail);b.setMode(a.mode);b.setStyle(a.style);return b}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(){return this}}function A(a,b){return b&&a&&a.codeHighlight&&a.codeHighlight[b]}function B(a,b){return u.$applyNodeReplacement(new z(a,b))}function C(a){return a instanceof z}

@@ -11,9 +11,9 @@ {

"license": "MIT",
"version": "0.6.4",
"version": "0.6.5",
"main": "LexicalCode.js",
"peerDependencies": {
"lexical": "0.6.4"
"lexical": "0.6.5"
},
"dependencies": {
"@lexical/utils": "0.6.4",
"@lexical/utils": "0.6.5",
"prismjs": "^1.27.0"

@@ -20,0 +20,0 @@ },

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