Skip to content

Commit 5f659b0

Browse files
committed
Rename root node to camel case
1 parent 04d8f48 commit 5f659b0

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

docs/available-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Mutators support mutating the following node and mark types.
2727
| tableRow ||| |
2828
| text | || |
2929
| set | || |
30-
| bmu_root | || Mutator node wrapping all content |
30+
| bmuRoot | || Mutator node wrapping all content |
3131

3232
## Marks
3333

docs/mutators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ This is an advanced feature that requires an [additonal step](installation#enabl
9090

9191
The `$meta` argument contains metadata about the current node or mark. It's an array that contains the following keys:
9292

93-
* **root (object):** The `bmu_root` node for this Bard value
93+
* **root (object):** The `bmuRoot` node for this Bard value
9494
* **parent (object):** The parent node
9595
* **prev (object):** The previous node/mark
9696
* **next (object):** The next node/mark

src/Mutator.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@ public function __construct($extensions)
2828
$this->extensions = $extensions;
2929

3030
Augmentor::addExtensions([
31-
'bmu_root' => new Nodes\Root(),
31+
'bmuRoot' => new Nodes\Root(),
3232
]);
3333
}
3434

3535
public function injectRoot($value)
3636
{
3737
$value['content'] = [[
38-
'type' => 'bmu_root',
38+
'type' => 'bmuRoot',
3939
'content' => $value['content'],
4040
]];
41+
4142
return $value;
4243
}
4344

@@ -126,9 +127,9 @@ public function mutateData($type, $data)
126127
public function mutate($kind, $type, $value, array $params = [])
127128
{
128129
if ($kind === 'renderHtml' && $stored = $this->fetchRenderHTML($params['data'])) {
129-
return $stored;
130+
return $stored;
130131
}
131-
132+
132133
$mutators = $this->mutators($type, $kind);
133134

134135
$meta = isset($params['data'])
@@ -138,12 +139,12 @@ public function mutate($kind, $type, $value, array $params = [])
138139
foreach ($mutators as $mutator) {
139140
$value = Value::normalize($kind, $value);
140141
$value = app()->call($mutator, [
141-
'type' => $type,
142-
'meta' => $meta,
142+
'type' => $type,
143+
'meta' => $meta,
143144
'value' => $value,
144145
] + $params);
145146
}
146-
147+
147148
if ($kind === 'renderHtml') {
148149
$this->storeRenderHTML($params['data'], $value);
149150
}

src/Nodes/Root.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class Root extends \Tiptap\Core\Node
88
{
9-
public static $name = 'bmu_root';
9+
public static $name = 'bmuRoot';
1010

1111
public function renderHTML($node, $HTMLAttributes = [])
1212
{

0 commit comments

Comments
 (0)