@bigfootai/bigfoot-types 3.8.3 → 3.8.4
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 +9 -9
- package/editor.ts +9 -9
- package/package.json +1 -1
package/editor.js
CHANGED
@@ -48,21 +48,21 @@ const tag = {
|
|
48
48
|
const checklist = {
|
49
49
|
content: 'checklistItem+',
|
50
50
|
group: 'block',
|
51
|
-
attrs: {
|
51
|
+
attrs: { editorGroupId: { default: (0, uuid_1.v4)() } },
|
52
52
|
//@ts-expect-error Not sure why this is throwing an error, but will revisit
|
53
53
|
toDOM: (node) => [
|
54
54
|
'ul',
|
55
55
|
{
|
56
|
-
'data-
|
56
|
+
'data-editor-group-id': node?.attrs?.editorGroupId,
|
57
57
|
},
|
58
58
|
0,
|
59
59
|
],
|
60
60
|
parseDOM: [
|
61
61
|
{
|
62
|
-
tag: 'ul.checklist[data-
|
62
|
+
tag: 'ul.checklist[data-editor-group-id]',
|
63
63
|
getAttrs(dom) {
|
64
64
|
return {
|
65
|
-
|
65
|
+
editorGroupId: dom.getAttribute('data-editor-group-id'),
|
66
66
|
};
|
67
67
|
},
|
68
68
|
},
|
@@ -70,14 +70,14 @@ const checklist = {
|
|
70
70
|
};
|
71
71
|
const checklistItem = {
|
72
72
|
content: 'text*',
|
73
|
-
attrs: { checked: { default: false },
|
73
|
+
attrs: { checked: { default: false }, editorId: { default: (0, uuid_1.v4)() } },
|
74
74
|
//@ts-expect-error Not sure why this is throwing an error, but will revisit
|
75
75
|
toDOM: (node) => [
|
76
76
|
[
|
77
77
|
'li',
|
78
78
|
{
|
79
79
|
'data-checked': node?.attrs?.checked ? true : false,
|
80
|
-
'data-
|
80
|
+
'data-editor-id': node?.attrs?.editorId,
|
81
81
|
},
|
82
82
|
],
|
83
83
|
[
|
@@ -92,11 +92,11 @@ const checklistItem = {
|
|
92
92
|
],
|
93
93
|
parseDOM: [
|
94
94
|
{
|
95
|
-
tag: 'li[data-checked][data-
|
95
|
+
tag: 'li[data-checked][data-editor-id]',
|
96
96
|
getAttrs(dom) {
|
97
97
|
return {
|
98
|
-
checked: dom.getAttribute('data-checked')
|
99
|
-
|
98
|
+
checked: dom.getAttribute('data-checked'),
|
99
|
+
editorId: dom.getAttribute('data-editor-id'),
|
100
100
|
};
|
101
101
|
},
|
102
102
|
},
|
package/editor.ts
CHANGED
@@ -53,21 +53,21 @@ const tag: MarkSpec = {
|
|
53
53
|
const checklist: NodeSpec = {
|
54
54
|
content: 'checklistItem+',
|
55
55
|
group: 'block',
|
56
|
-
attrs: {
|
56
|
+
attrs: { editorGroupId: { default: uuidv4() } },
|
57
57
|
//@ts-expect-error Not sure why this is throwing an error, but will revisit
|
58
58
|
toDOM: (node: NodeSpec) => [
|
59
59
|
'ul',
|
60
60
|
{
|
61
|
-
'data-
|
61
|
+
'data-editor-group-id': node?.attrs?.editorGroupId,
|
62
62
|
},
|
63
63
|
0,
|
64
64
|
],
|
65
65
|
parseDOM: [
|
66
66
|
{
|
67
|
-
tag: 'ul.checklist[data-
|
67
|
+
tag: 'ul.checklist[data-editor-group-id]',
|
68
68
|
getAttrs(dom: HTMLElement) {
|
69
69
|
return {
|
70
|
-
|
70
|
+
editorGroupId: dom.getAttribute('data-editor-group-id'),
|
71
71
|
};
|
72
72
|
},
|
73
73
|
},
|
@@ -76,14 +76,14 @@ const checklist: NodeSpec = {
|
|
76
76
|
|
77
77
|
const checklistItem: NodeSpec = {
|
78
78
|
content: 'text*',
|
79
|
-
attrs: { checked: { default: false },
|
79
|
+
attrs: { checked: { default: false }, editorId: { default: uuidv4() } },
|
80
80
|
//@ts-expect-error Not sure why this is throwing an error, but will revisit
|
81
81
|
toDOM: (node: NodeSpec) => [
|
82
82
|
[
|
83
83
|
'li',
|
84
84
|
{
|
85
85
|
'data-checked': node?.attrs?.checked ? true : false,
|
86
|
-
'data-
|
86
|
+
'data-editor-id': node?.attrs?.editorId,
|
87
87
|
},
|
88
88
|
],
|
89
89
|
[
|
@@ -98,11 +98,11 @@ const checklistItem: NodeSpec = {
|
|
98
98
|
],
|
99
99
|
parseDOM: [
|
100
100
|
{
|
101
|
-
tag: 'li[data-checked][data-
|
101
|
+
tag: 'li[data-checked][data-editor-id]',
|
102
102
|
getAttrs(dom: HTMLElement) {
|
103
103
|
return {
|
104
|
-
checked: dom.getAttribute('data-checked')
|
105
|
-
|
104
|
+
checked: dom.getAttribute('data-checked'),
|
105
|
+
editorId: dom.getAttribute('data-editor-id'),
|
106
106
|
};
|
107
107
|
},
|
108
108
|
},
|