aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormehekj <mehek.jethani@gmail.com>2022-05-03 17:06:35 -0400
committermehekj <mehek.jethani@gmail.com>2022-05-03 17:06:35 -0400
commitac0e05eefa24aad2d90f661a33ede9c65c0fa33c (patch)
tree9c235558edaca5a00445f5193d34533366ae0edc
parent14b23094ea3050b96dc6aed28b5f35612c821140 (diff)
fixed make text note from ink transcription with word subgroupings
-rw-r--r--src/client/views/InkTranscription.tsx10
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx8
2 files changed, 9 insertions, 9 deletions
diff --git a/src/client/views/InkTranscription.tsx b/src/client/views/InkTranscription.tsx
index 7e26b51a0..3892f4cbb 100644
--- a/src/client/views/InkTranscription.tsx
+++ b/src/client/views/InkTranscription.tsx
@@ -172,7 +172,7 @@ export class InkTranscription extends React.Component {
}
subgroupsTranscriptions = async (wordInkDocMap: Map<string, Doc[]>) => {
- // TODO: nda - will probably want to go through ffView unprocessed docs and then see if any of the inksToGroup docs are in it and only use those
+ // TODO: nda - will probably want to go through ffView unprocessed docs and then see if any of the inksToGroup docs are in it and only use those
// loop through the words in wordInkDocMap
// for each word, get the inkDocs
@@ -217,7 +217,7 @@ export class InkTranscription extends React.Component {
}
// set the vals for bounds in marqueeView
-
+
selected.map(action(d => {
const dx = NumCast(d.x);
const dy = NumCast(d.y);
@@ -235,7 +235,7 @@ export class InkTranscription extends React.Component {
}
return d;
}));
-
+
docView.props.removeDocument?.(selected);
// // TODO: nda - this is the code to actually get a new grouped collection
const newCollection = marqViewRef?.getCollection(selected, undefined, [], true);
@@ -272,7 +272,7 @@ export class InkTranscription extends React.Component {
const timestampWord = new Map<number, string>();
this.lastJiix.words.map((word: any) => {
if (word.items) {
- word.items.forEach((i: {id: string, timestamp: string, X: Array<number>, Y: Array<number>, F: Array<number>}) => {
+ word.items.forEach((i: { id: string, timestamp: string, X: Array<number>, Y: Array<number>, F: Array<number> }) => {
const ms = Date.parse(i.timestamp);
timestampWord.set(ms, word.label);
})
@@ -318,7 +318,7 @@ export class InkTranscription extends React.Component {
if (this.currGroup) {
console.log("curr grouping");
- this.currGroup.text = text;
+ this.currGroup.transcription = text;
this.currGroup.title = text.split("\n")[0];
}
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 3a5911fc9..ca8073dac 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1511,9 +1511,9 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
this.props.ContainingCollectionView &&
appearanceItems.push({ description: "Ungroup collection", event: this.promoteCollection, icon: "table" });
- this.props.Document._isGroup && this.childDocs.filter(s => s.type === DocumentType.INK).length > 0 && appearanceItems.push({ description: "Ink to text", event: () => this.transcribeStrokes(false), icon: "font" });
+ this.props.Document._isGroup && this.Document.transcription && appearanceItems.push({ description: "Ink to text", event: () => this.transcribeStrokes(false), icon: "font" });
- this.props.Document._isGroup && this.childDocs.filter(s => s.type === DocumentType.INK).length > 0 && appearanceItems.push({ description: "Ink to math", event: () => this.transcribeStrokes(true), icon: "square-root-alt" });
+ // this.props.Document._isGroup && this.childDocs.filter(s => s.type === DocumentType.INK).length > 0 && appearanceItems.push({ description: "Ink to math", event: () => this.transcribeStrokes(true), icon: "square-root-alt" });
!Doc.UserDoc().noviceMode ? appearanceItems.push({ description: "Arrange contents in grid", event: this.layoutDocsInGrid, icon: "table" }) : null;
!appearance && ContextMenu.Instance.addItem({ description: "Appearance...", subitems: appearanceItems, icon: "eye" });
@@ -1577,9 +1577,9 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
@undoBatch
@action
transcribeStrokes = (math: boolean) => {
- if (this.props.Document._isGroup && this.props.Document.text) {
+ if (this.props.Document._isGroup && this.props.Document.transcription) {
if (!math) {
- const text = StrCast(this.props.Document.text);
+ const text = StrCast(this.props.Document.transcription);
const lines = text.split("\n");
const height = 30 + 15 * lines.length;