@bigfootai/bigfoot-types 3.8.4 → 3.8.6
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/model.js +1 -0
- package/model.ts +3 -1
- package/package.json +1 -5
- package/editor.js +0 -123
- package/editor.ts +0 -132
package/model.js
CHANGED
package/model.ts
CHANGED
@@ -782,7 +782,7 @@ export class Article extends Primitive {
|
|
782
782
|
relations?: RelationEntry[];
|
783
783
|
archived: boolean;
|
784
784
|
favorite: boolean;
|
785
|
-
status
|
785
|
+
status?: TaskStatus;
|
786
786
|
originNoteId?: string;
|
787
787
|
editorId?: string;
|
788
788
|
editorGroupId?: string;
|
@@ -972,6 +972,8 @@ export class Task extends Block {
|
|
972
972
|
|
973
973
|
this.originNoteId = originNoteId;
|
974
974
|
this.dateDue = dateDue;
|
975
|
+
|
976
|
+
this._dateDueUserAssigned = false;
|
975
977
|
}
|
976
978
|
}
|
977
979
|
// CORE END
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"author": "Bigfoot",
|
3
3
|
"name": "@bigfootai/bigfoot-types",
|
4
|
-
"version": "3.8.
|
4
|
+
"version": "3.8.6",
|
5
5
|
"description": "The internal library for the types used in the Bigfoot platform",
|
6
6
|
"main": "model.js",
|
7
7
|
"license": "ISC",
|
@@ -14,10 +14,6 @@
|
|
14
14
|
"dev": "node model.js"
|
15
15
|
},
|
16
16
|
"dependencies": {
|
17
|
-
"orderedmap": "^2.1.1",
|
18
|
-
"prosemirror-model": "^1.19.4",
|
19
|
-
"prosemirror-schema-basic": "^1.2.2",
|
20
|
-
"prosemirror-schema-list": "^1.3.0",
|
21
17
|
"uuid": "^9.0.1"
|
22
18
|
},
|
23
19
|
"devDependencies": {
|
package/editor.js
DELETED
@@ -1,123 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.bigfootSchema = void 0;
|
7
|
-
const prosemirror_model_1 = require("prosemirror-model");
|
8
|
-
const prosemirror_schema_basic_1 = require("prosemirror-schema-basic");
|
9
|
-
const prosemirror_schema_list_1 = require("prosemirror-schema-list");
|
10
|
-
const orderedmap_1 = __importDefault(require("orderedmap"));
|
11
|
-
const uuid_1 = require("uuid");
|
12
|
-
const tag = {
|
13
|
-
attrs: {
|
14
|
-
tagId: { default: null },
|
15
|
-
tagType: { default: null },
|
16
|
-
recommendationId: { default: null },
|
17
|
-
ignore: { default: null },
|
18
|
-
},
|
19
|
-
inclusive: false,
|
20
|
-
parseDOM: [
|
21
|
-
{
|
22
|
-
tag: 'span[data-tag-id][data-tag-type][data-recommendation-id][data-ignore]',
|
23
|
-
getAttrs(dom) {
|
24
|
-
return {
|
25
|
-
tagId: dom.getAttribute('data-tag-id'),
|
26
|
-
tagType: dom.getAttribute('data-tag-type'),
|
27
|
-
recommendationId: dom.getAttribute('data-recommendation-id'),
|
28
|
-
ignore: dom.getAttribute('data-ignore'),
|
29
|
-
};
|
30
|
-
},
|
31
|
-
},
|
32
|
-
],
|
33
|
-
//@ts-expect-error Not sure why this is throwing an error, but will revisit
|
34
|
-
toDOM(node) {
|
35
|
-
const { tagId, tagType, recommendationId, ignore } = node.attrs;
|
36
|
-
return [
|
37
|
-
'span',
|
38
|
-
{
|
39
|
-
'data-tag-id': tagId,
|
40
|
-
'data-tag-type': tagType,
|
41
|
-
'data-recommendation-id': recommendationId,
|
42
|
-
'data-ignore': ignore,
|
43
|
-
},
|
44
|
-
0,
|
45
|
-
];
|
46
|
-
},
|
47
|
-
};
|
48
|
-
const checklist = {
|
49
|
-
content: 'checklistItem+',
|
50
|
-
group: 'block',
|
51
|
-
attrs: { editorGroupId: { 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-editor-group-id': node?.attrs?.editorGroupId,
|
57
|
-
},
|
58
|
-
0,
|
59
|
-
],
|
60
|
-
parseDOM: [
|
61
|
-
{
|
62
|
-
tag: 'ul.checklist[data-editor-group-id]',
|
63
|
-
getAttrs(dom) {
|
64
|
-
return {
|
65
|
-
editorGroupId: dom.getAttribute('data-editor-group-id'),
|
66
|
-
};
|
67
|
-
},
|
68
|
-
},
|
69
|
-
],
|
70
|
-
};
|
71
|
-
const checklistItem = {
|
72
|
-
content: 'text*',
|
73
|
-
attrs: { checked: { default: false }, editorId: { default: (0, uuid_1.v4)() } },
|
74
|
-
//@ts-expect-error Not sure why this is throwing an error, but will revisit
|
75
|
-
toDOM: (node) => [
|
76
|
-
[
|
77
|
-
'li',
|
78
|
-
{
|
79
|
-
'data-checked': node?.attrs?.checked ? true : false,
|
80
|
-
'data-editor-id': node?.attrs?.editorId,
|
81
|
-
},
|
82
|
-
],
|
83
|
-
[
|
84
|
-
'input',
|
85
|
-
{
|
86
|
-
type: 'checkbox',
|
87
|
-
checked: node?.attrs?.checked ? 'checked' : '',
|
88
|
-
},
|
89
|
-
],
|
90
|
-
['span', {}],
|
91
|
-
0,
|
92
|
-
],
|
93
|
-
parseDOM: [
|
94
|
-
{
|
95
|
-
tag: 'li[data-checked][data-editor-id]',
|
96
|
-
getAttrs(dom) {
|
97
|
-
return {
|
98
|
-
checked: dom.getAttribute('data-checked'),
|
99
|
-
editorId: dom.getAttribute('data-editor-id'),
|
100
|
-
};
|
101
|
-
},
|
102
|
-
},
|
103
|
-
],
|
104
|
-
};
|
105
|
-
const strong = {
|
106
|
-
parseDOM: [
|
107
|
-
{ tag: 'strong' },
|
108
|
-
{
|
109
|
-
tag: 'b',
|
110
|
-
getAttrs: (node) => node.style.fontWeight != 'normal' && null,
|
111
|
-
},
|
112
|
-
],
|
113
|
-
toDOM: () => ['strong', 0],
|
114
|
-
};
|
115
|
-
exports.bigfootSchema = new prosemirror_model_1.Schema({
|
116
|
-
nodes: (0, prosemirror_schema_list_1.addListNodes)(prosemirror_schema_basic_1.schema.spec.nodes, 'paragraph block*', 'block')
|
117
|
-
.addToEnd('checklist', checklist)
|
118
|
-
.addToEnd('checklistItem', checklistItem),
|
119
|
-
marks: orderedmap_1.default
|
120
|
-
.from(prosemirror_schema_basic_1.schema.spec.marks)
|
121
|
-
.addToEnd('tag', tag)
|
122
|
-
.addToEnd('strong', strong),
|
123
|
-
});
|
package/editor.ts
DELETED
@@ -1,132 +0,0 @@
|
|
1
|
-
import { MarkSpec, NodeSpec, Schema } from 'prosemirror-model';
|
2
|
-
import { schema } from 'prosemirror-schema-basic';
|
3
|
-
import { addListNodes } from 'prosemirror-schema-list';
|
4
|
-
import orderedMap from 'orderedmap';
|
5
|
-
import { v4 as uuidv4 } from 'uuid';
|
6
|
-
|
7
|
-
const tag: MarkSpec = {
|
8
|
-
attrs: {
|
9
|
-
tagId: { default: null },
|
10
|
-
tagType: { default: null },
|
11
|
-
recommendationId: { default: null },
|
12
|
-
ignore: { default: null },
|
13
|
-
},
|
14
|
-
inclusive: false,
|
15
|
-
parseDOM: [
|
16
|
-
{
|
17
|
-
tag: 'span[data-tag-id][data-tag-type][data-recommendation-id][data-ignore]',
|
18
|
-
getAttrs(dom: string | HTMLElement) {
|
19
|
-
return {
|
20
|
-
tagId: (dom as HTMLElement).getAttribute('data-tag-id'),
|
21
|
-
tagType: (dom as HTMLElement).getAttribute('data-tag-type'),
|
22
|
-
recommendationId: (dom as HTMLElement).getAttribute(
|
23
|
-
'data-recommendation-id'
|
24
|
-
),
|
25
|
-
ignore: (dom as HTMLElement).getAttribute('data-ignore'),
|
26
|
-
};
|
27
|
-
},
|
28
|
-
},
|
29
|
-
],
|
30
|
-
//@ts-expect-error Not sure why this is throwing an error, but will revisit
|
31
|
-
toDOM(node: {
|
32
|
-
attrs: {
|
33
|
-
tagId: string;
|
34
|
-
tagType: string;
|
35
|
-
recommendationId: string;
|
36
|
-
ignore: string;
|
37
|
-
};
|
38
|
-
}) {
|
39
|
-
const { tagId, tagType, recommendationId, ignore } = node.attrs;
|
40
|
-
return [
|
41
|
-
'span',
|
42
|
-
{
|
43
|
-
'data-tag-id': tagId,
|
44
|
-
'data-tag-type': tagType,
|
45
|
-
'data-recommendation-id': recommendationId,
|
46
|
-
'data-ignore': ignore,
|
47
|
-
},
|
48
|
-
0,
|
49
|
-
];
|
50
|
-
},
|
51
|
-
};
|
52
|
-
|
53
|
-
const checklist: NodeSpec = {
|
54
|
-
content: 'checklistItem+',
|
55
|
-
group: 'block',
|
56
|
-
attrs: { editorGroupId: { 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-editor-group-id': node?.attrs?.editorGroupId,
|
62
|
-
},
|
63
|
-
0,
|
64
|
-
],
|
65
|
-
parseDOM: [
|
66
|
-
{
|
67
|
-
tag: 'ul.checklist[data-editor-group-id]',
|
68
|
-
getAttrs(dom: HTMLElement) {
|
69
|
-
return {
|
70
|
-
editorGroupId: dom.getAttribute('data-editor-group-id'),
|
71
|
-
};
|
72
|
-
},
|
73
|
-
},
|
74
|
-
],
|
75
|
-
};
|
76
|
-
|
77
|
-
const checklistItem: NodeSpec = {
|
78
|
-
content: 'text*',
|
79
|
-
attrs: { checked: { default: false }, editorId: { default: uuidv4() } },
|
80
|
-
//@ts-expect-error Not sure why this is throwing an error, but will revisit
|
81
|
-
toDOM: (node: NodeSpec) => [
|
82
|
-
[
|
83
|
-
'li',
|
84
|
-
{
|
85
|
-
'data-checked': node?.attrs?.checked ? true : false,
|
86
|
-
'data-editor-id': node?.attrs?.editorId,
|
87
|
-
},
|
88
|
-
],
|
89
|
-
[
|
90
|
-
'input',
|
91
|
-
{
|
92
|
-
type: 'checkbox',
|
93
|
-
checked: node?.attrs?.checked ? 'checked' : '',
|
94
|
-
},
|
95
|
-
],
|
96
|
-
['span', {}],
|
97
|
-
0,
|
98
|
-
],
|
99
|
-
parseDOM: [
|
100
|
-
{
|
101
|
-
tag: 'li[data-checked][data-editor-id]',
|
102
|
-
getAttrs(dom: HTMLElement) {
|
103
|
-
return {
|
104
|
-
checked: dom.getAttribute('data-checked'),
|
105
|
-
editorId: dom.getAttribute('data-editor-id'),
|
106
|
-
};
|
107
|
-
},
|
108
|
-
},
|
109
|
-
],
|
110
|
-
};
|
111
|
-
|
112
|
-
const strong: MarkSpec = {
|
113
|
-
parseDOM: [
|
114
|
-
{ tag: 'strong' },
|
115
|
-
{
|
116
|
-
tag: 'b',
|
117
|
-
getAttrs: (node: HTMLElement) =>
|
118
|
-
node.style.fontWeight != 'normal' && null,
|
119
|
-
},
|
120
|
-
],
|
121
|
-
toDOM: () => ['strong', 0],
|
122
|
-
};
|
123
|
-
|
124
|
-
export const bigfootSchema = new Schema({
|
125
|
-
nodes: addListNodes(schema.spec.nodes, 'paragraph block*', 'block')
|
126
|
-
.addToEnd('checklist', checklist)
|
127
|
-
.addToEnd('checklistItem', checklistItem),
|
128
|
-
marks: orderedMap
|
129
|
-
.from(schema.spec.marks)
|
130
|
-
.addToEnd('tag', tag)
|
131
|
-
.addToEnd('strong', strong),
|
132
|
-
});
|