Skip to content

Commit

Permalink
refactor: export static-is-empty as part of Editor package
Browse files Browse the repository at this point in the history
  • Loading branch information
hejtful committed Jan 9, 2025
1 parent 8180607 commit 6c750b2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
5 changes: 1 addition & 4 deletions apps/web/__tests__/editor/text-static-is-empty.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
isEmptyCustomText,
isEmptyDescendant,
} from '@editor/plugins/text/utils/static-is-empty'
import { isEmptyCustomText, isEmptyDescendant } from '@editor/package'

const text = { text: 'abc123' }
const emptyText = { text: '' }
Expand Down
7 changes: 5 additions & 2 deletions apps/web/src/components/entity/entity.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { EditorPluginType, isArticleDocument } from '@editor/package'
import { isEmptyArticle } from '@editor/plugins/article/utils/static-is-empty'
import {
EditorPluginType,
isArticleDocument,
isEmptyArticle,
} from '@editor/package'
import {
faExclamationCircle,
faGraduationCap,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
isArticleIntroductionDocument,
isArticleDocument,
isEmptyTextDocument,
} from '@editor/package'
import { extractStringFromTextDocument } from '@editor/plugins/text/utils/static-extract-text'
import { isEmptyTextDocument } from '@editor/plugins/text/utils/static-is-empty'
import { AnyEditorDocument } from '@editor/types/editor-plugins'

/**
Expand Down
1 change: 1 addition & 0 deletions packages/editor/src/package/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export { EditorPluginType } from '@editor/types/editor-plugin-type'
* Plugin state helpers and types
*/
export * from '@editor/types/plugin-type-guards'
export * from './static-is-plugin-empty'

/**
* Exported for serlo.org
Expand Down
2 changes: 2 additions & 0 deletions packages/editor/src/package/static-is-plugin-empty.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from '@editor/plugins/text/utils/static-is-empty'
export * from '@editor/plugins/article/utils/static-is-empty'

0 comments on commit 6c750b2

Please sign in to comment.