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

@uniformdev/richtext

Package Overview
Dependencies
Maintainers
0
Versions
429
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uniformdev/richtext - npm Package Compare versions

Comparing version 19.178.2-alpha.25 to 19.179.1-alpha.1

79

./dist/index.js

@@ -23,6 +23,4 @@ "use strict";

__export(src_exports, {
emptyRichTextValue: () => emptyRichTextValue,
getLabelForElement: () => getLabelForElement,
getLabelForFormat: () => getLabelForFormat,
getRichTextTagFromTableCellHeaderState: () => getRichTextTagFromTableCellHeaderState,
getRichTextTagsFromTextFormat: () => getRichTextTagsFromTextFormat,

@@ -54,5 +52,2 @@ hasChildren: () => hasChildren,

rootHtmlRenderer: () => rootHtmlRenderer,
tableHtmlRenderer: () => tableHtmlRenderer,
tablecellHtmlRenderer: () => tablecellHtmlRenderer,
tablerowHtmlRenderer: () => tablerowHtmlRenderer,
textHtmlRenderer: () => textHtmlRenderer,

@@ -220,36 +215,2 @@ walkRichTextTree: () => walkRichTextTree

// src/nodes/table.ts
var tableHtmlRenderer = ({ context, renderChildren }) => {
return ["table", "tbody"].reduceRight((children, tag) => {
return renderHtmlElement(tag, null, children);
}, renderChildren(context.currentNode.children));
};
var tableTextRenderer = ({ context, renderChildren }) => {
return hasChildren(context.currentNode) ? `${renderChildren(context.currentNode.children)} ` : "";
};
// src/nodes/tablecell.ts
var tablecellHtmlRenderer = ({ context, renderChildren }) => {
const node = context.currentNode;
const tag = getRichTextTagFromTableCellHeaderState(node.headerState);
return renderHtmlElement(tag, null, renderChildren(context.currentNode.children));
};
var tablecellTextRenderer = ({ context, renderChildren }) => {
return hasChildren(context.currentNode) ? `${renderChildren(context.currentNode.children)} ` : "";
};
function getRichTextTagFromTableCellHeaderState(headerState) {
if (headerState === 0) {
return "td";
}
return "th";
}
// src/nodes/tablerow.ts
var tablerowHtmlRenderer = ({ context, renderChildren }) => {
return renderHtmlElement("tr", null, renderChildren(context.currentNode.children));
};
var tablerowTextRenderer = ({ context, renderChildren }) => {
return hasChildren(context.currentNode) ? `${renderChildren(context.currentNode.children)} ` : "";
};
// src/nodes/text.ts

@@ -311,6 +272,3 @@ var textHtmlRenderer = ({ context }) => {

["text", textHtmlRenderer],
["tab", tabHtmlRenderer],
["table", tableHtmlRenderer],
["tablecell", tablecellHtmlRenderer],
["tablerow", tablerowHtmlRenderer]
["tab", tabHtmlRenderer]
]);

@@ -383,6 +341,3 @@ var resolveDefaultRenderer = (context) => {

["listitem", listitemTextRenderer],
["heading", headingTextRenderer],
["table", tableTextRenderer],
["tablecell", tablecellTextRenderer],
["tablerow", tablerowTextRenderer]
["heading", headingTextRenderer]
]);

@@ -491,6 +446,2 @@ var resolveDefaultRenderer2 = (context) => {

{
label: "Table",
type: "table"
},
{
label: "Dynamic Token",

@@ -543,29 +494,6 @@ type: "variable"

};
var emptyRichTextValue = {
root: {
type: "root",
version: 1,
direction: null,
format: "",
indent: 0,
children: [
{
type: "paragraph",
version: 1,
format: "start",
indent: 0,
direction: null,
children: [],
textFormat: 0,
textStyle: ""
}
]
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
emptyRichTextValue,
getLabelForElement,
getLabelForFormat,
getRichTextTagFromTableCellHeaderState,
getRichTextTagsFromTextFormat,

@@ -597,7 +525,4 @@ hasChildren,

rootHtmlRenderer,
tableHtmlRenderer,
tablecellHtmlRenderer,
tablerowHtmlRenderer,
textHtmlRenderer,
walkRichTextTree
});

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

import { SerializedEditorState, SerializedParagraphNode } from 'lexical';
import { LinkParamValue, RichTextParamValue, RichTextBuiltInElement, RichTextBuiltInFormat } from '@uniformdev/canvas';

@@ -27,5 +27,5 @@ declare function purifyText(text: string): string;

type NodeStringRenderer = (props: NodeStringRendererProps) => string;
type ParameterRichTextValue = SerializedEditorState | undefined | null;
type RichTextBuiltInFormat = 'code' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'superscript' | 'subscript';
type RichTextBuiltInElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'unorderedList' | 'orderedList' | 'link' | 'quote' | 'code' | 'variable' | 'table';
type ParameterRichTextValue = {
root: RichTextNode;
} | undefined;

@@ -41,15 +41,2 @@ interface HeadingNode extends RichTextNode {

declare const linkHtmlRenderer: NodeStringRenderer;
type LinkParameterType = 'projectMapNode' | 'url' | 'tel' | 'email';
type ProjectMapLinkParamValue = {
type: 'projectMapNode';
projectMapId: string;
nodeId: string;
path: string;
dynamicInputValues?: Record<string, string>;
};
type NonProjectMapLinkParamValue = {
type: Exclude<LinkParameterType, 'projectMapNode'>;
path: string;
};
type LinkParamValue = ProjectMapLinkParamValue | NonProjectMapLinkParamValue | undefined;
declare function linkParamValueToHref(link: LinkParamValue): string | undefined;

@@ -76,26 +63,2 @@

interface TableNode extends RichTextNode {
}
declare const tableHtmlRenderer: NodeStringRenderer;
interface TableCellNode extends RichTextNode {
/**
* headerState:
* 0: no header
* 1: row header
* 2: column header
* 3: row and column header
*/
headerState: number;
}
declare const tablecellHtmlRenderer: NodeStringRenderer;
/**
* Convert headerState into relevant tag
*/
declare function getRichTextTagFromTableCellHeaderState(headerState: number): "td" | "th";
interface TableRowNode extends RichTextNode {
}
declare const tablerowHtmlRenderer: NodeStringRenderer;
interface TextNode extends RichTextNode {

@@ -125,3 +88,3 @@ /**

declare function isRichTextNode(node: unknown): node is RichTextNode;
declare function isRichTextValue(value: unknown): value is NonNullable<ParameterRichTextValue>;
declare function isRichTextValue(value: unknown): value is NonNullable<RichTextParamValue>;
declare function isRichTextNodeType(node: unknown, type: 'heading'): node is HeadingNode;

@@ -134,3 +97,3 @@ declare function isRichTextNodeType(node: unknown, type: 'paragraph'): node is ParagraphNode;

declare function isRichTextNodeType(node: unknown, type: string): node is RichTextNode;
declare function isRichTextValueConsideredEmpty(value: ParameterRichTextValue): boolean;
declare function isRichTextValueConsideredEmpty(value: RichTextParamValue): boolean;
declare function hasChildren<TRichTextNode extends RichTextNode>(node: TRichTextNode): node is TRichTextNode & {

@@ -199,13 +162,3 @@ children: RichTextNode[];

declare const getLabelForFormat: (type: string) => string;
declare const emptyRichTextValue: {
root: {
type: string;
version: number;
direction: null;
format: "";
indent: number;
children: SerializedParagraphNode[];
};
};
export { type HeadingNode, type LinkNode, type ListItemNode, type ListNode, type NodeStringRenderer, type NodeStringRendererProps, type ParagraphNode, type ParameterRichTextValue, type ResolveStringRenderer, type RichTextBuiltInElement, type RichTextBuiltInFormat, type RichTextNode, type RichTextNodeWithChildren, type StringRenderContext, type TableCellNode, type TableNode, type TableRowNode, type TextNode, emptyRichTextValue, getLabelForElement, getLabelForFormat, getRichTextTagFromTableCellHeaderState, getRichTextTagsFromTextFormat, hasChildren, headingHtmlRenderer, isArrayWithLength, isPureDirection, isPureTextAlign, isRichTextNode, isRichTextNodeType, isRichTextValue, isRichTextValueConsideredEmpty, linkHtmlRenderer, linkParamValueToHref, listHtmlRenderer, listitemHtmlRenderer, paragraphHtmlRenderer, purifyText, renderChildrenToHtml, renderChildrenToText, renderHtmlElement, renderToHtml, renderToText, resolveDefaultRenderer$1 as resolveDefaultHtmlRenderer, resolveDefaultRenderer as resolveDefaultTextRenderer, richTextBuiltInElements, richTextBuiltInFormats, rootHtmlRenderer, tableHtmlRenderer, tablecellHtmlRenderer, tablerowHtmlRenderer, textHtmlRenderer, walkRichTextTree };
export { type HeadingNode, type LinkNode, type ListItemNode, type ListNode, type NodeStringRenderer, type NodeStringRendererProps, type ParagraphNode, type ParameterRichTextValue, type ResolveStringRenderer, type RichTextNode, type RichTextNodeWithChildren, type StringRenderContext, type TextNode, getLabelForElement, getLabelForFormat, getRichTextTagsFromTextFormat, hasChildren, headingHtmlRenderer, isArrayWithLength, isPureDirection, isPureTextAlign, isRichTextNode, isRichTextNodeType, isRichTextValue, isRichTextValueConsideredEmpty, linkHtmlRenderer, linkParamValueToHref, listHtmlRenderer, listitemHtmlRenderer, paragraphHtmlRenderer, purifyText, renderChildrenToHtml, renderChildrenToText, renderHtmlElement, renderToHtml, renderToText, resolveDefaultRenderer$1 as resolveDefaultHtmlRenderer, resolveDefaultRenderer as resolveDefaultTextRenderer, richTextBuiltInElements, richTextBuiltInFormats, rootHtmlRenderer, textHtmlRenderer, walkRichTextTree };

@@ -158,36 +158,2 @@ // src/elements.ts

// src/nodes/table.ts
var tableHtmlRenderer = ({ context, renderChildren }) => {
return ["table", "tbody"].reduceRight((children, tag) => {
return renderHtmlElement(tag, null, children);
}, renderChildren(context.currentNode.children));
};
var tableTextRenderer = ({ context, renderChildren }) => {
return hasChildren(context.currentNode) ? `${renderChildren(context.currentNode.children)} ` : "";
};
// src/nodes/tablecell.ts
var tablecellHtmlRenderer = ({ context, renderChildren }) => {
const node = context.currentNode;
const tag = getRichTextTagFromTableCellHeaderState(node.headerState);
return renderHtmlElement(tag, null, renderChildren(context.currentNode.children));
};
var tablecellTextRenderer = ({ context, renderChildren }) => {
return hasChildren(context.currentNode) ? `${renderChildren(context.currentNode.children)} ` : "";
};
function getRichTextTagFromTableCellHeaderState(headerState) {
if (headerState === 0) {
return "td";
}
return "th";
}
// src/nodes/tablerow.ts
var tablerowHtmlRenderer = ({ context, renderChildren }) => {
return renderHtmlElement("tr", null, renderChildren(context.currentNode.children));
};
var tablerowTextRenderer = ({ context, renderChildren }) => {
return hasChildren(context.currentNode) ? `${renderChildren(context.currentNode.children)} ` : "";
};
// src/nodes/text.ts

@@ -249,6 +215,3 @@ var textHtmlRenderer = ({ context }) => {

["text", textHtmlRenderer],
["tab", tabHtmlRenderer],
["table", tableHtmlRenderer],
["tablecell", tablecellHtmlRenderer],
["tablerow", tablerowHtmlRenderer]
["tab", tabHtmlRenderer]
]);

@@ -321,6 +284,3 @@ var resolveDefaultRenderer = (context) => {

["listitem", listitemTextRenderer],
["heading", headingTextRenderer],
["table", tableTextRenderer],
["tablecell", tablecellTextRenderer],
["tablerow", tablerowTextRenderer]
["heading", headingTextRenderer]
]);

@@ -429,6 +389,2 @@ var resolveDefaultRenderer2 = (context) => {

{
label: "Table",
type: "table"
},
{
label: "Dynamic Token",

@@ -481,28 +437,5 @@ type: "variable"

};
var emptyRichTextValue = {
root: {
type: "root",
version: 1,
direction: null,
format: "",
indent: 0,
children: [
{
type: "paragraph",
version: 1,
format: "start",
indent: 0,
direction: null,
children: [],
textFormat: 0,
textStyle: ""
}
]
}
};
export {
emptyRichTextValue,
getLabelForElement,
getLabelForFormat,
getRichTextTagFromTableCellHeaderState,
getRichTextTagsFromTextFormat,

@@ -534,7 +467,4 @@ hasChildren,

rootHtmlRenderer,
tableHtmlRenderer,
tablecellHtmlRenderer,
tablerowHtmlRenderer,
textHtmlRenderer,
walkRichTextTree
};

@@ -23,6 +23,4 @@ "use strict";

__export(src_exports, {
emptyRichTextValue: () => emptyRichTextValue,
getLabelForElement: () => getLabelForElement,
getLabelForFormat: () => getLabelForFormat,
getRichTextTagFromTableCellHeaderState: () => getRichTextTagFromTableCellHeaderState,
getRichTextTagsFromTextFormat: () => getRichTextTagsFromTextFormat,

@@ -54,5 +52,2 @@ hasChildren: () => hasChildren,

rootHtmlRenderer: () => rootHtmlRenderer,
tableHtmlRenderer: () => tableHtmlRenderer,
tablecellHtmlRenderer: () => tablecellHtmlRenderer,
tablerowHtmlRenderer: () => tablerowHtmlRenderer,
textHtmlRenderer: () => textHtmlRenderer,

@@ -220,36 +215,2 @@ walkRichTextTree: () => walkRichTextTree

// src/nodes/table.ts
var tableHtmlRenderer = ({ context, renderChildren }) => {
return ["table", "tbody"].reduceRight((children, tag) => {
return renderHtmlElement(tag, null, children);
}, renderChildren(context.currentNode.children));
};
var tableTextRenderer = ({ context, renderChildren }) => {
return hasChildren(context.currentNode) ? `${renderChildren(context.currentNode.children)} ` : "";
};
// src/nodes/tablecell.ts
var tablecellHtmlRenderer = ({ context, renderChildren }) => {
const node = context.currentNode;
const tag = getRichTextTagFromTableCellHeaderState(node.headerState);
return renderHtmlElement(tag, null, renderChildren(context.currentNode.children));
};
var tablecellTextRenderer = ({ context, renderChildren }) => {
return hasChildren(context.currentNode) ? `${renderChildren(context.currentNode.children)} ` : "";
};
function getRichTextTagFromTableCellHeaderState(headerState) {
if (headerState === 0) {
return "td";
}
return "th";
}
// src/nodes/tablerow.ts
var tablerowHtmlRenderer = ({ context, renderChildren }) => {
return renderHtmlElement("tr", null, renderChildren(context.currentNode.children));
};
var tablerowTextRenderer = ({ context, renderChildren }) => {
return hasChildren(context.currentNode) ? `${renderChildren(context.currentNode.children)} ` : "";
};
// src/nodes/text.ts

@@ -311,6 +272,3 @@ var textHtmlRenderer = ({ context }) => {

["text", textHtmlRenderer],
["tab", tabHtmlRenderer],
["table", tableHtmlRenderer],
["tablecell", tablecellHtmlRenderer],
["tablerow", tablerowHtmlRenderer]
["tab", tabHtmlRenderer]
]);

@@ -383,6 +341,3 @@ var resolveDefaultRenderer = (context) => {

["listitem", listitemTextRenderer],
["heading", headingTextRenderer],
["table", tableTextRenderer],
["tablecell", tablecellTextRenderer],
["tablerow", tablerowTextRenderer]
["heading", headingTextRenderer]
]);

@@ -491,6 +446,2 @@ var resolveDefaultRenderer2 = (context) => {

{
label: "Table",
type: "table"
},
{
label: "Dynamic Token",

@@ -543,29 +494,6 @@ type: "variable"

};
var emptyRichTextValue = {
root: {
type: "root",
version: 1,
direction: null,
format: "",
indent: 0,
children: [
{
type: "paragraph",
version: 1,
format: "start",
indent: 0,
direction: null,
children: [],
textFormat: 0,
textStyle: ""
}
]
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
emptyRichTextValue,
getLabelForElement,
getLabelForFormat,
getRichTextTagFromTableCellHeaderState,
getRichTextTagsFromTextFormat,

@@ -597,7 +525,4 @@ hasChildren,

rootHtmlRenderer,
tableHtmlRenderer,
tablecellHtmlRenderer,
tablerowHtmlRenderer,
textHtmlRenderer,
walkRichTextTree
});

17

package.json
{
"name": "@uniformdev/richtext",
"version": "19.178.2-alpha.25+0f7f53f560",
"version": "19.179.1-alpha.1+3adc08c00a",
"description": "Common functionality and types for Uniform Rich Text parameters",

@@ -43,8 +43,9 @@ "license": "SEE LICENSE IN LICENSE.txt",

"devDependencies": {
"@lexical/headless": "0.17.0",
"@lexical/html": "0.17.0",
"@lexical/link": "0.17.0",
"@lexical/list": "0.17.0",
"@lexical/rich-text": "0.17.0",
"lexical": "0.17.0"
"@lexical/headless": "0.16.1",
"@lexical/html": "0.16.1",
"@lexical/link": "0.16.1",
"@lexical/list": "0.16.1",
"@lexical/rich-text": "0.16.1",
"@uniformdev/canvas": "^19.179.1-alpha.1+3adc08c00a",
"lexical": "0.16.1"
},

@@ -57,3 +58,3 @@ "files": [

},
"gitHead": "0f7f53f56071a59cee38bf83c9f3bae541846de2"
"gitHead": "3adc08c00a0d3932b6b767faaa6157f8b71ef0a0"
}

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