@wixc3/board-core
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -5,3 +5,2 @@ import type { BoardSetupStageFunction, CanvasStyles } from './types'; | ||
readonly height: 640; | ||
readonly backgroundColor: "#fcfcfc"; | ||
}; | ||
@@ -12,8 +11,6 @@ export declare const defaultCanvasStyles: CanvasStyles; | ||
windowHeight: 640; | ||
windowBackgroundColor: "#fcfcfc"; | ||
canvasMargin: {}; | ||
canvasPadding: {}; | ||
canvasBackgroundColor: string; | ||
}; | ||
export declare const setupBoardStage: BoardSetupStageFunction; | ||
//# sourceMappingURL=setup-stage.d.ts.map |
@@ -8,3 +8,2 @@ "use strict"; | ||
height: 640, | ||
backgroundColor: '#fcfcfc', | ||
}; | ||
@@ -22,3 +21,2 @@ exports.defaultCanvasStyles = { | ||
paddingTop: '0px', | ||
backgroundColor: '#fff', | ||
}; | ||
@@ -28,6 +26,4 @@ exports.defaultEnvironmentProperties = { | ||
windowHeight: exports.defaultWindowStyles.height, | ||
windowBackgroundColor: exports.defaultWindowStyles.backgroundColor, | ||
canvasMargin: {}, | ||
canvasPadding: {}, | ||
canvasBackgroundColor: exports.defaultCanvasStyles.backgroundColor, | ||
}; | ||
@@ -38,7 +34,4 @@ const applyStylesToWindow = (windowStyles = {}, previousProps) => { | ||
previousProps.windowWidth = previousProps.windowWidth ? window.outerWidth : exports.defaultWindowStyles.width; | ||
previousProps.windowBackgroundColor = previousProps.windowBackgroundColor | ||
? document.body.style.backgroundColor | ||
: exports.defaultWindowStyles.backgroundColor; | ||
window.resizeTo(windowStyles.windowWidth || previousProps.windowWidth, windowStyles.windowHeight || previousProps.windowHeight); | ||
document.body.style.backgroundColor = windowStyles.windowBackgroundColor || previousProps.windowBackgroundColor; | ||
document.body.style.backgroundColor = windowStyles.windowBackgroundColor || ''; | ||
}; | ||
@@ -74,3 +67,3 @@ const applyStylesToCanvas = (canvas, environmentProps = {}) => { | ||
: exports.defaultCanvasStyles.paddingTop, | ||
backgroundColor: environmentProps.canvasBackgroundColor || exports.defaultCanvasStyles.backgroundColor, | ||
backgroundColor: environmentProps.canvasBackgroundColor || '', | ||
}; | ||
@@ -108,5 +101,2 @@ // Canvas gets stretched horizontally/vertically | ||
} | ||
if (previousWindowEnvironmentProps.windowBackgroundColor) { | ||
document.body.style.backgroundColor = previousWindowEnvironmentProps.windowBackgroundColor; | ||
} | ||
}; | ||
@@ -113,0 +103,0 @@ return { canvas, updateCanvas, updateWindow, cleanup }; |
@@ -104,3 +104,3 @@ export declare type LayoutSize = number | undefined | null; | ||
}; | ||
export declare type CanvasStyles = Pick<CSSStyleDeclaration, 'backgroundColor' | 'height' | 'width' | 'paddingLeft' | 'paddingRight' | 'paddingBottom' | 'paddingTop' | 'marginLeft' | 'marginRight' | 'marginBottom' | 'marginTop'>; | ||
export declare type CanvasStyles = Pick<CSSStyleDeclaration, 'height' | 'width' | 'paddingLeft' | 'paddingRight' | 'paddingBottom' | 'paddingTop' | 'marginLeft' | 'marginRight' | 'marginBottom' | 'marginTop'>; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@wixc3/board-core", | ||
"description": "Types and helpers for component boards", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "files": [ |
@@ -166,3 +166,2 @@ export type LayoutSize = number | undefined | null; | ||
CSSStyleDeclaration, | ||
| 'backgroundColor' | ||
| 'height' | ||
@@ -169,0 +168,0 @@ | 'width' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44891
658