New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@udecode/plate-indent

Package Overview
Dependencies
Maintainers
2
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@udecode/plate-indent - npm Package Compare versions

Comparing version 10.5.3 to 11.0.0

2

CHANGELOG.md
# @udecode/plate-indent
## 11.0.0
## 10.5.3

@@ -4,0 +6,0 @@

2

dist/createIndentPlugin.d.ts
import { IndentPlugin } from './types';
export declare const KEY_INDENT = "indent";
export declare const createIndentPlugin: <T = {}>(override?: Partial<import("@udecode/plate-core").PlatePlugin<T, IndentPlugin>> | undefined, overrideByKey?: import("@udecode/plate-core").OverrideByKey<T> | undefined) => import("@udecode/plate-core").PlatePlugin<T, IndentPlugin>;
export declare const createIndentPlugin: <V extends import("@udecode/plate-core").Value, E extends import("@udecode/plate-core").PlateEditor<V> = import("@udecode/plate-core").PlateEditor<V>>(override?: Partial<import("@udecode/plate-core").PlatePlugin<IndentPlugin, V, E>> | undefined, overrideByKey?: import("@udecode/plate-core").OverrideByKey<V, E> | undefined) => import("@udecode/plate-core").PlatePlugin<IndentPlugin, V, E>;
//# sourceMappingURL=createIndentPlugin.d.ts.map
import { IndentPlugin } from './types';
export declare const KEY_TEXT_INDENT = "textIndent";
export declare const createTextIndentPlugin: <T = {}>(override?: Partial<import("@udecode/plate-core").PlatePlugin<T, IndentPlugin>> | undefined, overrideByKey?: import("@udecode/plate-core").OverrideByKey<T> | undefined) => import("@udecode/plate-core").PlatePlugin<T, IndentPlugin>;
export declare const createTextIndentPlugin: <V extends import("@udecode/plate-core").Value, E extends import("@udecode/plate-core").PlateEditor<V> = import("@udecode/plate-core").PlateEditor<V>>(override?: Partial<import("@udecode/plate-core").PlatePlugin<IndentPlugin, V, E>> | undefined, overrideByKey?: import("@udecode/plate-core").OverrideByKey<V, E> | undefined) => import("@udecode/plate-core").PlatePlugin<IndentPlugin, V, E>;
//# sourceMappingURL=createTextIndentPlugin.d.ts.map

@@ -1,3 +0,2 @@

import { getPluginInjectProps, getNodes, withoutNormalizing, setNodes, createPluginFactory, getPluginType, ELEMENT_DEFAULT } from '@udecode/plate-core';
import { Transforms } from 'slate';
import { getPluginInjectProps, getNodeEntries, withoutNormalizing, unsetNodes, setElements, setNodes, createPluginFactory, getPluginType, ELEMENT_DEFAULT } from '@udecode/plate-core';

@@ -17,3 +16,3 @@ /**

const _nodes = getNodes(editor, {
const _nodes = getNodeEntries(editor, {
block: true,

@@ -26,5 +25,5 @@ ...getNodesOptions

nodes.forEach(([node, path]) => {
var _node, _setNodesProps;
var _ref, _setNodesProps;
const blockIndent = (_node = node[nodeKey]) !== null && _node !== void 0 ? _node : 0;
const blockIndent = (_ref = node[nodeKey]) !== null && _ref !== void 0 ? _ref : 0;
const newIndent = blockIndent + offset;

@@ -36,7 +35,7 @@ const props = (_setNodesProps = setNodesProps === null || setNodesProps === void 0 ? void 0 : setNodesProps({

if (newIndent <= 0) {
Transforms.unsetNodes(editor, [nodeKey, ...unsetNodesProps], {
unsetNodes(editor, [nodeKey, ...unsetNodesProps], {
at: path
});
} else {
setNodes(editor, {
setElements(editor, {
[nodeKey]: newIndent,

@@ -116,3 +115,3 @@ ...props

} else if (element.indent) {
Transforms.unsetNodes(editor, 'indent', {
unsetNodes(editor, 'indent', {
at: path

@@ -119,0 +118,0 @@ });

@@ -6,3 +6,2 @@ 'use strict';

var plateCore = require('@udecode/plate-core');
var slate = require('slate');

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

const _nodes = plateCore.getNodes(editor, {
const _nodes = plateCore.getNodeEntries(editor, {
block: true,

@@ -31,5 +30,5 @@ ...getNodesOptions

nodes.forEach(([node, path]) => {
var _node, _setNodesProps;
var _ref, _setNodesProps;
const blockIndent = (_node = node[nodeKey]) !== null && _node !== void 0 ? _node : 0;
const blockIndent = (_ref = node[nodeKey]) !== null && _ref !== void 0 ? _ref : 0;
const newIndent = blockIndent + offset;

@@ -41,7 +40,7 @@ const props = (_setNodesProps = setNodesProps === null || setNodesProps === void 0 ? void 0 : setNodesProps({

if (newIndent <= 0) {
slate.Transforms.unsetNodes(editor, [nodeKey, ...unsetNodesProps], {
plateCore.unsetNodes(editor, [nodeKey, ...unsetNodesProps], {
at: path
});
} else {
plateCore.setNodes(editor, {
plateCore.setElements(editor, {
[nodeKey]: newIndent,

@@ -121,3 +120,3 @@ ...props

} else if (element.indent) {
slate.Transforms.unsetNodes(editor, 'indent', {
plateCore.unsetNodes(editor, 'indent', {
at: path

@@ -124,0 +123,0 @@ });

@@ -1,2 +0,2 @@

import { PlateEditor } from '@udecode/plate-core';
import { PlateEditor, Value } from '@udecode/plate-core';
import { SetIndentOptions } from './setIndent';

@@ -6,3 +6,3 @@ /**

*/
export declare const indent: (editor: PlateEditor, options?: SetIndentOptions | undefined) => void;
export declare const indent: <V extends Value>(editor: PlateEditor<V>, options?: SetIndentOptions<V> | undefined) => void;
//# sourceMappingURL=indent.d.ts.map

@@ -1,2 +0,2 @@

import { PlateEditor } from '@udecode/plate-core';
import { PlateEditor, Value } from '@udecode/plate-core';
import { SetIndentOptions } from './setIndent';

@@ -6,3 +6,3 @@ /**

*/
export declare const outdent: (editor: PlateEditor, options?: SetIndentOptions | undefined) => void;
export declare const outdent: <V extends Value>(editor: PlateEditor<V>, options?: SetIndentOptions<V> | undefined) => void;
//# sourceMappingURL=outdent.d.ts.map

@@ -1,3 +0,3 @@

import { AnyObject, EditorNodesOptions, PlateEditor, UnhangRangeOptions } from '@udecode/plate-core';
export interface SetIndentOptions {
import { AnyObject, EditorNodesOptions, PlateEditor, UnhangRangeOptions, Value } from '@udecode/plate-core';
export interface SetIndentOptions<V extends Value> {
/**

@@ -10,5 +10,5 @@ * 1 to indent

/**
* getNodes options
* getNodeEntries options
*/
getNodesOptions?: EditorNodesOptions & UnhangRangeOptions;
getNodesOptions?: EditorNodesOptions<V> & UnhangRangeOptions;
/**

@@ -29,3 +29,3 @@ * Set other props than the indent one.

*/
export declare const setIndent: (editor: PlateEditor, { offset, getNodesOptions, setNodesProps, unsetNodesProps, }: SetIndentOptions) => void;
export declare const setIndent: <V extends Value>(editor: PlateEditor<V>, { offset, getNodesOptions, setNodesProps, unsetNodesProps, }: SetIndentOptions<V>) => void;
//# sourceMappingURL=setIndent.d.ts.map

@@ -0,1 +1,5 @@

import { TElement } from '@udecode/plate-core';
export interface TIndentElement extends TElement {
indent: number;
}
export declare type IndentPlugin = {

@@ -2,0 +6,0 @@ /**

@@ -7,3 +7,3 @@ import { WithOverride } from '@udecode/plate-core';

*/
export declare const withIndent: WithOverride<{}, IndentPlugin>;
export declare const withIndent: WithOverride<IndentPlugin>;
//# sourceMappingURL=withIndent.d.ts.map
{
"name": "@udecode/plate-indent",
"version": "10.5.3",
"version": "11.0.0",
"description": "Indent plugin for Plate",

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

"dependencies": {
"@udecode/plate-core": "10.5.3"
"@udecode/plate-core": "11.0.0"
},

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

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

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

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