Description
Description
The packages/text-editor package currently needs functionality that is already implemented in packages/open-workflow-diagram-editor/src.
Since this hook is useful across multiple editor packages, we should consider moving shared functionality into a dedicated core package rather than duplicating the implementation.
Proposed Change
Create a shared core package that can contain common hooks, utilities, and types used by packages such as:
@openworkflowspec/diagram-editor
@openworkflowspec/text-editor
- Other editor packages in the future
For example:
packages/
├── core/
│ ├── hooks/
│ │ └── useResolvedColorMode.ts
│ └── ...
├── open-workflow-diagram-editor/
└── text-editor/
Both editors would then consume the shared implementation from the core package.
Scope
- Move
useResolvedColorMode into the shared package.
- Update existing consumers to import it from the core package.
- Keep the shared package focused on reusable, package-agnostic functionality.
- Add tests/documentation where appropriate.
Expected Outcome
There should be a single source of truth for shared editor functionality, avoiding duplicated implementations and making it easier to reuse common code across the editor packages.
Motivation
The useResolvedColorMode hook is currently implemented in the diagram editor package, but the same functionality is also required by the text editor. Keeping shared logic within a specific package can lead to duplication and make future maintenance harder.
Introducing a shared core package would provide a single source of truth for common hooks, utilities, and types, allowing multiple editor packages to reuse them consistently. This also establishes a scalable structure for sharing functionality as more editor packages are added.
Proposed Implementation
No response
Definition of Done
Description
Description
The
packages/text-editorpackage currently needs functionality that is already implemented inpackages/open-workflow-diagram-editor/src.Since this hook is useful across multiple editor packages, we should consider moving shared functionality into a dedicated core package rather than duplicating the implementation.
Proposed Change
Create a shared core package that can contain common hooks, utilities, and types used by packages such as:
@openworkflowspec/diagram-editor@openworkflowspec/text-editorFor example:
Both editors would then consume the shared implementation from the core package.
Scope
useResolvedColorModeinto the shared package.Expected Outcome
There should be a single source of truth for shared editor functionality, avoiding duplicated implementations and making it easier to reuse common code across the editor packages.
Motivation
The
useResolvedColorModehook is currently implemented in the diagram editor package, but the same functionality is also required by the text editor. Keeping shared logic within a specific package can lead to duplication and make future maintenance harder.Introducing a shared core package would provide a single source of truth for common hooks, utilities, and types, allowing multiple editor packages to reuse them consistently. This also establishes a scalable structure for sharing functionality as more editor packages are added.
Proposed Implementation
No response
Definition of Done