@uniformdev/richtext 20.34.3-alpha.70 → 20.35.1-alpha.188

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -28,7 +28,7 @@ type NodeStringRenderer = (props: NodeStringRendererProps) => string;
28
28
  type ParameterRichTextValue = SerializedEditorState | undefined | null;
29
29
  type RichTextBuiltInFormat = 'code' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'superscript' | 'subscript';
30
30
  type RichTextBuiltInElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'unorderedList' | 'orderedList' | 'link' | 'quote' | 'code' | 'variable' | 'table' | 'asset';
31
- type RichTextParamConfiguration = {
31
+ interface RichTextParamConfiguration {
32
32
  required?: boolean;
33
33
  formatting?: {
34
34
  builtIn?: Array<RichTextBuiltInFormat>;
@@ -41,7 +41,7 @@ type RichTextParamConfiguration = {
41
41
  allowedTypes?: AssetDefinitionType[];
42
42
  };
43
43
  };
44
- };
44
+ }
45
45
 
46
46
  interface AssetNode extends RichTextNode {
47
47
  __asset?: NonNullable<AssetParamValueItem>;
package/dist/index.d.ts CHANGED
@@ -28,7 +28,7 @@ type NodeStringRenderer = (props: NodeStringRendererProps) => string;
28
28
  type ParameterRichTextValue = SerializedEditorState | undefined | null;
29
29
  type RichTextBuiltInFormat = 'code' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'superscript' | 'subscript';
30
30
  type RichTextBuiltInElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'unorderedList' | 'orderedList' | 'link' | 'quote' | 'code' | 'variable' | 'table' | 'asset';
31
- type RichTextParamConfiguration = {
31
+ interface RichTextParamConfiguration {
32
32
  required?: boolean;
33
33
  formatting?: {
34
34
  builtIn?: Array<RichTextBuiltInFormat>;
@@ -41,7 +41,7 @@ type RichTextParamConfiguration = {
41
41
  allowedTypes?: AssetDefinitionType[];
42
42
  };
43
43
  };
44
- };
44
+ }
45
45
 
46
46
  interface AssetNode extends RichTextNode {
47
47
  __asset?: NonNullable<AssetParamValueItem>;
package/dist/index.esm.js CHANGED
@@ -60,7 +60,7 @@ function isRichTextValueConsideredEmpty(value) {
60
60
  if (!isRichTextNodeType(child, "paragraph")) {
61
61
  return false;
62
62
  }
63
- return child.children === void 0 || child.children.length === 0;
63
+ return !hasChildren(child);
64
64
  }
65
65
  function hasChildren(node) {
66
66
  return "children" in node && isArrayWithLength(node.children);
package/dist/index.js CHANGED
@@ -122,7 +122,7 @@ function isRichTextValueConsideredEmpty(value) {
122
122
  if (!isRichTextNodeType(child, "paragraph")) {
123
123
  return false;
124
124
  }
125
- return child.children === void 0 || child.children.length === 0;
125
+ return !hasChildren(child);
126
126
  }
127
127
  function hasChildren(node) {
128
128
  return "children" in node && isArrayWithLength(node.children);
package/dist/index.mjs CHANGED
@@ -60,7 +60,7 @@ function isRichTextValueConsideredEmpty(value) {
60
60
  if (!isRichTextNodeType(child, "paragraph")) {
61
61
  return false;
62
62
  }
63
- return child.children === void 0 || child.children.length === 0;
63
+ return !hasChildren(child);
64
64
  }
65
65
  function hasChildren(node) {
66
66
  return "children" in node && isArrayWithLength(node.children);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/richtext",
3
- "version": "20.34.3-alpha.70+bc3f8ba0f4",
3
+ "version": "20.35.1-alpha.188+c2a5b9c45f",
4
4
  "description": "Common functionality and types for Uniform Rich Text parameters",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -34,19 +34,19 @@
34
34
  "dev": "run-s dev:ts",
35
35
  "dev:ts": "tsup --watch",
36
36
  "clean": "rimraf dist",
37
- "test": "jest --maxWorkers=1",
37
+ "test": "vitest run",
38
38
  "lint": "eslint \"src/**/*.{js,ts,tsx}\"",
39
39
  "format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
40
40
  "document:prebuild": "api-extractor run --local"
41
41
  },
42
42
  "devDependencies": {
43
- "@lexical/headless": "0.25.0",
44
- "@lexical/html": "0.25.0",
45
- "@lexical/link": "0.25.0",
46
- "@lexical/list": "0.25.0",
47
- "@lexical/rich-text": "0.25.0",
48
- "@uniformdev/assets": "20.34.3-alpha.70+bc3f8ba0f4",
49
- "lexical": "0.25.0"
43
+ "@lexical/headless": "0.37.0",
44
+ "@lexical/html": "0.37.0",
45
+ "@lexical/link": "0.37.0",
46
+ "@lexical/list": "0.37.0",
47
+ "@lexical/rich-text": "0.37.0",
48
+ "@uniformdev/assets": "20.35.1-alpha.188+c2a5b9c45f",
49
+ "lexical": "0.37.0"
50
50
  },
51
51
  "files": [
52
52
  "/dist"
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "bc3f8ba0f4719673f92d9e8c48c3818dc439c364"
57
+ "gitHead": "c2a5b9c45fdbcd3199fba23e38beaf7ca0388c35"
58
58
  }