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
21 changes: 0 additions & 21 deletions packages/layout-engine/style-engine/src/cascade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,6 @@ export type PropertyObject = ParagraphProperties | RunProperties | TableCellProp
* @param propertiesArray - Ordered list of property objects to combine (low -> high priority).
* @param options - Configuration for full overrides and special handling.
* @returns Combined property object.
*
* @example
* ```typescript
* import { combineProperties } from '@superdoc/style-engine/cascade';
*
* const result = combineProperties([
* { fontSize: 22, bold: true }, // from style
* { fontSize: 24, italic: true }, // from inline (wins for fontSize)
* ]);
* // result: { fontSize: 24, bold: true, italic: true }
*
* // With full override for color (replaces entire object, not merge):
* const result2 = combineProperties(
* [
* { color: { val: 'FF0000', theme: 'accent1' } },
* { color: { val: '00FF00' } },
* ],
* { fullOverrideProps: ['color'] }
* );
* // result2: { color: { val: '00FF00' } } - NOT merged
* ```
*/
export function combineProperties<T extends PropertyObject>(
propertiesArray: T[],
Expand Down
3 changes: 0 additions & 3 deletions packages/super-editor/src/editors/v1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import { Mark } from '@core/Mark.js';
import ContextMenu from './components/context-menu/ContextMenu.vue';
/** @deprecated Use ContextMenu instead */
const SlashMenu = ContextMenu;
import BasicUpload from '@superdoc/common/components/BasicUpload.vue';

import SuperEditor from './components/SuperEditor.vue';
import Toolbar from './components/toolbar/Toolbar.vue';
Expand Down Expand Up @@ -100,8 +99,6 @@ export {
SuperEditor,
/** @internal */
SuperInput,
/** @internal */
BasicUpload,
Toolbar,
AIWriter,
ContextMenu,
Expand Down
1 change: 1 addition & 0 deletions packages/superdoc/scripts/audit-declarations.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const RELOCATION_GUARD_PACKAGES = [
'@superdoc/layout-engine',
'@superdoc/painter-dom',
'@superdoc/pm-adapter',
'@superdoc/style-engine',
'@superdoc/common/list-marker-utils',
];

Expand Down
12 changes: 12 additions & 0 deletions packages/superdoc/scripts/ensure-types.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,16 @@ const RELOCATION_RULES = [
distEntry: 'shared/common/list-marker-utils.d.ts',
matchSubpaths: false,
},
// SD-2893: only the /ooxml subpath of style-engine is publicly reachable.
// Relocate just this subpath plus its sibling cascade.ts dependency
// (see vite.config.js include list). The bare @superdoc/style-engine is
// guarded but unrewritten; if a future bare-barrel leak appears the audit
// gate fails rather than producing a missing relative path.
{
pkg: '@superdoc/style-engine/ooxml',
distEntry: 'layout-engine/style-engine/src/ooxml/index.d.ts',
matchSubpaths: false,
},
];

// Guard packages that must never fall back to `_internal-shims.d.ts`.
Expand All @@ -289,6 +299,7 @@ const RELOCATION_GUARD_PACKAGES = [
'@superdoc/layout-engine',
'@superdoc/painter-dom',
'@superdoc/pm-adapter',
'@superdoc/style-engine',
'@superdoc/common/list-marker-utils',
];

Expand Down Expand Up @@ -329,6 +340,7 @@ const RELOCATION_REWRITERS = RELOCATION_RULES.map((rule) => ({
// shim after we intentionally skip shim generation.
const UNSHIMMED_PRIVATE_SPECIFIERS = new Set([
'@superdoc/pm-adapter',
'@superdoc/style-engine',
]);

function shouldSkipWorkspaceShim(mod) {
Expand Down
2 changes: 0 additions & 2 deletions packages/superdoc/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
// Vue components
SuperEditor,
SuperInput,
BasicUpload,
Toolbar,
AIWriter,
ContextMenu,
Expand Down Expand Up @@ -289,7 +288,6 @@ export {
// Vue components
SuperEditor,
SuperInput,
BasicUpload,
Toolbar,
AIWriter,
ContextMenu,
Expand Down
4 changes: 3 additions & 1 deletion packages/superdoc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"../layout-engine/layout-engine/src",
"../layout-engine/painters/dom/src",
"../layout-engine/pm-adapter/src/converter-context.ts",
"../layout-engine/pm-adapter/src/sections/types.ts"
"../layout-engine/pm-adapter/src/sections/types.ts",
"../layout-engine/style-engine/src/ooxml",
"../layout-engine/style-engine/src/cascade.ts"
]
}
6 changes: 6 additions & 0 deletions packages/superdoc/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ export default defineConfig(({ mode, command }) => {
// type subpaths reachable from the public surface are relocated.
'../layout-engine/pm-adapter/src/converter-context.ts',
'../layout-engine/pm-adapter/src/sections/types.ts',
// SD-2893: only the /ooxml subpath of style-engine is publicly
// reachable today. Include the ooxml subtree plus the cascade.ts
// sibling it depends on. The full src/**/* glob pulls the broader
// project graph through contracts project references.
'../layout-engine/style-engine/src/ooxml/**/*',
'../layout-engine/style-engine/src/cascade.ts',
],
outDir: 'dist',
// vite-plugin-dts still gathers diagnostics for this mixed JS/Vue source
Expand Down
2 changes: 0 additions & 2 deletions tests/consumer-typecheck/src/customer-scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import {
CommentsPluginKey,
SuperEditor,
SuperInput,
BasicUpload,
Toolbar,
AIWriter,
ContextMenu,
Expand Down Expand Up @@ -831,7 +830,6 @@ function testAdditionalClasses() {
function testVueComponents() {
const superEditor = SuperEditor;
const superInput = SuperInput;
const basicUpload = BasicUpload;
const toolbarComponent = Toolbar;
const aiWriter = AIWriter;
const contextMenu = ContextMenu;
Expand Down
Loading