index.js
133 lines
| 1 | import save1_20_5 from './1.20.5/save'; |
| 2 | import save1_20_7 from './1.20.7/save'; |
| 3 | import save1_89_0 from './1.89.0/save'; |
| 4 | |
| 5 | const blockAttributes = { |
| 6 | content: { |
| 7 | source: 'html', |
| 8 | selector: 'p', |
| 9 | }, |
| 10 | balloonName: { |
| 11 | source: 'html', |
| 12 | selector: 'figcaption', |
| 13 | }, |
| 14 | balloonType: { |
| 15 | type: 'string', |
| 16 | default: 'type-serif', |
| 17 | }, |
| 18 | balloonBgColor: { |
| 19 | type: 'string', |
| 20 | }, |
| 21 | balloonAlign: { |
| 22 | type: 'string', |
| 23 | default: 'position-left', |
| 24 | }, |
| 25 | IconImage: { |
| 26 | type: 'string', |
| 27 | default: null, // no image by default! |
| 28 | }, |
| 29 | }; |
| 30 | |
| 31 | const blockAttributes2 = { |
| 32 | ...blockAttributes, |
| 33 | balloonImageType: { |
| 34 | type: 'string', |
| 35 | default: 'normal', |
| 36 | }, |
| 37 | } |
| 38 | |
| 39 | const blockAttributes3 = { |
| 40 | ...blockAttributes2, |
| 41 | balloonImageType: { |
| 42 | type: 'string', |
| 43 | default: 'normal', // no image by default! |
| 44 | }, |
| 45 | balloonAnimation: { |
| 46 | type: 'string', |
| 47 | default: 'none', // no image by default! |
| 48 | }, |
| 49 | } |
| 50 | |
| 51 | const blockAttributes4 = { |
| 52 | ...blockAttributes3, |
| 53 | balloonImageType: { |
| 54 | type: 'string', |
| 55 | default: 'normal', // no image by default! |
| 56 | }, |
| 57 | balloonAnimation: { |
| 58 | type: 'string', |
| 59 | default: 'none', // no image by default! |
| 60 | }, |
| 61 | balloonBorder: { |
| 62 | type: 'boolean', |
| 63 | default: false, |
| 64 | }, |
| 65 | balloonImageBorder: { |
| 66 | type: 'boolean', |
| 67 | default: false, |
| 68 | }, |
| 69 | balloonBorderWidth: { |
| 70 | type: 'string', |
| 71 | default: 'thin', |
| 72 | }, |
| 73 | balloonBorderColor: { |
| 74 | type: 'string', |
| 75 | default: null, |
| 76 | }, |
| 77 | // balloonTypeのdefaultがtype-serifからtype-speechにver 0.56.0で変更された調整 |
| 78 | balloonType: { |
| 79 | type: 'string', |
| 80 | default: 'type-speech', |
| 81 | }, |
| 82 | } |
| 83 | |
| 84 | const blockAttributes5 = { |
| 85 | ...blockAttributes4, |
| 86 | balloonBorderColor: { |
| 87 | type: 'string', |
| 88 | default: "#cccccc", |
| 89 | }, |
| 90 | balloonBgColor: { |
| 91 | type: 'string', |
| 92 | default: "#f5f5f5", |
| 93 | }, |
| 94 | } |
| 95 | |
| 96 | |
| 97 | const blockAttributes6 = { |
| 98 | ...blockAttributes5, |
| 99 | balloonFullWidth: { |
| 100 | type: 'boolean', |
| 101 | default: false |
| 102 | }, |
| 103 | balloonBorderColor: { |
| 104 | type: 'string', |
| 105 | }, |
| 106 | balloonBgColor: { |
| 107 | type: 'string', |
| 108 | }, |
| 109 | } |
| 110 | |
| 111 | |
| 112 | const deprecated = [ |
| 113 | { |
| 114 | attributes: blockAttributes6, |
| 115 | save: save1_89_0, |
| 116 | migrate: (attributes) => { |
| 117 | return { |
| 118 | ...attributes, |
| 119 | balloonIconDisplay: false, |
| 120 | }; |
| 121 | }, |
| 122 | }, |
| 123 | { |
| 124 | attributes: blockAttributes5, |
| 125 | save: save1_20_7, |
| 126 | }, |
| 127 | { |
| 128 | attributes: blockAttributes5, |
| 129 | save: save1_20_5, |
| 130 | }, |
| 131 | ]; |
| 132 | export default deprecated; |
| 133 |