File tree Expand file tree Collapse file tree 2 files changed +28
-8
lines changed
example/src/woly/atoms/button
gatsby-theme-woly/plugins Expand file tree Collapse file tree 2 files changed +28
-8
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,22 @@ const Example = () => (
23
23
);
24
24
```
25
25
26
+ First
27
+
28
+ <Frame >
29
+ <New />
30
+ <button.Base />
31
+ </Frame >
32
+
33
+ Second
34
+
35
+ <Frame >
36
+ <New />
37
+ <button.Base />
38
+ </Frame >
39
+
40
+ Third
41
+
26
42
<Frame >
27
43
<New />
28
44
<button.Base />
@@ -39,10 +55,10 @@ const Example = () => (
39
55
40
56
### Props
41
57
42
- | Name | Type | Default | Description |
43
- | ------- | ------------------------------- | ---------- | ---------------------------------------------------------- |
44
- | ` text ` | ` React.ReactNode ` | | Text appeared on the button |
45
- | ` left ` | ` React.ReactNode ` | ` null ` | Component to show on the left side of the text (ex.: Icon) |
46
- | ` right ` | ` React.ReactNode ` | ` null ` | Component on the right side of the text |
47
- | ` type ` | `'button' | 'submit' | 'reset'` | ` 'button' ` | HTML type of the button |
48
- | ` ... ` | ` HTMLButtonElementProps ` | ` {} ` | Other props is inherited from ` HTMLButtonElement ` |
58
+ | Name | Type | Default | Description |
59
+ | ------- | ------------------------ | -------- | ---------------------------------------------------------- | ---------- | ----------------------- |
60
+ | ` text ` | ` React.ReactNode ` | | Text appeared on the button |
61
+ | ` left ` | ` React.ReactNode ` | ` null ` | Component to show on the left side of the text (ex.: Icon) |
62
+ | ` right ` | ` React.ReactNode ` | ` null ` | Component on the right side of the text |
63
+ | ` type ` | `'button' | 'submit' | 'reset'` | ` 'button' ` | HTML type of the button |
64
+ | ` ... ` | ` HTMLButtonElementProps ` | ` {} ` | Other props is inherited from ` HTMLButtonElement ` |
Original file line number Diff line number Diff line change @@ -19,8 +19,12 @@ module.exports = (options) => {
19
19
} ) ;
20
20
} ) ;
21
21
22
+ // When new element added to AST list, other elements is moved down
23
+ // Absolute index of each element in `codes` has incorrect `at` position
24
+ let shift = 0 ;
22
25
codes . forEach ( ( { at, node, parent } ) => {
23
- parent . children . splice ( at + 1 , 0 , node ) ;
26
+ parent . children . splice ( at + 1 + shift , 0 , node ) ;
27
+ shift ++ ;
24
28
} ) ;
25
29
26
30
delete codes ;
You can’t perform that action at this time.
0 commit comments