-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add
platform-scripture-editor
typecheck
- remove the patch and the type overrides when the BNF types are fixed.
- Loading branch information
1 parent
db902ab
commit 1a314b6
Showing
3 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...ons/src/platform-scripture-editor/src/types/@biblionexus-foundation__platform-editor.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* Work-around until the `@biblionexus-foundation/platform-editor` package fully includes its types. | ||
* Note there is also a patch that should be removed when this is fixed. | ||
*/ | ||
|
||
declare module 'shared-react/annotation/selection.model' { | ||
type UsjLocation = { | ||
jsonPath: string; | ||
offset: number; | ||
}; | ||
|
||
export type SelectionRange = { | ||
start: UsjLocation; | ||
end?: UsjLocation; | ||
}; | ||
|
||
export type AnnotationRange = { | ||
start: UsjLocation; | ||
end: UsjLocation; | ||
}; | ||
} | ||
|
||
declare module 'shared-react/nodes/scripture/usj/ImmutableNoteCallerNode' { | ||
export const immutableNoteCallerNodeName = 'ImmutableNoteCallerNode'; | ||
} | ||
|
||
declare module 'shared-react/plugins/logger-basic.model' { | ||
export type LoggerBasic = { | ||
error(message: string): void; | ||
warn(message: string): void; | ||
info(message: string): void; | ||
}; | ||
} | ||
|
||
declare module 'shared-react/plugins/text-direction.model' { | ||
/** Left-to-right or Right-to-left or Automatically determined from the content. */ | ||
export type TextDirection = 'ltr' | 'rtl' | 'auto'; | ||
} | ||
|
||
declare module 'shared-react/nodes/scripture/usj/usj-node-options.model' { | ||
import { SyntheticEvent } from 'react'; | ||
|
||
/** Option properties to use with each node. */ | ||
type NodeOptions = { [nodeClassName: string]: { [prop: string]: unknown } | undefined }; | ||
type OnClick = (event: SyntheticEvent) => void; | ||
const immutableNoteCallerNodeName = 'ImmutableNoteCallerNode'; | ||
|
||
export const MarkNodeName = 'MarkNode'; | ||
|
||
export type AddMissingComments = (usjCommentIds: string[]) => void; | ||
|
||
/** Options for each editor node. */ | ||
export interface UsjNodeOptions extends NodeOptions { | ||
[immutableNoteCallerNodeName]?: { | ||
/** Possible note callers to use when caller is '+'. */ | ||
noteCallers?: string[]; | ||
/** Click handler method. */ | ||
onClick?: OnClick; | ||
}; | ||
[MarkNodeName]?: { | ||
/** Method to add missing comments. */ | ||
addMissingComments?: AddMissingComments; | ||
}; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
patches/@biblionexus-foundation+platform-editor+0.5.3.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/node_modules/@biblionexus-foundation/platform-editor/dist/index.d.ts b/node_modules/@biblionexus-foundation/platform-editor/dist/index.d.ts | ||
index 81f96c0..27838a0 100644 | ||
--- a/node_modules/@biblionexus-foundation/platform-editor/dist/index.d.ts | ||
+++ b/node_modules/@biblionexus-foundation/platform-editor/dist/index.d.ts | ||
@@ -5,7 +5,7 @@ import { LoggerBasic } from 'shared-react/plugins/logger-basic.model'; | ||
import { ScriptureReference } from 'platform-bible-utils'; | ||
import { SelectionRange } from 'shared-react/annotation/selection.model'; | ||
import { TextDirection } from 'shared-react/plugins/text-direction.model'; | ||
-import { Usj } from '../../../utilities/src'; | ||
+import { Usj } from '@biblionexus-foundation/scripture-utilities'; | ||
import { UsjNodeOptions } from 'shared-react/nodes/scripture/usj/usj-node-options.model'; | ||
|
||
declare type Comment_2 = { |