Implement block conversion — export side and convert API#148
Conversation
|
⏭️ No files to mutate for |
|
⏭️ No files to mutate for |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🟢 | Statements | 99.71% | 1043/1046 |
| 🟢 | Branches | 98.43% | 314/319 |
| 🟢 | Functions | 98.39% | 244/248 |
| 🟢 | Lines | 99.7% | 1001/1004 |
Test suite run success
562 tests passing in 26 suites.
Report generated by 🧪jest coverage report action from b21e9e7
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🟢 | Statements | 96.43% | 27/28 |
| 🟢 | Branches | 86.96% | 20/23 |
| 🟢 | Functions | 100% | 5/5 |
| 🟢 | Lines | 96.43% | 27/28 |
Test suite run success
11 tests passing in 2 suites.
Report generated by 🧪jest coverage report action from b21e9e7
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🟢 | Statements | 99.45% (+0.72% 🔼) |
180/181 |
| 🟢 | Branches | 95.71% (+3.78% 🔼) |
67/70 |
| 🟢 | Functions | 97.14% (-2.86% 🔻) |
34/35 |
| 🟢 | Lines | 99.41% (+0.77% 🔼) |
169/170 |
Show new covered files 🐣
St.❔ |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| 🟢 | api/BlocksAPI.ts | 93.33% | 80% | 90% | 92.86% |
Test suite run success
107 tests passing in 7 suites.
Report generated by 🧪jest coverage report action from b21e9e7
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🟢 | Statements | 92.51% | 358/387 |
| 🟢 | Branches | 85.51% | 118/138 |
| 🟢 | Functions | 98.15% | 53/54 |
| 🟢 | Lines | 92.41% | 353/382 |
Test suite run success
117 tests passing in 7 suites.
Report generated by 🧪jest coverage report action from b21e9e7
|
⏭️ No files to mutate for |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🟡 | Statements | 70.97% | 22/31 |
| 🔴 | Branches | 20% | 1/5 |
| 🟡 | Functions | 75% | 6/8 |
| 🟡 | Lines | 68.97% | 20/29 |
Test suite run success
4 tests passing in 1 suite.
Report generated by 🧪jest coverage report action from b21e9e7
Add exportTextContent() to BlockToolFacade as the counterpart to importTextContent(): supports function, string keypath, and dot-notation keypath via conversionConfig.export. Add convertBlock() to BlocksManager: exports text from the source block, imports it into the target type, and replaces the block at the same index. Wire up BlocksAPI.convert() in core and uncomment the method in the SDK interface. dataOverrides parameter is accepted but not yet applied (marked @todo). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fc906c1 to
630d328
Compare
| id: string, | ||
| newType: string, | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| dataOverrides?: BlockToolData |
There was a problem hiding this comment.
Better to leave a to-do if you're not going to implement it in this PR
There was a problem hiding this comment.
Now we're using this parameters to override data.
| * @param dataOverrides - optional data overrides for the new block @todo implement | ||
| */ | ||
| public convert( | ||
| id: string, |
There was a problem hiding this comment.
Please use id or index
Also, it would be more scalable to use a single object with parameters and add an optional useId property (see my PR that adds user ID to API methods)
There was a problem hiding this comment.
Please use id or index
Done, now we accepting both
Also, it would be more scalable to use a single object with parameters and add an optional useId property (see my PR that adds user ID to API methods)
Good advise, done.
Summary
exportTextContent()toBlockToolFacade— the export counterpart toimportTextContent(). Supports a function, a string keypath, or a dot-notation keypath viaconversionConfig.export.convertBlock()toBlocksManager: exports text from the source block using its conversion config, imports it into the target tool type, and replaces the block at the same index.BlocksAPI.convert()in core and uncomment the method in the SDK interface. ThedataOverridesparameter is stubbed with a@todountilBlockAPIis available.