Skip to content

Commit

Permalink
Separate all properties but supports from Tiled Gallery deprecation e…
Browse files Browse the repository at this point in the history
…xport default object
  • Loading branch information
coder-karen committed Nov 7, 2024
1 parent e349bad commit fac1da0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { LAYOUT_DEFAULT } from './constants';
import save from './save';

const attributes = {
export { default as save } from './save';

export const attributes = {
// Set default align
align: {
default: 'center',
Expand Down Expand Up @@ -78,7 +79,5 @@ const support = {
};

export default {
attributes,
support,
save,
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { LAYOUT_DEFAULT } from './constants';
import save from './save';

const attributes = {
export { default as save } from './save';

export const attributes = {
// Set default align
align: {
default: 'center',
Expand Down Expand Up @@ -80,7 +81,5 @@ const supports = {
};

export default {
attributes,
supports,
save,
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { LAYOUT_DEFAULT } from './constants';
import save from './save';

const attributes = {
export { default as save } from './save';

export const attributes = {
// Set default align
align: {
default: 'center',
Expand Down Expand Up @@ -83,7 +84,7 @@ const supports = {
html: false,
};

const migrate = oldAttributes => {
export const migrate = oldAttributes => {
// The column widths need to be updated to match the new precision
// implemented in the current version.
const precision = Math.pow( 10, 5 );
Expand All @@ -97,8 +98,5 @@ const migrate = oldAttributes => {
};

export default {
attributes,
migrate,
supports,
save,
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { LAYOUT_DEFAULT } from './constants';
import save from './save';

const attributes = {
export { default as save } from './save';

export const attributes = {
// Set default align
align: {
default: 'center',
Expand Down Expand Up @@ -97,7 +98,5 @@ const supports = {
};

export default {
attributes,
supports,
save,
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import attributes from './attributes';
import save from './save';
import supports from './supports';

export { default as attributes } from './attributes';
export { default as save } from './save';

export default {
attributes,
supports,
save,
};
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
import attributes from './attributes';
import save from './save';
import supports from './supports';

export { default as attributes } from './attributes';
export { default as save } from './save';

export default {
attributes,
migrate: oldAttributes => {
// If the old block has classNames set, clean up any old "is-style-*" classes
// that will clash with the new one we're adding.
const className = (
( oldAttributes.className || '' ).replace( /is-style-[^ ]+/, '' ) +
` is-style-${ oldAttributes.mapStyle }`
)
.replace( /\s+/g, ' ' )
.trim();
const { mapStyle, ...newAttributes } = oldAttributes;
return {
...newAttributes,
showFullscreenButton: true,
className,
};
},
supports,
save,
};

0 comments on commit fac1da0

Please sign in to comment.