@portabletext/block-tools 4.1.11 → 5.0.1

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.
Files changed (3) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +2 -2
  3. package/package.json +12 -21
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2016 - 2025 Sanity.io
3
+ Copyright (c) 2016 - 2026 Sanity.io
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `@portabletext/block-tools`
2
2
 
3
- > Various tools for processing Portable Text.
3
+ > Convert HTML to Portable Text with built-in support for Google Docs, Word, and Notion.
4
4
 
5
5
  **NOTE:** To use `@portabletext/block-tools` in a Node.js script, you will need to provide a `parseHtml` method - generally using `JSDOM`. [Read more](#jsdom-example).
6
6
 
@@ -78,7 +78,7 @@ A compiled version of the block content schema type.
78
78
 
79
79
  The deserializer will respect the schema when deserializing the HTML elements to blocks.
80
80
 
81
- It only supports a subset of HTML tags. Any HTML tag not in the block-tools [whitelist](https://github.com/sanity-io/sanity/blob/243b4a5686a1293a8a977574a5cabc768ec01725/packages/%40sanity/block-tools/src/constants.ts#L24-L78) will be deserialized to normal blocks/spans.
81
+ It only supports a subset of HTML tags. Any HTML tag not in the block-tools [whitelist](https://github.com/portabletext/editor/blob/main/packages/block-tools/src/constants.ts) will be deserialized to normal blocks/spans.
82
82
 
83
83
  For instance, if the schema doesn't allow H2 styles, all H2 HTML elements will be output like this:
84
84
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@portabletext/block-tools",
3
- "version": "4.1.11",
4
- "description": "Can format HTML, Slate JSON or Sanity block array into any other format.",
3
+ "version": "5.0.1",
4
+ "description": "Convert HTML to Portable Text with built-in support for Google Docs, Word, and Notion",
5
5
  "keywords": [
6
6
  "portable-text",
7
7
  "block-tools"
@@ -20,14 +20,8 @@
20
20
  "sideEffects": false,
21
21
  "type": "module",
22
22
  "exports": {
23
- ".": {
24
- "source": "./src/index.ts",
25
- "default": "./lib/index.js"
26
- },
27
- "./rules": {
28
- "source": "./src/rules/_exports/index.ts",
29
- "default": "./lib/rules/index.js"
30
- },
23
+ ".": "./lib/index.js",
24
+ "./rules": "./lib/rules/index.js",
31
25
  "./package.json": "./package.json"
32
26
  },
33
27
  "main": "./lib/index.js",
@@ -36,27 +30,24 @@
36
30
  "lib"
37
31
  ],
38
32
  "dependencies": {
39
- "@sanity/types": "^4.20.3",
40
- "@portabletext/sanity-bridge": "^1.2.14",
41
- "@portabletext/schema": "^2.1.0"
33
+ "@sanity/types": "^5.6.0",
34
+ "@portabletext/sanity-bridge": "^2.0.0",
35
+ "@portabletext/schema": "^2.1.1"
42
36
  },
43
37
  "devDependencies": {
44
- "@sanity/pkg-utils": "^10.1.2",
45
- "@sanity/schema": "^4.20.3",
38
+ "@sanity/pkg-utils": "^10.2.1",
39
+ "@sanity/schema": "^5.6.0",
46
40
  "@types/jsdom": "^27.0.0",
47
41
  "@vercel/stega": "1.0.0",
48
- "@vitest/coverage-v8": "^4.0.14",
42
+ "@vitest/coverage-v8": "^4.0.16",
49
43
  "jsdom": "^27.0.0",
50
44
  "typescript": "5.9.3",
51
- "vitest": "^4.0.14",
52
- "@portabletext/test": "^1.0.2"
45
+ "vitest": "^4.0.16",
46
+ "@portabletext/test": "^1.0.3"
53
47
  },
54
48
  "engines": {
55
49
  "node": ">=20.19 <22 || >=22.12"
56
50
  },
57
- "publishConfig": {
58
- "access": "public"
59
- },
60
51
  "scripts": {
61
52
  "build": "pkg-utils build --strict --check --clean",
62
53
  "check:lint": "biome lint .",