Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/cli",
"version": "0.10.1",
"version": "0.11.0",
"type": "module",
"bin": {
"superdoc": "./dist/index.js"
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/platforms/cli-darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/cli-darwin-arm64",
"version": "0.10.1",
"version": "0.11.0",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/platforms/cli-darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/cli-darwin-x64",
"version": "0.10.1",
"version": "0.11.0",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/platforms/cli-linux-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/cli-linux-arm64",
"version": "0.10.1",
"version": "0.11.0",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/platforms/cli-linux-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/cli-linux-x64",
"version": "0.10.1",
"version": "0.11.0",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/platforms/cli-windows-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/cli-windows-x64",
"version": "0.10.1",
"version": "0.11.0",
"os": [
"win32"
],
Expand Down
2 changes: 1 addition & 1 deletion apps/mcp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/mcp",
"version": "0.5.1",
"version": "0.6.0",
"type": "module",
"engines": {
"node": ">=20"
Expand Down
2 changes: 1 addition & 1 deletion apps/vscode-ext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "superdoc-vscode-ext",
"displayName": "SuperDoc - Word Document Editor",
"description": "Open and edit Word documents (.docx) directly in VS Code using SuperDoc",
"version": "2.5.1",
"version": "2.6.0",
"publisher": "superdoc-dev",
"icon": "logo.png",
"homepage": "https://superdoc.dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/esign/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/esign",
"version": "2.7.0",
"version": "2.7.1",
"description": "React eSignature component for SuperDoc",
"type": "module",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/react",
"version": "1.4.1",
"version": "1.5.0",
"description": "Official React wrapper for the SuperDoc document editor",
"type": "module",
"main": "./dist/index.cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/langs/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/sdk",
"version": "1.9.1",
"version": "1.10.0",
"private": false,
"type": "module",
"main": "./dist/index.cjs",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/sdk-darwin-arm64",
"version": "1.9.1",
"version": "1.10.0",
"os": [
"darwin"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/sdk-darwin-x64",
"version": "1.9.1",
"version": "1.10.0",
"os": [
"darwin"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/sdk-linux-arm64",
"version": "1.9.1",
"version": "1.10.0",
"os": [
"linux"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/sdk-linux-x64",
"version": "1.9.1",
"version": "1.10.0",
"os": [
"linux"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/sdk-windows-x64",
"version": "1.9.1",
"version": "1.10.0",
"os": [
"win32"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "superdoc-sdk-cli-darwin-arm64"
version = "1.9.1"
version = "1.10.0"
description = "SuperDoc CLI binary for macOS ARM64 (Apple Silicon)"
readme = "README.md"
requires-python = ">=3.9"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "superdoc-sdk-cli-darwin-x64"
version = "1.9.1"
version = "1.10.0"
description = "SuperDoc CLI binary for macOS x64 (Intel)"
readme = "README.md"
requires-python = ">=3.9"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "superdoc-sdk-cli-linux-arm64"
version = "1.9.1"
version = "1.10.0"
description = "SuperDoc CLI binary for Linux ARM64"
readme = "README.md"
requires-python = ">=3.9"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "superdoc-sdk-cli-linux-x64"
version = "1.9.1"
version = "1.10.0"
description = "SuperDoc CLI binary for Linux x64"
readme = "README.md"
requires-python = ">=3.9"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "superdoc-sdk-cli-windows-x64"
version = "1.9.1"
version = "1.10.0"
description = "SuperDoc CLI binary for Windows x64"
readme = "README.md"
requires-python = ">=3.9"
Expand Down
12 changes: 6 additions & 6 deletions packages/sdk/langs/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ build-backend = "setuptools.build_meta"

[project]
name = "superdoc-sdk"
version = "1.9.1"
version = "1.10.0"
description = "SuperDoc SDK (CLI-backed)"
readme = "README.md"
requires-python = ">=3.9"
license = "AGPL-3.0"
authors = [{ name = "SuperDoc" }]
dependencies = [
"superdoc-sdk-cli-darwin-arm64==1.9.1; platform_system == 'Darwin' and (platform_machine == 'arm64' or platform_machine == 'aarch64' or platform_machine == 'ARM64')",
"superdoc-sdk-cli-darwin-x64==1.9.1; platform_system == 'Darwin' and (platform_machine == 'x86_64' or platform_machine == 'AMD64' or platform_machine == 'amd64')",
"superdoc-sdk-cli-linux-x64==1.9.1; platform_system == 'Linux' and (platform_machine == 'x86_64' or platform_machine == 'AMD64' or platform_machine == 'amd64')",
"superdoc-sdk-cli-linux-arm64==1.9.1; platform_system == 'Linux' and (platform_machine == 'arm64' or platform_machine == 'aarch64' or platform_machine == 'ARM64')",
"superdoc-sdk-cli-windows-x64==1.9.1; platform_system == 'Windows' and (platform_machine == 'x86_64' or platform_machine == 'AMD64' or platform_machine == 'amd64')",
"superdoc-sdk-cli-darwin-arm64==1.10.0; platform_system == 'Darwin' and (platform_machine == 'arm64' or platform_machine == 'aarch64' or platform_machine == 'ARM64')",
"superdoc-sdk-cli-darwin-x64==1.10.0; platform_system == 'Darwin' and (platform_machine == 'x86_64' or platform_machine == 'AMD64' or platform_machine == 'amd64')",
"superdoc-sdk-cli-linux-x64==1.10.0; platform_system == 'Linux' and (platform_machine == 'x86_64' or platform_machine == 'AMD64' or platform_machine == 'amd64')",
"superdoc-sdk-cli-linux-arm64==1.10.0; platform_system == 'Linux' and (platform_machine == 'arm64' or platform_machine == 'aarch64' or platform_machine == 'ARM64')",
"superdoc-sdk-cli-windows-x64==1.10.0; platform_system == 'Windows' and (platform_machine == 'x86_64' or platform_machine == 'AMD64' or platform_machine == 'amd64')",
]

[tool.setuptools]
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/sdk-workspace",
"version": "1.9.1",
"version": "1.10.0",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"sdkVersion": "1.9.1"
"sdkVersion": "1.10.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,55 @@ describe('anchored metadata wrappers', () => {
expect(metadataGetWrapper(editor, { id: 'seed' })?.payload).toEqual({ v: 1 });
});

it('preserves TARGET_NOT_FOUND when the attach target references a missing blockId', () => {
// `resolveSelectionTarget` throws DocumentApiAdapterError('TARGET_NOT_FOUND', …)
// for an unknown blockId. The attach catch must surface that distinction;
// collapsing it into INVALID_TARGET breaks `metadata.attach`'s declared
// `possibleFailureCodes` and misleads clients that branch on the code
// (missing-target is retryable; bad-shape is a programming error).
const editor = makeEditor();
const result = metadataAttachWrapper(
editor,
{
id: 'meta-missing-block',
target: {
kind: 'selection' as const,
start: { kind: 'text' as const, blockId: 'does-not-exist', offset: 0 },
end: { kind: 'text' as const, blockId: 'does-not-exist', offset: 1 },
},
namespace: 'urn:test:metadata',
payload: { label: 'X' },
},
{ changeMode: 'direct' },
);
expect(result.success).toBe(false);
expect(result.success === false && result.failure.code).toBe('TARGET_NOT_FOUND');
});

it('still returns INVALID_TARGET when the attach target points to a real block but an out-of-range offset', () => {
// The seeded block 'p1' has text "Hello" (length 5). Offset 999 is a
// shape error in `resolveSelectionTarget`, not a missing target; the
// resolver throws DocumentApiAdapterError('INVALID_TARGET', …) here,
// and the attach catch must keep that code.
const editor = makeEditor();
const result = metadataAttachWrapper(
editor,
{
id: 'meta-bad-offset',
target: {
kind: 'selection' as const,
start: { kind: 'text' as const, blockId: 'p1', offset: 999 },
end: { kind: 'text' as const, blockId: 'p1', offset: 999 },
},
namespace: 'urn:test:metadata',
payload: { label: 'X' },
},
{ changeMode: 'direct' },
);
expect(result.success).toBe(false);
expect(result.success === false && result.failure.code).toBe('INVALID_TARGET');
});

it('resolves an existing anchor tag to its text range', () => {
const sdt = createNode('structuredContent', [createNode('text', [], { text: 'Hello' })], {
attrs: { id: '100', tag: 'meta-1' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,19 @@ export function metadataAttachWrapper(
resolveSelectionTarget(editor, input.target);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
// Preserve the distinction the resolver makes between a missing
// block / node (`TARGET_NOT_FOUND`) and a malformed range
// (`INVALID_TARGET`). Both are in `metadata.attach`'s declared
// `possibleFailureCodes`, so collapsing them silently changes a
// documented failure mode into the wrong code and misleads clients
// that branch on it (missing target is retryable; bad shape is a
// programming error). Any other adapter error class still falls
// through to `INVALID_TARGET` as before.
if (error instanceof DocumentApiAdapterError) {
if (error.code === 'TARGET_NOT_FOUND' || error.code === 'INVALID_TARGET') {
return failure(error.code, message);
}
}
return failure('INVALID_TARGET', message);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/superdoc/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "superdoc",
"type": "module",
"version": "1.33.1",
"version": "1.34.0",
"license": "AGPL-3.0",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/template-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdoc-dev/template-builder",
"version": "1.10.0",
"version": "1.11.1",
"description": "React template builder component for SuperDoc",
"type": "module",
"main": "./dist/index.js",
Expand Down
Loading