aurum-canvas
Advanced tools
Comparing version 0.0.25 to 0.0.26
{ | ||
"name": "aurum-canvas", | ||
"version": "0.0.25", | ||
"version": "0.0.26", | ||
"description": "Aurum style scene graph management for rendering in canvas", | ||
@@ -38,4 +38,4 @@ "main": "prebuilt/cjs/aurum-canvas.js", | ||
"dependencies": { | ||
"aurumjs": "^0.7.0" | ||
"aurumjs": "^0.8.0" | ||
} | ||
} |
@@ -51,3 +51,3 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
function State(props, children, api) { | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -93,3 +93,3 @@ const components = api.prerender(children, lc); | ||
var _a; | ||
const lc = aurumjs_2.createLifeCycle(); | ||
const lc = (0, aurumjs_2.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -120,3 +120,3 @@ if (props.onAttach) { | ||
var _a; | ||
const lc = aurumjs_3.createLifeCycle(); | ||
const lc = (0, aurumjs_3.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -168,3 +168,3 @@ if (props.onAttach) { | ||
if (i instanceof aurumjs_3.DataSource) { | ||
i.transform(aurumjs_3.dsUnique(), api.cancellationToken).listen((v) => { | ||
i.transform((0, aurumjs_3.dsUnique)(), api.cancellationToken).listen((v) => { | ||
if (result.renderedState) { | ||
@@ -212,3 +212,3 @@ result.renderedState.lines = []; | ||
var _a, _b; | ||
const lc = aurumjs_4.createLifeCycle(); | ||
const lc = (0, aurumjs_4.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -240,3 +240,3 @@ if (props.onAttach) { | ||
var _a; | ||
const lc = aurumjs_5.createLifeCycle(); | ||
const lc = (0, aurumjs_5.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -267,3 +267,3 @@ if (props.onAttach) { | ||
var _a; | ||
const lc = aurumjs_6.createLifeCycle(); | ||
const lc = (0, aurumjs_6.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -294,3 +294,3 @@ if (props.onAttach) { | ||
var _a, _b; | ||
const lc = aurumjs_7.createLifeCycle(); | ||
const lc = (0, aurumjs_7.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -322,3 +322,3 @@ if (props.onAttach) { | ||
var _a, _b; | ||
const lc = aurumjs_8.createLifeCycle(); | ||
const lc = (0, aurumjs_8.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -653,3 +653,3 @@ if (props.onAttach) { | ||
for (const key of props) { | ||
const baseValue = utilities_1.deref(node[key]); | ||
const baseValue = (0, utilities_1.deref)(node[key]); | ||
const state = (_a = node.animationStates) === null || _a === void 0 ? void 0 : _a.find((n) => n[key] != undefined); | ||
@@ -662,3 +662,3 @@ if (state) { | ||
else { | ||
progress = Math.min(1, (Date.now() - node.animationTime) / utilities_1.deref(state.transitionTime)); | ||
progress = Math.min(1, (Date.now() - node.animationTime) / (0, utilities_1.deref)(state.transitionTime)); | ||
} | ||
@@ -837,3 +837,3 @@ const targetValue = state[key]; | ||
var _a, _b; | ||
const lc = aurumjs_11.createLifeCycle(); | ||
const lc = (0, aurumjs_11.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -856,9 +856,9 @@ const components = api.prerender(children, lc); | ||
if (props.features.mouseWheelZoom) { | ||
features_1.initializeZoomFeature(props, canvas); | ||
(0, features_1.initializeZoomFeature)(props, canvas); | ||
} | ||
if ((_a = props.features.panning) === null || _a === void 0 ? void 0 : _a.mouse) { | ||
features_1.initializeMousePanningFeature(props, canvas); | ||
(0, features_1.initializeMousePanningFeature)(props, canvas); | ||
} | ||
if ((_b = props.features.panning) === null || _b === void 0 ? void 0 : _b.keyboard) { | ||
features_1.initializeKeyboardPanningFeature(props, canvas); | ||
(0, features_1.initializeKeyboardPanningFeature)(props, canvas); | ||
} | ||
@@ -884,3 +884,3 @@ } | ||
if (props.translate) { | ||
props.translate.transform(aurumjs_11.dsUnique(), api.cancellationToken).listen((v) => { | ||
props.translate.transform((0, aurumjs_11.dsUnique)(), api.cancellationToken).listen((v) => { | ||
invalidate(canvas); | ||
@@ -890,3 +890,3 @@ }); | ||
if (props.scale) { | ||
props.scale.transform(aurumjs_11.dsUnique(), api.cancellationToken).listen((v) => { | ||
props.scale.transform((0, aurumjs_11.dsUnique)(), api.cancellationToken).listen((v) => { | ||
invalidate(canvas); | ||
@@ -900,3 +900,3 @@ }); | ||
(_a = props.onDetach) === null || _a === void 0 ? void 0 : _a.call(props); | ||
}, style: props.style, class: props.class, width: typeof props.width !== 'object' ? (_a = props.width) === null || _a === void 0 ? void 0 : _a.toString() : props.width.transform(aurumjs_11.dsMap((v) => v.toString())), height: typeof props.height !== 'object' ? (_b = props.height) === null || _b === void 0 ? void 0 : _b.toString() : props.height.transform(aurumjs_11.dsMap((v) => v.toString())) })); | ||
}, style: props.style, class: props.class, width: typeof props.width !== 'object' ? (_a = props.width) === null || _a === void 0 ? void 0 : _a.toString() : props.width.transform((0, aurumjs_11.dsMap)((v) => v.toString())), height: typeof props.height !== 'object' ? (_b = props.height) === null || _b === void 0 ? void 0 : _b.toString() : props.height.transform((0, aurumjs_11.dsMap)((v) => v.toString())) })); | ||
function bindCanvas(canvas, components, cancellationToken) { | ||
@@ -930,3 +930,3 @@ cancellationToken.registerDomEvent(canvas, 'mouseleave', (e) => { | ||
const label = target; | ||
const size = (_l = utilities_2.deref(label.fontSize)) !== null && _l !== void 0 ? _l : 16; | ||
const size = (_l = (0, utilities_2.deref)(label.fontSize)) !== null && _l !== void 0 ? _l : 16; | ||
if (!label.textBaseline) { | ||
@@ -1076,3 +1076,3 @@ y += size; | ||
if (key === 'state') { | ||
const value = utilities_2.deref(child[key]); | ||
const value = (0, utilities_2.deref)(child[key]); | ||
lastState = value; | ||
@@ -1104,3 +1104,3 @@ child.animationStates = child.animations.filter((e) => e.id === value); | ||
const arrayedValue = Array.isArray(value) ? value : [value]; | ||
const lc = aurumjs_11.createLifeCycle(); | ||
const lc = (0, aurumjs_11.createLifeCycle)(); | ||
const renderResult = []; | ||
@@ -1138,3 +1138,3 @@ for (const piece of arrayedValue) { | ||
else { | ||
context.fillStyle = utilities_2.deref(props.backgroundColor); | ||
context.fillStyle = (0, utilities_2.deref)(props.backgroundColor); | ||
context.fillRect(0, 0, canvas.width, canvas.height); | ||
@@ -1198,24 +1198,24 @@ } | ||
case component_model_9.ComponentType.PATH: | ||
idle = rendering_1.renderPath(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderPath)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_9.ComponentType.REGULAR_POLYGON: | ||
idle = rendering_1.renderRegularPolygon(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderRegularPolygon)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_9.ComponentType.RECTANGLE: | ||
idle = rendering_1.renderRectangle(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderRectangle)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_9.ComponentType.TEXT: | ||
idle = rendering_1.renderText(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderText)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_9.ComponentType.LINE: | ||
idle = rendering_1.renderLine(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderLine)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_9.ComponentType.QUADRATIC_CURVE: | ||
idle = rendering_1.renderQuadraticCurve(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderQuadraticCurve)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_9.ComponentType.BEZIER_CURVE: | ||
idle = rendering_1.renderBezierCurve(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderBezierCurve)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_9.ComponentType.ELIPSE: | ||
idle = rendering_1.renderElipse(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderElipse)(context, child, offsetX, offsetY); | ||
break; | ||
@@ -1230,3 +1230,3 @@ case component_model_9.ComponentType.GROUP: | ||
for (const subChild of child.children) { | ||
renderChild(context, subChild, utilities_2.deref(child.x) + offsetX, utilities_2.deref(child.y) + offsetY); | ||
renderChild(context, subChild, (0, utilities_2.deref)(child.x) + offsetX, (0, utilities_2.deref)(child.y) + offsetY); | ||
} | ||
@@ -1244,3 +1244,3 @@ context.restore(); | ||
var _a, _b; | ||
const lc = aurumjs_12.createLifeCycle(); | ||
const lc = (0, aurumjs_12.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -1272,3 +1272,3 @@ if (props.onAttach) { | ||
var _a; | ||
const lc = aurumjs_13.createLifeCycle(); | ||
const lc = (0, aurumjs_13.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -1299,3 +1299,3 @@ if (props.onAttach) { | ||
var _a; | ||
const lc = aurumjs_14.createLifeCycle(); | ||
const lc = (0, aurumjs_14.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -1302,0 +1302,0 @@ if (props.onAttach) { |
@@ -13,3 +13,3 @@ "use strict"; | ||
var _a, _b; | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -32,9 +32,9 @@ const components = api.prerender(children, lc); | ||
if (props.features.mouseWheelZoom) { | ||
features_1.initializeZoomFeature(props, canvas); | ||
(0, features_1.initializeZoomFeature)(props, canvas); | ||
} | ||
if ((_a = props.features.panning) === null || _a === void 0 ? void 0 : _a.mouse) { | ||
features_1.initializeMousePanningFeature(props, canvas); | ||
(0, features_1.initializeMousePanningFeature)(props, canvas); | ||
} | ||
if ((_b = props.features.panning) === null || _b === void 0 ? void 0 : _b.keyboard) { | ||
features_1.initializeKeyboardPanningFeature(props, canvas); | ||
(0, features_1.initializeKeyboardPanningFeature)(props, canvas); | ||
} | ||
@@ -60,3 +60,3 @@ } | ||
if (props.translate) { | ||
props.translate.transform(aurumjs_1.dsUnique(), api.cancellationToken).listen((v) => { | ||
props.translate.transform((0, aurumjs_1.dsUnique)(), api.cancellationToken).listen((v) => { | ||
invalidate(canvas); | ||
@@ -66,3 +66,3 @@ }); | ||
if (props.scale) { | ||
props.scale.transform(aurumjs_1.dsUnique(), api.cancellationToken).listen((v) => { | ||
props.scale.transform((0, aurumjs_1.dsUnique)(), api.cancellationToken).listen((v) => { | ||
invalidate(canvas); | ||
@@ -76,3 +76,3 @@ }); | ||
(_a = props.onDetach) === null || _a === void 0 ? void 0 : _a.call(props); | ||
}, style: props.style, class: props.class, width: typeof props.width !== 'object' ? (_a = props.width) === null || _a === void 0 ? void 0 : _a.toString() : props.width.transform(aurumjs_1.dsMap((v) => v.toString())), height: typeof props.height !== 'object' ? (_b = props.height) === null || _b === void 0 ? void 0 : _b.toString() : props.height.transform(aurumjs_1.dsMap((v) => v.toString())) })); | ||
}, style: props.style, class: props.class, width: typeof props.width !== 'object' ? (_a = props.width) === null || _a === void 0 ? void 0 : _a.toString() : props.width.transform((0, aurumjs_1.dsMap)((v) => v.toString())), height: typeof props.height !== 'object' ? (_b = props.height) === null || _b === void 0 ? void 0 : _b.toString() : props.height.transform((0, aurumjs_1.dsMap)((v) => v.toString())) })); | ||
function bindCanvas(canvas, components, cancellationToken) { | ||
@@ -106,3 +106,3 @@ cancellationToken.registerDomEvent(canvas, 'mouseleave', (e) => { | ||
const label = target; | ||
const size = (_l = utilities_1.deref(label.fontSize)) !== null && _l !== void 0 ? _l : 16; | ||
const size = (_l = (0, utilities_1.deref)(label.fontSize)) !== null && _l !== void 0 ? _l : 16; | ||
if (!label.textBaseline) { | ||
@@ -252,3 +252,3 @@ y += size; | ||
if (key === 'state') { | ||
const value = utilities_1.deref(child[key]); | ||
const value = (0, utilities_1.deref)(child[key]); | ||
lastState = value; | ||
@@ -280,3 +280,3 @@ child.animationStates = child.animations.filter((e) => e.id === value); | ||
const arrayedValue = Array.isArray(value) ? value : [value]; | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
const renderResult = []; | ||
@@ -314,3 +314,3 @@ for (const piece of arrayedValue) { | ||
else { | ||
context.fillStyle = utilities_1.deref(props.backgroundColor); | ||
context.fillStyle = (0, utilities_1.deref)(props.backgroundColor); | ||
context.fillRect(0, 0, canvas.width, canvas.height); | ||
@@ -374,24 +374,24 @@ } | ||
case component_model_1.ComponentType.PATH: | ||
idle = rendering_1.renderPath(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderPath)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_1.ComponentType.REGULAR_POLYGON: | ||
idle = rendering_1.renderRegularPolygon(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderRegularPolygon)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_1.ComponentType.RECTANGLE: | ||
idle = rendering_1.renderRectangle(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderRectangle)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_1.ComponentType.TEXT: | ||
idle = rendering_1.renderText(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderText)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_1.ComponentType.LINE: | ||
idle = rendering_1.renderLine(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderLine)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_1.ComponentType.QUADRATIC_CURVE: | ||
idle = rendering_1.renderQuadraticCurve(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderQuadraticCurve)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_1.ComponentType.BEZIER_CURVE: | ||
idle = rendering_1.renderBezierCurve(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderBezierCurve)(context, child, offsetX, offsetY); | ||
break; | ||
case component_model_1.ComponentType.ELIPSE: | ||
idle = rendering_1.renderElipse(context, child, offsetX, offsetY); | ||
idle = (0, rendering_1.renderElipse)(context, child, offsetX, offsetY); | ||
break; | ||
@@ -406,3 +406,3 @@ case component_model_1.ComponentType.GROUP: | ||
for (const subChild of child.children) { | ||
renderChild(context, subChild, utilities_1.deref(child.x) + offsetX, utilities_1.deref(child.y) + offsetY); | ||
renderChild(context, subChild, (0, utilities_1.deref)(child.x) + offsetX, (0, utilities_1.deref)(child.y) + offsetY); | ||
} | ||
@@ -409,0 +409,0 @@ context.restore(); |
@@ -8,3 +8,3 @@ "use strict"; | ||
var _a, _b; | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -11,0 +11,0 @@ if (props.onAttach) { |
@@ -8,3 +8,3 @@ "use strict"; | ||
var _a; | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -11,0 +11,0 @@ if (props.onAttach) { |
@@ -8,3 +8,3 @@ "use strict"; | ||
var _a, _b; | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -11,0 +11,0 @@ if (props.onAttach) { |
@@ -8,3 +8,3 @@ "use strict"; | ||
var _a; | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -11,0 +11,0 @@ if (props.onAttach) { |
@@ -8,3 +8,3 @@ "use strict"; | ||
var _a, _b; | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -11,0 +11,0 @@ if (props.onAttach) { |
@@ -8,3 +8,3 @@ "use strict"; | ||
var _a; | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -11,0 +11,0 @@ if (props.onAttach) { |
@@ -8,3 +8,3 @@ "use strict"; | ||
var _a, _b; | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -11,0 +11,0 @@ if (props.onAttach) { |
@@ -8,3 +8,3 @@ "use strict"; | ||
var _a; | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -11,0 +11,0 @@ if (props.onAttach) { |
@@ -8,3 +8,3 @@ "use strict"; | ||
var _a; | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -11,0 +11,0 @@ if (props.onAttach) { |
@@ -8,3 +8,3 @@ "use strict"; | ||
var _a; | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -56,3 +56,3 @@ if (props.onAttach) { | ||
if (i instanceof aurumjs_1.DataSource) { | ||
i.transform(aurumjs_1.dsUnique(), api.cancellationToken).listen((v) => { | ||
i.transform((0, aurumjs_1.dsUnique)(), api.cancellationToken).listen((v) => { | ||
if (result.renderedState) { | ||
@@ -59,0 +59,0 @@ result.renderedState.lines = []; |
@@ -8,3 +8,3 @@ "use strict"; | ||
function State(props, children, api) { | ||
const lc = aurumjs_1.createLifeCycle(); | ||
const lc = (0, aurumjs_1.createLifeCycle)(); | ||
api.synchronizeLifeCycle(lc); | ||
@@ -11,0 +11,0 @@ const components = api.prerender(children, lc); |
@@ -296,3 +296,3 @@ "use strict"; | ||
for (const key of props) { | ||
const baseValue = utilities_1.deref(node[key]); | ||
const baseValue = (0, utilities_1.deref)(node[key]); | ||
const state = (_a = node.animationStates) === null || _a === void 0 ? void 0 : _a.find((n) => n[key] != undefined); | ||
@@ -305,3 +305,3 @@ if (state) { | ||
else { | ||
progress = Math.min(1, (Date.now() - node.animationTime) / utilities_1.deref(state.transitionTime)); | ||
progress = Math.min(1, (Date.now() - node.animationTime) / (0, utilities_1.deref)(state.transitionTime)); | ||
} | ||
@@ -308,0 +308,0 @@ const targetValue = state[key]; |
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
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
625002
+ Addedaurumjs@0.8.16(transitive)
- Removedaurumjs@0.7.6(transitive)
Updatedaurumjs@^0.8.0