@bigfootai/bigfoot-types 3.7.11 → 3.7.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/editor.js +36 -9
- package/editor.ts +36 -9
- package/model.js +7 -2
- package/model.ts +13 -5
- package/package.json +1 -1
package/editor.js
CHANGED
@@ -8,6 +8,7 @@ const prosemirror_model_1 = require("prosemirror-model");
|
|
8
8
|
const prosemirror_schema_basic_1 = require("prosemirror-schema-basic");
|
9
9
|
const prosemirror_schema_list_1 = require("prosemirror-schema-list");
|
10
10
|
const orderedmap_1 = __importDefault(require("orderedmap"));
|
11
|
+
const uuid_1 = require("uuid");
|
11
12
|
const tag = {
|
12
13
|
attrs: {
|
13
14
|
tagId: { default: null },
|
@@ -47,16 +48,38 @@ const tag = {
|
|
47
48
|
const checklist = {
|
48
49
|
content: 'checklistItem+',
|
49
50
|
group: 'block',
|
50
|
-
|
51
|
-
|
51
|
+
attrs: { taskListId: { default: (0, uuid_1.v4)() } },
|
52
|
+
//@ts-expect-error Not sure why this is throwing an error, but will revisit
|
53
|
+
toDOM: (node) => [
|
54
|
+
'ul',
|
55
|
+
{
|
56
|
+
'data-task-parent-id': node?.attrs?.taskListId,
|
57
|
+
},
|
58
|
+
0,
|
59
|
+
],
|
60
|
+
parseDOM: [
|
61
|
+
{
|
62
|
+
tag: 'ul.checklist[data-task-parent-id]',
|
63
|
+
getAttrs(dom) {
|
64
|
+
return {
|
65
|
+
taskListId: dom.getAttribute('data-tag-id'),
|
66
|
+
};
|
67
|
+
},
|
68
|
+
},
|
69
|
+
],
|
52
70
|
};
|
53
71
|
const checklistItem = {
|
54
72
|
content: 'text*',
|
55
|
-
attrs: { checked: { default: false } },
|
73
|
+
attrs: { checked: { default: false }, taskId: { default: (0, uuid_1.v4)() } },
|
56
74
|
//@ts-expect-error Not sure why this is throwing an error, but will revisit
|
57
75
|
toDOM: (node) => [
|
58
|
-
|
59
|
-
|
76
|
+
[
|
77
|
+
'li',
|
78
|
+
{
|
79
|
+
'data-checked': node?.attrs?.checked ? true : false,
|
80
|
+
'data-task-id': node?.attrs?.taskId,
|
81
|
+
},
|
82
|
+
],
|
60
83
|
[
|
61
84
|
'input',
|
62
85
|
{
|
@@ -65,13 +88,17 @@ const checklistItem = {
|
|
65
88
|
},
|
66
89
|
],
|
67
90
|
['span', {}],
|
91
|
+
0,
|
68
92
|
],
|
69
93
|
parseDOM: [
|
70
94
|
{
|
71
|
-
tag: 'li[data-checked]',
|
72
|
-
getAttrs
|
73
|
-
|
74
|
-
|
95
|
+
tag: 'li[data-checked][data-task-id]',
|
96
|
+
getAttrs(dom) {
|
97
|
+
return {
|
98
|
+
checked: dom.getAttribute('data-checked') === 'true',
|
99
|
+
taskId: dom.getAttribute('data-task-id'),
|
100
|
+
};
|
101
|
+
},
|
75
102
|
},
|
76
103
|
],
|
77
104
|
};
|
package/editor.ts
CHANGED
@@ -2,6 +2,7 @@ import { MarkSpec, NodeSpec, Schema } from 'prosemirror-model';
|
|
2
2
|
import { schema } from 'prosemirror-schema-basic';
|
3
3
|
import { addListNodes } from 'prosemirror-schema-list';
|
4
4
|
import orderedMap from 'orderedmap';
|
5
|
+
import { v4 as uuidv4 } from 'uuid';
|
5
6
|
|
6
7
|
const tag: MarkSpec = {
|
7
8
|
attrs: {
|
@@ -52,17 +53,39 @@ const tag: MarkSpec = {
|
|
52
53
|
const checklist: NodeSpec = {
|
53
54
|
content: 'checklistItem+',
|
54
55
|
group: 'block',
|
55
|
-
|
56
|
-
|
56
|
+
attrs: { taskListId: { default: uuidv4() } },
|
57
|
+
//@ts-expect-error Not sure why this is throwing an error, but will revisit
|
58
|
+
toDOM: (node: NodeSpec) => [
|
59
|
+
'ul',
|
60
|
+
{
|
61
|
+
'data-task-parent-id': node?.attrs?.taskListId,
|
62
|
+
},
|
63
|
+
0,
|
64
|
+
],
|
65
|
+
parseDOM: [
|
66
|
+
{
|
67
|
+
tag: 'ul.checklist[data-task-parent-id]',
|
68
|
+
getAttrs(dom: HTMLElement) {
|
69
|
+
return {
|
70
|
+
taskListId: dom.getAttribute('data-tag-id'),
|
71
|
+
};
|
72
|
+
},
|
73
|
+
},
|
74
|
+
],
|
57
75
|
};
|
58
76
|
|
59
77
|
const checklistItem: NodeSpec = {
|
60
78
|
content: 'text*',
|
61
|
-
attrs: { checked: { default: false } },
|
79
|
+
attrs: { checked: { default: false }, taskId: { default: uuidv4() } },
|
62
80
|
//@ts-expect-error Not sure why this is throwing an error, but will revisit
|
63
81
|
toDOM: (node: NodeSpec) => [
|
64
|
-
|
65
|
-
|
82
|
+
[
|
83
|
+
'li',
|
84
|
+
{
|
85
|
+
'data-checked': node?.attrs?.checked ? true : false,
|
86
|
+
'data-task-id': node?.attrs?.taskId,
|
87
|
+
},
|
88
|
+
],
|
66
89
|
[
|
67
90
|
'input',
|
68
91
|
{
|
@@ -71,13 +94,17 @@ const checklistItem: NodeSpec = {
|
|
71
94
|
},
|
72
95
|
],
|
73
96
|
['span', {}],
|
97
|
+
0,
|
74
98
|
],
|
75
99
|
parseDOM: [
|
76
100
|
{
|
77
|
-
tag: 'li[data-checked]',
|
78
|
-
getAttrs
|
79
|
-
|
80
|
-
|
101
|
+
tag: 'li[data-checked][data-task-id]',
|
102
|
+
getAttrs(dom: HTMLElement) {
|
103
|
+
return {
|
104
|
+
checked: dom.getAttribute('data-checked') === 'true',
|
105
|
+
taskId: dom.getAttribute('data-task-id'),
|
106
|
+
};
|
107
|
+
},
|
81
108
|
},
|
82
109
|
],
|
83
110
|
};
|
package/model.js
CHANGED
@@ -77,6 +77,7 @@ var TagRecommendationType;
|
|
77
77
|
TagRecommendationType["TagFound"] = "found";
|
78
78
|
TagRecommendationType["MultipleTagsFound"] = "multiple_found";
|
79
79
|
TagRecommendationType["TagCreationFailed"] = "creation_failed";
|
80
|
+
TagRecommendationType["Ignore"] = "ignore";
|
80
81
|
})(TagRecommendationType || (exports.TagRecommendationType = TagRecommendationType = {}));
|
81
82
|
var TagRecommendationVariation;
|
82
83
|
(function (TagRecommendationVariation) {
|
@@ -501,6 +502,7 @@ exports.ArticleQL = `
|
|
501
502
|
type Article {${exports.PrimitiveFields}
|
502
503
|
referenceBlock: ReferenceBlock!
|
503
504
|
sentiment: DocumentSentiment
|
505
|
+
dateDue: Float
|
504
506
|
dates: [EntityEntry]
|
505
507
|
locations: [EntityEntry]
|
506
508
|
linkUrls: [String]
|
@@ -510,6 +512,9 @@ type Article {${exports.PrimitiveFields}
|
|
510
512
|
relations: [RelationEntry]
|
511
513
|
archived: Boolean!
|
512
514
|
favorite: Boolean!
|
515
|
+
status: Int
|
516
|
+
groupId: String
|
517
|
+
parentId: String
|
513
518
|
}`;
|
514
519
|
class Article extends Primitive {
|
515
520
|
constructor(referenceBlock) {
|
@@ -526,6 +531,8 @@ exports.BlockFields = `${exports.SharedPrimitiveFields}
|
|
526
531
|
blockType: String!
|
527
532
|
archived: Boolean!
|
528
533
|
favorite: Boolean!
|
534
|
+
parentId: String
|
535
|
+
groupId: String
|
529
536
|
document: String
|
530
537
|
reactions: [Reaction]`;
|
531
538
|
class Block extends SharedPrimitive {
|
@@ -599,8 +606,6 @@ exports.TaskFields = `${exports.BlockFields}
|
|
599
606
|
steps: [TaskStep]
|
600
607
|
dateRemindMe: Int
|
601
608
|
recurrence: [String]
|
602
|
-
parentId: String
|
603
|
-
groupId: String
|
604
609
|
`;
|
605
610
|
exports.TaskQL = `
|
606
611
|
type Task {${exports.TaskFields}
|
package/model.ts
CHANGED
@@ -72,6 +72,7 @@ export enum TagRecommendationType {
|
|
72
72
|
TagFound = 'found',
|
73
73
|
MultipleTagsFound = 'multiple_found',
|
74
74
|
TagCreationFailed = 'creation_failed',
|
75
|
+
Ignore = 'ignore',
|
75
76
|
}
|
76
77
|
|
77
78
|
export enum TagRecommendationVariation {
|
@@ -751,6 +752,7 @@ export const ArticleQL = `
|
|
751
752
|
type Article {${PrimitiveFields}
|
752
753
|
referenceBlock: ReferenceBlock!
|
753
754
|
sentiment: DocumentSentiment
|
755
|
+
dateDue: Float
|
754
756
|
dates: [EntityEntry]
|
755
757
|
locations: [EntityEntry]
|
756
758
|
linkUrls: [String]
|
@@ -760,11 +762,15 @@ type Article {${PrimitiveFields}
|
|
760
762
|
relations: [RelationEntry]
|
761
763
|
archived: Boolean!
|
762
764
|
favorite: Boolean!
|
765
|
+
status: Int
|
766
|
+
groupId: String
|
767
|
+
parentId: String
|
763
768
|
}`;
|
764
769
|
export class Article extends Primitive {
|
765
770
|
referenceBlock: ReferenceBlock;
|
766
771
|
embedding?: number[];
|
767
772
|
sentiment?: DocumentSentiment;
|
773
|
+
dateDue?: number;
|
768
774
|
dates?: EntityEntry[];
|
769
775
|
locations?: EntityEntry[];
|
770
776
|
linkUrls?: string[];
|
@@ -774,6 +780,8 @@ export class Article extends Primitive {
|
|
774
780
|
relations?: RelationEntry[];
|
775
781
|
archived: boolean;
|
776
782
|
favorite: boolean;
|
783
|
+
groupId?: string;
|
784
|
+
parentId?: string;
|
777
785
|
_changes?: Changes;
|
778
786
|
_tasks?: Task[];
|
779
787
|
_entitiesPerson?: EntityEntry[];
|
@@ -797,6 +805,8 @@ export const BlockFields = `${SharedPrimitiveFields}
|
|
797
805
|
blockType: String!
|
798
806
|
archived: Boolean!
|
799
807
|
favorite: Boolean!
|
808
|
+
parentId: String
|
809
|
+
groupId: String
|
800
810
|
document: String
|
801
811
|
reactions: [Reaction]`;
|
802
812
|
export class Block extends SharedPrimitive {
|
@@ -805,6 +815,8 @@ export class Block extends SharedPrimitive {
|
|
805
815
|
blockType: BlockType;
|
806
816
|
archived: boolean;
|
807
817
|
favorite: boolean;
|
818
|
+
parentId?: string;
|
819
|
+
groupId?: string;
|
808
820
|
document?: any;
|
809
821
|
reactions?: Reaction[];
|
810
822
|
_changes?: Changes;
|
@@ -872,7 +884,6 @@ export class BusinessObject extends Block {
|
|
872
884
|
processingReason?: string; // The reason the processing is at this stage
|
873
885
|
externalResponse?: any; // The full response from the external system that created this object
|
874
886
|
iconUrl?: string | null; // The url of an icon that represents the business object
|
875
|
-
parentId?: string | null; // The business object that is the parent of this business object
|
876
887
|
|
877
888
|
constructor(
|
878
889
|
tenantIdCreated: string,
|
@@ -923,8 +934,6 @@ export const TaskFields = `${BlockFields}
|
|
923
934
|
steps: [TaskStep]
|
924
935
|
dateRemindMe: Int
|
925
936
|
recurrence: [String]
|
926
|
-
parentId: String
|
927
|
-
groupId: String
|
928
937
|
`;
|
929
938
|
export const TaskQL = `
|
930
939
|
type Task {${TaskFields}
|
@@ -937,8 +946,7 @@ export class Task extends Block {
|
|
937
946
|
steps?: TaskStep[];
|
938
947
|
dateRemindMe?: number;
|
939
948
|
recurrence?: RecurrenceRFC[];
|
940
|
-
|
941
|
-
groupId?: string;
|
949
|
+
_dateDueUserAssigned: Boolean;
|
942
950
|
|
943
951
|
constructor(
|
944
952
|
tenantIdCreated: string,
|