@uniformdev/richtext
Advanced tools
Comparing version 19.177.2-alpha.10 to 19.178.0
@@ -25,3 +25,2 @@ "use strict"; | ||
getLabelForFormat: () => getLabelForFormat, | ||
getRichTextTagFromTableCellHeaderState: () => getRichTextTagFromTableCellHeaderState, | ||
getRichTextTagsFromTextFormat: () => getRichTextTagsFromTextFormat, | ||
@@ -53,5 +52,2 @@ hasChildren: () => hasChildren, | ||
rootHtmlRenderer: () => rootHtmlRenderer, | ||
tableHtmlRenderer: () => tableHtmlRenderer, | ||
tablecellHtmlRenderer: () => tablecellHtmlRenderer, | ||
tablerowHtmlRenderer: () => tablerowHtmlRenderer, | ||
textHtmlRenderer: () => textHtmlRenderer, | ||
@@ -219,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 | ||
@@ -310,6 +272,3 @@ var textHtmlRenderer = ({ context }) => { | ||
["text", textHtmlRenderer], | ||
["tab", tabHtmlRenderer], | ||
["table", tableHtmlRenderer], | ||
["tablecell", tablecellHtmlRenderer], | ||
["tablerow", tablerowHtmlRenderer] | ||
["tab", tabHtmlRenderer] | ||
]); | ||
@@ -382,6 +341,3 @@ var resolveDefaultRenderer = (context) => { | ||
["listitem", listitemTextRenderer], | ||
["heading", headingTextRenderer], | ||
["table", tableTextRenderer], | ||
["tablecell", tablecellTextRenderer], | ||
["tablerow", tablerowTextRenderer] | ||
["heading", headingTextRenderer] | ||
]); | ||
@@ -490,6 +446,2 @@ var resolveDefaultRenderer2 = (context) => { | ||
{ | ||
label: "Table", | ||
type: "table" | ||
}, | ||
{ | ||
label: "Dynamic Token", | ||
@@ -546,3 +498,2 @@ type: "variable" | ||
getLabelForFormat, | ||
getRichTextTagFromTableCellHeaderState, | ||
getRichTextTagsFromTextFormat, | ||
@@ -574,7 +525,4 @@ hasChildren, | ||
rootHtmlRenderer, | ||
tableHtmlRenderer, | ||
tablecellHtmlRenderer, | ||
tablerowHtmlRenderer, | ||
textHtmlRenderer, | ||
walkRichTextTree | ||
}); |
@@ -61,26 +61,2 @@ import { LinkParamValue, RichTextParamValue, RichTextBuiltInElement, RichTextBuiltInFormat } from '@uniformdev/canvas'; | ||
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 { | ||
@@ -183,2 +159,2 @@ /** | ||
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 TableCellNode, type TableNode, type TableRowNode, type TextNode, 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", | ||
@@ -484,3 +440,2 @@ type: "variable" | ||
getLabelForFormat, | ||
getRichTextTagFromTableCellHeaderState, | ||
getRichTextTagsFromTextFormat, | ||
@@ -512,7 +467,4 @@ hasChildren, | ||
rootHtmlRenderer, | ||
tableHtmlRenderer, | ||
tablecellHtmlRenderer, | ||
tablerowHtmlRenderer, | ||
textHtmlRenderer, | ||
walkRichTextTree | ||
}; |
@@ -25,3 +25,2 @@ "use strict"; | ||
getLabelForFormat: () => getLabelForFormat, | ||
getRichTextTagFromTableCellHeaderState: () => getRichTextTagFromTableCellHeaderState, | ||
getRichTextTagsFromTextFormat: () => getRichTextTagsFromTextFormat, | ||
@@ -53,5 +52,2 @@ hasChildren: () => hasChildren, | ||
rootHtmlRenderer: () => rootHtmlRenderer, | ||
tableHtmlRenderer: () => tableHtmlRenderer, | ||
tablecellHtmlRenderer: () => tablecellHtmlRenderer, | ||
tablerowHtmlRenderer: () => tablerowHtmlRenderer, | ||
textHtmlRenderer: () => textHtmlRenderer, | ||
@@ -219,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 | ||
@@ -310,6 +272,3 @@ var textHtmlRenderer = ({ context }) => { | ||
["text", textHtmlRenderer], | ||
["tab", tabHtmlRenderer], | ||
["table", tableHtmlRenderer], | ||
["tablecell", tablecellHtmlRenderer], | ||
["tablerow", tablerowHtmlRenderer] | ||
["tab", tabHtmlRenderer] | ||
]); | ||
@@ -382,6 +341,3 @@ var resolveDefaultRenderer = (context) => { | ||
["listitem", listitemTextRenderer], | ||
["heading", headingTextRenderer], | ||
["table", tableTextRenderer], | ||
["tablecell", tablecellTextRenderer], | ||
["tablerow", tablerowTextRenderer] | ||
["heading", headingTextRenderer] | ||
]); | ||
@@ -490,6 +446,2 @@ var resolveDefaultRenderer2 = (context) => { | ||
{ | ||
label: "Table", | ||
type: "table" | ||
}, | ||
{ | ||
label: "Dynamic Token", | ||
@@ -546,3 +498,2 @@ type: "variable" | ||
getLabelForFormat, | ||
getRichTextTagFromTableCellHeaderState, | ||
getRichTextTagsFromTextFormat, | ||
@@ -574,7 +525,4 @@ hasChildren, | ||
rootHtmlRenderer, | ||
tableHtmlRenderer, | ||
tablecellHtmlRenderer, | ||
tablerowHtmlRenderer, | ||
textHtmlRenderer, | ||
walkRichTextTree | ||
}); |
{ | ||
"name": "@uniformdev/richtext", | ||
"version": "19.177.2-alpha.10+c9cb5f414c", | ||
"version": "19.178.0", | ||
"description": "Common functionality and types for Uniform Rich Text parameters", | ||
@@ -43,9 +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", | ||
"@uniformdev/canvas": "^19.177.2-alpha.10+c9cb5f414c", | ||
"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.178.0", | ||
"lexical": "0.16.1" | ||
}, | ||
@@ -58,3 +58,3 @@ "files": [ | ||
}, | ||
"gitHead": "c9cb5f414c41dc1d2c37dff02a5b87484901657e" | ||
"gitHead": "66721c01d9bf53917e5c4d83e2e578248e72560d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
0
71663
2059