view release on metacpan or search on metacpan
0.08 2020-01-22 22:00:00+0000
-Support for using children without name when it's the first parameter
0.07 2020-01-21 22:00:00+0000
-Support for creating dependencies with objects and support for aliased & imported functions (same as components)
0.06 2020-01-19 22:00:00+0000
-Support PreventUpdate
-Support multiple outputs
-Add functions to work with aliased collections of components and also as imported functions
-Use Moo
0.05 2020-01-06 22:00:00+0000
-Support state for callbacks
0.04 2020-01-01 21:00:00+0000
-Support async resources
0.03 2020-01-01 20:00:00+0000
-Add Changes file
-Add Dash Table component
Build.PL
CONTRIBUTING.md
Changes
LICENSE
MANIFEST
META.json
META.yml
README
appveyor.yml
dist.ini
examples/basic_callbacks.pl
examples/basic_callbacks_dependencies_as_objects.pl
examples/basic_callbacks_dependencies_as_objects_using_functions.pl
examples/basic_callbacks_loading_component_by_component.pl
examples/basic_callbacks_using_imported_functions.pl
examples/data_table.pl
examples/random_chart.pl
examples/tutorial/02-Layout/app.pl
examples/tutorial/02-Layout/core_components.pl
examples/tutorial/02-Layout/data_frame.pl
examples/tutorial/02-Layout/markdown.pl
examples/tutorial/02-Layout/reusable_components.pl
examples/tutorial/02-Layout/styles.pl
examples/tutorial/03-Basic_Callbacks/basic_callbacks.pl
examples/tutorial/03-Basic_Callbacks/chained_callbacks.pl
examples/tutorial/03-Basic_Callbacks/multiple_inputs.pl
examples/tutorial/03-Basic_Callbacks/multiple_outputs.pl
examples/tutorial/03-Basic_Callbacks/slider.pl
examples/tutorial/04-More_About_Callbacks/multiple_input.pl
examples/tutorial/04-More_About_Callbacks/no_update.pl
examples/tutorial/04-More_About_Callbacks/prevent_update.pl
examples/tutorial/04-More_About_Callbacks/state.pl
examples/tutorial/05-Interactive_Visualizations/basic_interactions.pl
examples/tutorial/05-Interactive_Visualizations/generic_crossfilter.pl
examples/tutorial/05-Interactive_Visualizations/update_on_hover.pl
lib/Dash.pm view on Meta::CPAN
has port => ( is => 'ro',
default => 8080 );
has external_stylesheets => ( is => 'rw',
default => sub { [] } );
has _layout => ( is => 'rw',
default => sub { {} } );
has _callbacks => ( is => 'rw',
default => sub { {} } );
has _rendered_scripts => ( is => 'rw',
default => "" );
has _rendered_external_stylesheets => ( is => 'rw',
default => "" );
has backend => ( is => 'rw',
default => sub { Dash::Backend::Mojolicious::App->new( dash_app => shift ) } );
lib/Dash.pm view on Meta::CPAN
}
sub callback {
my $self = shift;
my %callback = $self->_process_callback_arguments(@_);
# TODO check_callback
# TODO Callback map
my $output = $callback{Output};
my $callback_id = $self->_create_callback_id($output);
my $callbacks = $self->_callbacks;
$callbacks->{$callback_id} = \%callback;
return $self;
}
my $no_update;
my $internal_no_update = bless( \$no_update, 'Dash::Internal::NoUpdate' );
sub no_update {
return $internal_no_update;
}
lib/Dash.pm view on Meta::CPAN
if ( not caller(1) ) {
Browser::Open::open_browser( 'http://127.0.0.1:' . $self->port );
$self->backend->start( 'daemon', '-l', 'http://*:' . $self->port );
}
return $self->backend;
}
sub _dependencies {
my $self = shift;
my $dependencies = [];
for my $callback ( values %{ $self->_callbacks } ) {
my $rendered_callback = { clientside_function => JSON::null };
my $states = [];
for my $state ( @{ $callback->{State} } ) {
my $rendered_state = { id => $state->{component_id},
property => $state->{component_property}
};
push @$states, $rendered_state;
}
$rendered_callback->{state} = $states;
my $inputs = [];
lib/Dash.pm view on Meta::CPAN
}
push @$dependencies, $rendered_callback;
}
return $dependencies;
}
sub _update_component {
my $self = shift;
my $request = shift;
if ( scalar( values %{ $self->_callbacks } ) > 0 ) {
my $callbacks = $self->_search_callback( $request->{'output'} );
if ( scalar @$callbacks > 1 ) {
die 'Not implemented multiple callbacks';
} elsif ( scalar @$callbacks == 1 ) {
my $callback = $callbacks->[0];
my @callback_arguments = ();
my $callback_context = {};
for my $callback_input ( @{ $callback->{Inputs} } ) {
my ( $component_id, $component_property ) = @{$callback_input}{qw(component_id component_property)};
for my $change_input ( @{ $request->{inputs} } ) {
my ( $id, $property, $value ) = @{$change_input}{qw(id property value)};
if ( $component_id eq $id && $component_property eq $property ) {
push @callback_arguments, $value;
$callback_context->{inputs}{ $id . "." . $property } = $value;
last;
lib/Dash.pm view on Meta::CPAN
my $props_updated = { $updated_property => $updated_value };
return { response => { props => $props_updated } };
} else {
die 'Callback not supported';
}
} else {
return { response => "There is no matching callback" };
}
} else {
return { response => "There is no registered callbacks" };
}
return { response => "Internal error" };
}
sub _search_callback {
my $self = shift;
my $output = shift;
my $callbacks = $self->_callbacks;
my @matching_callbacks = ( $callbacks->{$output} );
return \@matching_callbacks;
}
sub _rendered_stylesheets {
return '';
}
sub _render_external_stylesheets {
my $self = shift;
my $stylesheets = $self->external_stylesheets;
my $rendered_external_stylesheets = "";
lib/Dash.pm view on Meta::CPAN
This is the Perl code that gets executed when some component changes
and the result of this execution another component (or components) gets updated.
Every callback declares a set of inputs, a set of outputs and optionally a set of "state" inputs.
All inputs, outputs and "state" inputs are known as callback dependencies. Every dependency is related to
some property of some component, so the inputs determine that if a property of a component declared as input
in a callback will trigger that callback, and the output returned by the callback will update the property of
the component declared as output.
=back
So to make a Dash app you just need to setup the layout and the callbacks. The basic skeleton will be:
my $app = Dash->new(app_name => 'My Perl Dash App');
$app->layout(...);
$app->callback(...);
$app->run_server();
In the SYNOPSIS you can get a taste of how this works and also in L<the examples folder of the distribution|https://metacpan.org/release/Dash>
=head1 Layout
lib/Dash.pm view on Meta::CPAN
use Dash::Html::ComponentsFunctions;
...
$app->layout(Div(id => 'my-div', children => 'This is a simple div'));
# same as
$app->layout(Div('This is a simple div', id => 'my-div'));
=head1 Callbacks
Callbacks are the reactive part of the web app. They listen to changes in properties of components and get fired by those changes.
The output of the callbacks can update properties for other componentes (or different properties for the same components) and
potentially firing other callbacks. So your app is "reacting" to changes. These properties that fire changes and the properties
that get updated are dependencies of the callback, they are the "links" between components and callbacks.
Every component that is expected to fire a callback must have a unique id property.
To define a callback is necessary at least:
=over 4
=item Inputs
The component property (or components properties) which fire the callback on every change. The values of this properties are inputs for the callbacks
=item Output
The component (or components) whose property (or properties) get updated
=item callback
The code that gets executed
=back
lib/Dash.pm view on Meta::CPAN
Output => {component_id => 'my-div', component_property => 'children'},
Inputs => [{component_id=>'my-id', component_property=> 'value'}],
callback => sub {
my $input_value = shift;
return "You've entered '$input_value'";
}
);
=head2 Dependencies
Dependencies "link" components and callbacks. Every callback dependency has the following attributes:
=over 4
=item component_id
Value of the id property for the component
=item component_property
Name of the property
lib/Dash.pm view on Meta::CPAN
minor changes:
=over 4
=item * Use of -> (arrow operator) instead of .
=item * Main package and class for apps is Dash
=item * Component suites will use Perl package convention, I mean: dash_html_components will be Dash::Html::Components
=item * Instead of decorators we'll use plain old callbacks
=item * Callback context is available as the last parameter of the callback but without the response part
=item * Instead of Flask we'll be using L<Mojolicious> (Maybe in the future L<Dancer2>)
=back
In the SYNOPSIS you can get a taste of how this works and also in L<the examples folder of the distribution|https://metacpan.org/release/Dash> or directly in L<repository|https://github.com/pablrod/perl-Dash/tree/master/examples>. The full Dash tutor...
=head2 Missing parts
share/assets/dash_core_components/async~dropdown.js.map view on Meta::CPAN
{"version":3,"sources":["webpack:///./node_modules/react-virtualized/dist/commonjs/Grid/types.js","webpack:///./node_modules/react-virtualized/dist/commonjs/Grid/index.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/react-virt...
share/assets/dash_core_components/async~graph.js.map view on Meta::CPAN
{"version":3,"sources":["webpack:///./node_modules/@babel/runtime/regenerator/index.js","webpack:///./node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack:///./node_modules/regenerator-runtime/runtime.js","webpack:///./node_modules/resiz...
share/assets/dash_core_components/async~plotlyjs.js view on Meta::CPAN
(window.webpackJsonpdash_core_components=window.webpackJsonpdash_core_components||[]).push([[5],{685:function(t,e){!function(r){"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define([],r):("undefined"!=typeof windo...
share/assets/dash_core_components/dash_core_components.min.js.map view on Meta::CPAN
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"PropTypes\"","webpack:///external \"React\"","webpack:///./node_modules/@babel/runtime/helpers/classCallCheck.js","webpack:///./node_modules/@babel/runtime/helpers/createCl...
share/assets/dash_core_components/plotly.min.js view on Meta::CPAN
/**
* plotly.js v1.51.3
* Copyright 2012-2019, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self...
share/assets/dash_html_components/dash_html_components.min.js.map view on Meta::CPAN
{"version":3,"sources":["webpack://dash_html_components/webpack/bootstrap","webpack://dash_html_components/external \"React\"","webpack://dash_html_components/external \"PropTypes\"","webpack://dash_html_components/./node_modules/ramda/es/F.js","webp...
share/assets/dash_renderer/dash_renderer.dev.js view on Meta::CPAN
/***/ "./node_modules/radium/es/plugins/mouse-up-listener.js":
/*!*************************************************************!*\
!*** ./node_modules/radium/es/plugins/mouse-up-listener.js ***!
\*************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
var _callbacks = [];
var _mouseUpListenerIsActive = false;
function _handleMouseUp() {
_callbacks.forEach(function (callback) {
callback();
});
}
var subscribe = function subscribe(callback) {
if (_callbacks.indexOf(callback) === -1) {
_callbacks.push(callback);
}
if (!_mouseUpListenerIsActive) {
window.addEventListener('mouseup', _handleMouseUp);
_mouseUpListenerIsActive = true;
}
return {
remove: function remove() {
var index = _callbacks.indexOf(callback);
_callbacks.splice(index, 1);
if (_callbacks.length === 0 && _mouseUpListenerIsActive) {
window.removeEventListener('mouseup', _handleMouseUp);
_mouseUpListenerIsActive = false;
}
}
};
};
/* harmony default export */ __webpack_exports__["default"] = ({
subscribe: subscribe,
__triggerForTests: _handleMouseUp
share/assets/dash_renderer/dash_renderer.dev.js view on Meta::CPAN
zlib
Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
http://www.zlib.net/zlib_license.html
*/
(function(global) {
var Module = function(Module) {
Module = Module || {};
var Module = Module;
var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var...
var asm=(function(global,env,buffer) {
"use asm";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float3...
// EMSCRIPTEN_START_FUNCS
function CV(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0;$=l;l=l+9...
function s_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;a:do if((e|0)!=(f|0)){p=b+76|0;l=b+356|0;m=f;n=b+360|0;i=e+1|0;o=b+364|0;h=m-e|0;j=(i|0)==(f|0);k=e+2|0;b:do switch(a[p+(d[e>>0]|0)>>0]|0){case 4:{if(j){e=-1;break a...
function yb(a){a=a|0;var b=0;b=l;l=l+a|0;l=l+15&-16;return b|0}function zb(){return l|0}function Ab(a){a=a|0;l=a}function Bb(a,b){a=a|0;b=b|0;l=a;m=b}function Cb(a,b){a=a|0;b=b|0;if(!o){o=a;p=b}}function Db(a){a=a|0;D=a}function Eb(){return D|0}funct...
function EB(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=(e|0)!=0;i=b+64|0;do if(j){if((a[e>>0]|0)!=37?(h=c[i>>2]|0,h=wb[c[(c[h+4>>2]|0)+4>>2]&63](c[h+16>>2]|0,d,e,f,g)|0,h|0):0)break;h=JB(b,d,e,f)|0;if(!h)k=5}else k=5;while(0);if((...
function EI(b,d){b=b|0;d=d|0;var e=0,f=0.0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+48|0;q=s;o=s+40|0;p=s+36|0;r=s+32|0;e=NA(d,141280)|0;if(!e){j=1;e=137499}else{i=(a[e>>0]|0)==0;j=i&1;e=i?137499:e}h=c[b+152>>2]|0;i=(a[e>>0]|0)==116;if(!(h...
function aQ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=l;l=l+16|0;g=j;a[g>>0]=b;a[g+1>>0]=0;g=cQ(g)|0;h=d+4|0;i=d+8|0;e=D3(g)|0;f=g;while(1){if((e|0)<=1)break;b=c[h>>2]|0;if(b>>>0>=(c[i>>2]|0)>>>0){iA(d,1)|0;b=c[h>>2]|0}k=a[f>>0]|0;c[h>>2]=b+...
function pq(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0,n=0.0,o=0.0,p=0,q=0.0,r=0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0,B=0.0,C=0,D=0,E=0,F=0,I=0,J=0.0,K=0.0,L=0,M=0,N=0,O=0.0,P=0.0,Q=0,R=0,T=0,U=0,V=0,W=0,X=0,Y=0.0,Z=0...
share/assets/dash_renderer/dash_renderer.dev.js view on Meta::CPAN
}
_createClass(TreeContainer, [{
key: "setProps",
value: function setProps(newProps) {
var _this$props = this.props,
_dashprivate_dependencies = _this$props._dashprivate_dependencies,
_dashprivate_dispatch = _this$props._dashprivate_dispatch,
_dashprivate_path = _this$props._dashprivate_path,
_dashprivate_layout = _this$props._dashprivate_layout;
var id = this.getLayoutProps().id; // Identify the modified props that are required for callbacks
var watchedKeys = Object(ramda__WEBPACK_IMPORTED_MODULE_5__["filter"])(function (key) {
return _dashprivate_dependencies && _dashprivate_dependencies.find(function (dependency) {
return dependency.inputs.find(function (input) {
return input.id === id && input.property === key;
}) || dependency.state.find(function (state) {
return state.id === id && state.property === key;
});
});
})(Object(ramda__WEBPACK_IMPORTED_MODULE_5__["keysIn"])(newProps)); // setProps here is triggered by the UI - record these changes
share/assets/dash_renderer/dash_renderer.dev.js view on Meta::CPAN
* for example, perhaps the user has hidden one of the observers
*/
if (controllersInFutureQueue.length === 0 && Object(ramda__WEBPACK_IMPORTED_MODULE_0__["any"])(function (e) {
return Object(ramda__WEBPACK_IMPORTED_MODULE_0__["has"])(e, getState().paths);
})(outputIds) && !controllerIsInExistingQueue) {
queuedObservers.push(outputIdAndProp);
}
});
/**
* Determine the id of all components used as input or state in the callbacks
* triggered by the props change.
*
* Wait for all components associated to these ids to be ready before initiating
* the callbacks.
*/
deps = queuedObservers.map(function (output) {
return dependenciesRequest.content.find(function (dependency) {
return dependency.output === output;
});
});
ids = Object(ramda__WEBPACK_IMPORTED_MODULE_0__["uniq"])(Object(ramda__WEBPACK_IMPORTED_MODULE_0__["flatten"])(deps.map(function (dep) {
return [dep.inputs.map(function (input) {
return input.id;
share/assets/dash_renderer/dash_renderer.dev.js view on Meta::CPAN
_classCallCheck(this, CallbackGraphContainer);
return _possibleConstructorReturn(this, _getPrototypeOf(CallbackGraphContainer).call(this, props));
}
_createClass(CallbackGraphContainer, [{
key: "render",
value: function render() {
var dependenciesRequest = this.props.dependenciesRequest;
var elements = {};
var callbacks = [];
var links = dependenciesRequest.content.map(function (_ref, i) {
var inputs = _ref.inputs,
output = _ref.output;
callbacks.push("cb".concat(i, ";"));
function recordAndReturn(_ref2) {
var _ref3 = _slicedToArray(_ref2, 2),
id = _ref3[0],
property = _ref3[1];
elements[id] = elements[id] || {};
elements[id][property] = true;
return "\"".concat(id, ".").concat(property, "\"");
}
share/assets/dash_renderer/dash_renderer.dev.js view on Meta::CPAN
var out_nodes = output.replace(/^\.\./, '').replace(/\.\.$/, '').split('...').map(function (o) {
return recordAndReturn(o.split('.'));
}).join(', ');
var in_nodes = inputs.map(function (_ref4) {
var id = _ref4.id,
property = _ref4.property;
return recordAndReturn([id, property]);
}).join(', ');
return "{".concat(in_nodes, "} -> cb").concat(i, " -> {").concat(out_nodes, "};");
});
var dot = "digraph G {\n overlap = false; fontname=\"Arial\"; fontcolor=\"#333333\";\n edge [color=\"#888888\"];\n node [shape=box, fontname=\"Arial\", style=filled, color=\"#109DFF\", fontcolor=white];\n ...
var _ref6 = _slicedToArray(_ref5, 2),
id = _ref6[0],
props = _ref6[1];
return "\n subgraph cluster_".concat(i, " {\n bgcolor=\"#B9C2CE\";\n ").concat(Object.keys(props).map(function (p) {
return "\"".concat(id, ".").concat(p, "\" [label=\"").concat(p, "\"];");
}).join('\n'), "\n label = \"").concat(id, "\"; }");
}).join('\n'), "\n\n ").concat(links.join('\n'), " }");
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
className: "dash-callback-dag--container",
share/assets/dash_renderer/dash_renderer.dev.js view on Meta::CPAN
}
var vals = originalVal === undefined ? [newVal] : [newVal, originalVal];
storage.setItem(valsKey, vals, dispatch);
}
}
}, persisted_props);
}
/*
* Used for entire layouts (on load) or partial layouts (from children
* callbacks) to apply previously-stored UI edits to components
*/
function applyPersistence(layout, dispatch) {
if (Object(ramda__WEBPACK_IMPORTED_MODULE_0__["type"])(layout) !== 'Object' || !layout.props) {
return layout;
}
return persistenceMods(layout, layout, [], dispatch);
}
var UNDO = true;
share/assets/dash_renderer/react-dom@16.8.6.js view on Meta::CPAN
// null and keep rendering. In the commit phase, we'll schedule a
// subsequent synchronous update to re-render the Suspense.
//
// Note: It doesn't matter whether the component that suspended was
// inside a concurrent mode tree. If the Suspense is outside of it, we
// should *not* suspend the commit.
if ((_workInProgress.mode & ConcurrentMode) === NoEffect) {
_workInProgress.effectTag |= DidCapture;
// We're going to commit this fiber even though it didn't complete.
// But we shouldn't call any lifecycle methods or callbacks. Remove
// all lifecycle effect tags.
sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);
if (sourceFiber.tag === ClassComponent) {
var currentSourceFiber = sourceFiber.alternate;
if (currentSourceFiber === null) {
// This is a new mount. Change the tag so it's not mistaken for a
// completed class component. For example, we should not call
// componentWillUnmount if it is deleted.
sourceFiber.tag = IncompleteClassComponent;
share/assets/dash_renderer/react-dom@16.8.6.js view on Meta::CPAN
stopCommitHostEffectsTimer();
resetAfterCommit(root.containerInfo);
// The work-in-progress tree is now the current tree. This must come after
// the first pass of the commit phase, so that the previous tree is still
// current during componentWillUnmount, but before the second pass, so that
// the finished work is current during componentDidMount/Update.
root.current = finishedWork;
// In the second pass we'll perform all life-cycles and ref callbacks.
// Life-cycles happen as a separate pass so that all placements, updates,
// and deletions in the entire tree have already been invoked.
// This pass also triggers any renderer-specific initial effects.
nextEffect = firstEffect;
startCommitLifeCyclesTimer();
while (nextEffect !== null) {
var _didError2 = false;
var _error2 = void 0;
{
invokeGuardedCallback(null, commitAllLifeCycles, null, root, committedExpirationTime);
share/assets/dash_renderer/react-dom@16.8.6.js view on Meta::CPAN
};
}
setRestoreImplementation(restoreControlledState$1);
function ReactBatch(root) {
var expirationTime = computeUniqueAsyncExpiration();
this._expirationTime = expirationTime;
this._root = root;
this._next = null;
this._callbacks = null;
this._didComplete = false;
this._hasChildren = false;
this._children = null;
this._defer = true;
}
ReactBatch.prototype.render = function (children) {
!this._defer ? invariant(false, 'batch.render: Cannot render a batch that already committed.') : void 0;
this._hasChildren = true;
this._children = children;
var internalRoot = this._root._internalRoot;
var expirationTime = this._expirationTime;
var work = new ReactWork();
updateContainerAtExpirationTime(children, internalRoot, null, expirationTime, work._onCommit);
return work;
};
ReactBatch.prototype.then = function (onComplete) {
if (this._didComplete) {
onComplete();
return;
}
var callbacks = this._callbacks;
if (callbacks === null) {
callbacks = this._callbacks = [];
}
callbacks.push(onComplete);
};
ReactBatch.prototype.commit = function () {
var internalRoot = this._root._internalRoot;
var firstBatch = internalRoot.firstBatch;
!(this._defer && firstBatch !== null) ? invariant(false, 'batch.commit: Cannot commit a batch multiple times.') : void 0;
if (!this._hasChildren) {
// This batch is empty. Return.
this._next = null;
this._defer = false;
share/assets/dash_renderer/react-dom@16.8.6.js view on Meta::CPAN
// Append the next earliest batch's children to the update queue.
if (firstBatch !== null && firstBatch._hasChildren) {
firstBatch.render(firstBatch._children);
}
};
ReactBatch.prototype._onComplete = function () {
if (this._didComplete) {
return;
}
this._didComplete = true;
var callbacks = this._callbacks;
if (callbacks === null) {
return;
}
// TODO: Error handling.
for (var i = 0; i < callbacks.length; i++) {
var _callback = callbacks[i];
_callback();
}
};
function ReactWork() {
this._callbacks = null;
this._didCommit = false;
// TODO: Avoid need to bind by replacing callbacks in the update queue with
// list of Work objects.
this._onCommit = this._onCommit.bind(this);
}
ReactWork.prototype.then = function (onCommit) {
if (this._didCommit) {
onCommit();
return;
}
var callbacks = this._callbacks;
if (callbacks === null) {
callbacks = this._callbacks = [];
}
callbacks.push(onCommit);
};
ReactWork.prototype._onCommit = function () {
if (this._didCommit) {
return;
}
this._didCommit = true;
var callbacks = this._callbacks;
if (callbacks === null) {
return;
}
// TODO: Error handling.
for (var i = 0; i < callbacks.length; i++) {
var _callback2 = callbacks[i];
!(typeof _callback2 === 'function') ? invariant(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', _callback2) : void 0;
_callback2();
}
};
function ReactRoot(container, isConcurrent, hydrate) {
var root = createContainer(container, isConcurrent, hydrate);
this._internalRoot = root;
}
ReactRoot.prototype.render = function (children, callback) {
share/assets/dash_renderer/react-dom@16.8.6.min.js view on Meta::CPAN
1073741823;else if(Ca&&!Lc)d=H;else{switch(c){case se:d=1073741823;break;case te:d=1073741822-10*(((1073741822-a+15)/10|0)+1);break;case Lg:d=1073741822-25*(((1073741822-a+500)/25|0)+1);break;case Ai:case Bi:d=1;break;default:n("313")}null!==Y&&d===H...
b>c)a.latestPingedTime=c;xc(c,a);c=a.expirationTime;0!==c&&Kc(a,c)}}function li(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=ka();b=fb(b,a);a=Sg(a,b);null!==a&&(Bb(a,b),b=a.expirationTime,0!==b&&Kc(a,b))}function Sg(a,b){a.expirationTime<b&&(a.expi...
b&&(c.childExpirationTime=b);if(null===d.return&&3===d.tag){e=d.stateNode;break}d=d.return}return e}function ya(a,b){a=Sg(a,b);null!==a&&(!Ca&&0!==H&&b>H&&Jg(),Bb(a,b),Ca&&!Lc&&Y===a||Kc(a,a.expirationTime),Tb>Ci&&(Tb=0,n("185")))}function Tg(a,b,c,d...
0!==e||Nc()?0<e&&(a.timeoutHandle=Ei(Fi.bind(null,a,b,c),e)):(a.pendingCommitExpirationTime=c,a.finishedWork=b)}function Fi(a,b,c){a.pendingCommitExpirationTime=c;a.finishedWork=b;Ub();jb=aa;Xg(a,c)}function wi(a,b){a.expirationTime=b;a.finishedWork=...
b);w||(z?Rc&&(ca=a,C=1073741823,Sc(a,1073741823,!1)):1073741823===b?Z(1073741823,!1):Ug(a,b))}function Qc(){var a=0,b=null;if(null!==I)for(var c=I,d=ba;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===I?n("244"):void 0;if(d===d.nextSchedu...
null;d=c.nextScheduledRoot}else{e>a&&(a=e,b=d);if(d===I)break;if(1073741823===a)break;c=d;d=d.nextScheduledRoot}}ca=b;C=a}function Nc(){return Tc?!0:Gi()?Tc=!0:!1}function Di(){try{if(!Nc()&&null!==ba){Ub();var a=ba;do{var b=a.expirationTime;0!==b&&a...
Qc();b&&(Oc=0,Pc=null);0!==C&&Ug(ca,C);Tb=0;we=null;if(null!==kb)for(a=kb,kb=null,b=0;b<a.length;b++){var c=a[b];try{c._onComplete()}catch(d){lb||(lb=!0,Uc=d)}}if(lb)throw a=Uc,Uc=null,lb=!1,a;}function Xg(a,b){w?n("253"):void 0;ca=a;C=b;Sc(a,b,!1);Z...
a.finishedWork,null!==d?Vc(a,d,b):(a.finishedWork=null,d=a.timeoutHandle,-1!==d&&(a.timeoutHandle=-1,Yg(d)),Rg(a,c),d=a.finishedWork,null!==d&&Vc(a,d,b));w=!1}function Vc(a,b,c){var d=a.firstBatch;if(null!==d&&d._expirationTime>=c&&(null===kb?kb=[d]:...
c)||w||Z(1073741823,!1)}}function $g(a,b){if(z&&!Rc){Rc=!0;try{return a(b)}finally{Rc=!1}}return a(b)}function ah(a,b,c){z||w||0===oa||(Z(oa,!1),oa=0);var d=z;z=!0;try{return Mc(te,function(){return a(b,c)})}finally{(z=d)||w||Z(1073741823,!1)}}functi...
g.return}while(null!==g);n("171");g=void 0}if(1===c.tag){var h=c.type;if(E(h)){c=Rf(c,h,g);break a}}c=g}else c=va;null===b.context?b.context=c:b.pendingContext=c;b=e;e=Aa(d);e.payload={element:a};b=void 0===b?null:b;null!==b&&(e.callback=b);eb();na(f...
3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Va,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}}function Vb(a){var b=1073741822-25*(((1073741822-ka()+500)/25|0)+1);b>=ze&&(b=ze-1);this._expirationTime...
b?3:0);a={current:b,containerInfo:a,pendingChildren:null,pingCache:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,didError:!1,pendingCommitExpirationTime:0,finishedWork:null,timeoutHand...
" react-mount-point-unstable "!==a.nodeValue))}function Ii(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new nb(a,!1,...
typeof e){var h=e;e=function(){var a=ye(f._internalRoot);h.call(a)}}$g(function(){null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)})}return ye(f._internalRoot)}function ch(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments...
!0;$b=a}},bc=null,Na={},cc=[],Zc={},Oa={},$c={},bd=null,Ue=null,He=null,rb=null,vh=function(a){if(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))for(var d=0;d<b.length&&!a.isPropagationStopped();d++)Ge(a,b[d],c[d]);else b&&G...
for(c in a)if(a.hasOwnProperty(c)){var d=a[c];Na.hasOwnProperty(c)&&Na[c]===d||(Na[c]?n("102",c):void 0,Na[c]=d,b=!0)}b&&Ee()}},dh=Math.random().toString(36).slice(2),ea="__reactInternalInstance$"+dh,ec="__reactEventHandlers$"+dh,ra=!("undefined"===t...
fd={},Le={};ra&&(Le=document.createElement("div").style,"AnimationEvent"in window||(delete Ra.animationend.animation,delete Ra.animationiteration.animation,delete Ra.animationstart.animation),"TransitionEvent"in window||delete Ra.transitionend.transi...
qa=null,gd=null,hc=null,B=da.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign;B(J.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&...
ic},isPersistent:jc,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=jc;this._dispatchInstances=this._dispatc...
arguments)}var c=this,d=function(){};d.prototype=c.prototype;d=new d;B(d,b.prototype);b.prototype=d;b.prototype.constructor=b;b.Interface=B({},c.Interface,a);b.extend=c.extend;Ne(b);return b};Ne(J);var Ji=J.extend({data:null}),Ki=J.extend({data:null}...
captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypres...
share/assets/dash_renderer/react-dom@16.8.6.min.js view on Meta::CPAN
Aa(d);e.tag=yg;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);eb();na(a,e);ya(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=ka();c=fb(c,a);var d=Aa(c);d.tag=Ec;void 0!==b&&null!==b&&(d.callback=b);eb();na(a,d);ya(a,c)}},Cc=Ar...
useCallback:V,useContext:V,useEffect:V,useImperativeHandle:V,useLayoutEffect:V,useMemo:V,useReducer:V,useRef:V,useState:V,useDebugValue:V},fi={readContext:T,useCallback:function(a,b){cb().memoizedState=[a,void 0===b?null:b];return a},useContext:T,use...
b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=cb();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=hg.bind(null,...
lastRenderedState:a};a=a.dispatch=hg.bind(null,xa,a);return[b.memoizedState,a]},useDebugValue:gg},cg={readContext:T,useCallback:function(a,b){var c=Mb();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Sd(b,d[1]))return d[0];c.memoize...
a,b)},useMemo:function(a,b){var c=Mb();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Sd(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:eg,useRef:function(a){return Mb().memoizedState},useState:function(a){retu...
6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};pe=function(...
a=[];break;case "textarea":f=Cd(g,f);d=Cd(g,d);a=[];break;default:"function"!==typeof f.onClick&&"function"===typeof d.onClick&&(g.onclick=tc)}Ed(c,d);g=c=void 0;var h=null;for(c in f)if(!d.hasOwnProperty(c)&&f.hasOwnProperty(c)&&null!=f[c])if("style...
null));for(c in d){var k=d[c];l=null!=f?f[c]:void 0;if(d.hasOwnProperty(c)&&k!==l&&(null!=k||null!=l))if("style"===c)if(l){for(g in l)!l.hasOwnProperty(g)||k&&k.hasOwnProperty(g)||(h||(h={}),h[g]="");for(g in k)k.hasOwnProperty(g)&&l[g]!==k[g]&&(h||(...
k):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(Oa.hasOwnProperty(c)?(null!=k&&ha(e,c),a||l===k||(a=[])):(a=a||[]).push(c,k))}h&&(a=a||[]).push("style",h);e=a;(b.updateQueue=e)&&Pb(b)}};Pg=function(a,b,c,d){c!==d&&Pb(b)};var...
0,Pc=void 0,w=!1,ca=null,C=0,oa=0,lb=!1,Uc=null,z=!1,Rc=!1,kb=null,ve=ue(),aa=1073741822-(ve/10|0),jb=aa,Ci=50,Tb=0,we=null,Tc=!1;id=function(a,b,c){switch(b){case "input":td(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.paren...
b&&Xa(a,!!c.multiple,b,!1)}};Vb.prototype.render=function(a){this._defer?void 0:n("250");this._hasChildren=!0;this._children=a;var b=this._root._internalRoot,c=this._expirationTime,d=new mb;bh(a,b,null,c,d._onCommit);return d};Vb.prototype.then=funct...
if(b!==this){this._hasChildren&&(c=this._expirationTime=b._expirationTime,this.render(this._children));for(var d=null,e=b;e!==this;)d=e,e=e._next;null===d?n("251"):void 0;d._next=e._next;this._next=b;a.firstBatch=this}this._defer=!1;Xg(a,c);b=this._n...
mb.prototype.then=function(a){if(this._didCommit)a();else{var b=this._callbacks;null===b&&(b=this._callbacks=[]);b.push(a)}};mb.prototype._onCommit=function(){if(!this._didCommit){this._didCommit=!0;var a=this._callbacks;if(null!==a)for(var b=0;b<a.l...
this._internalRoot,c=new mb;a=void 0===a?null:a;null!==a&&c.then(a);xe(null,b,null,c._onCommit);return c};nb.prototype.legacy_renderSubtreeIntoContainer=function(a,b,c){var d=this._internalRoot,e=new mb;c=void 0===c?null:c;null!==c&&e.then(c);xe(b,d,...
c&&(c._next=a)}return a};(function(a,b,c){Ye=a;yf=b;Ze=c})(Zg,ah,function(){w||0===oa||(Z(oa,!1),oa=0)});var oh={createPortal:ch,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0===b&&("funct...
b,c,d){ob(c)?void 0:n("200");null==a||void 0===a._reactInternalFiber?n("38"):void 0;return Wc(a,b,c,!1,d)},unmountComponentAtNode:function(a){ob(a)?void 0:n("40");return a._reactRootContainer?($g(function(){Wc(null,null,a,!1,function(){a._reactRootCo...
unstable_createRoot:function(a,b){ob(a)?void 0:n("299","unstable_createRoot");return new nb(a,!0,null!=b&&!0===b.hydrate)},unstable_flushControlled:function(a){var b=z;z=!0;try{Tg(a)}finally{(z=b)||w||Z(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_...
tf(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:dc,bundleType:0,version:"16.8.6",rendererPackageName:"react-dom"});var ph={default:oh},qh=ph&&oh||ph;return qh.default||qh})...
share/assets/dash_renderer/react@16.8.6.js view on Meta::CPAN
var continuationNode = {
callback: continuationCallback,
priorityLevel: priorityLevel,
expirationTime: expirationTime,
next: null,
previous: null
};
// Insert the new callback into the list, sorted by its expiration. This is
// almost the same as the code in `scheduleCallback`, except the callback
// is inserted into the list *before* callbacks of equal expiration instead
// of after.
if (firstCallbackNode === null) {
// This is the first callback in the list.
firstCallbackNode = continuationNode.next = continuationNode.previous = continuationNode;
} else {
var nextAfterContinuation = null;
var node = firstCallbackNode;
do {
if (node.expirationTime >= expirationTime) {
// This callback expires at or after the continuation. We will insert
share/assets/dash_renderer/react@16.8.6.js view on Meta::CPAN
function flushImmediateWork() {
if (
// Confirm we've exited the outer most event handler
currentEventStartTime === -1 && firstCallbackNode !== null && firstCallbackNode.priorityLevel === ImmediatePriority) {
isExecutingCallback = true;
try {
do {
flushFirstCallback();
} while (
// Keep flushing until there are no more immediate callbacks
firstCallbackNode !== null && firstCallbackNode.priorityLevel === ImmediatePriority);
} finally {
isExecutingCallback = false;
if (firstCallbackNode !== null) {
// There's still work remaining. Request another callback.
ensureHostCallbackIsScheduled();
} else {
isHostCallbackScheduled = false;
}
}
share/assets/dash_renderer/react@16.8.6.js view on Meta::CPAN
if (enableSchedulerDebugging && isSchedulerPaused) {
return;
}
isExecutingCallback = true;
var previousDidTimeout = currentDidTimeout;
currentDidTimeout = didTimeout;
try {
if (didTimeout) {
// Flush all the expired callbacks without yielding.
while (firstCallbackNode !== null && !(enableSchedulerDebugging && isSchedulerPaused)) {
// TODO Wrap in feature flag
// Read the current time. Flush all the callbacks that expire at or
// earlier than that time. Then read the current time again and repeat.
// This optimizes for as few performance.now calls as possible.
var currentTime = getCurrentTime();
if (firstCallbackNode.expirationTime <= currentTime) {
do {
flushFirstCallback();
} while (firstCallbackNode !== null && firstCallbackNode.expirationTime <= currentTime && !(enableSchedulerDebugging && isSchedulerPaused));
continue;
}
break;
}
} else {
// Keep flushing callbacks until we run out of time in the frame.
if (firstCallbackNode !== null) {
do {
if (enableSchedulerDebugging && isSchedulerPaused) {
break;
}
flushFirstCallback();
} while (firstCallbackNode !== null && !shouldYieldToHost());
}
}
} finally {
share/assets/dash_table/async~table.js.map view on Meta::CPAN
{"version":3,"sources":["webpack://dash_table/./node_modules/ramda/es/internal/_includes.js","webpack://dash_table/./node_modules/ramda/es/internal/_checkForMethod.js","webpack://dash_table/./node_modules/ramda/es/internal/_arrayFromIterator.js","web...
share/assets/dash_table/bundle.js.map view on Meta::CPAN
{"version":3,"sources":["webpack://dash_table/webpack/bootstrap","webpack://dash_table/external \"PropTypes\"","webpack://dash_table/external \"React\"","webpack://dash_table/./node_modules/ramda/es/internal/_xany.js","webpack://dash_table/./node_mod...
share/assets/dash_table/demo.js.map view on Meta::CPAN
{"version":3,"sources":["webpack://dash_table/webpack/bootstrap","webpack://dash_table/external \"PropTypes\"","webpack://dash_table/./node_modules/@babel/polyfill/node_modules/core-js/modules/_export.js","webpack://dash_table/./node_modules/ramda/es...
t/05-update_component.t view on Meta::CPAN
sub IsStructureEqualJSON {
my ( $structure, $json_string, $test_name ) = @_;
my $json = JSON->new->convert_blessed(1);
is_deeply( $json->decode( $json->encode($structure) ), $json->decode($json_string), $test_name );
}
# Tests TODO:
# 4. Update component clientside function
# 5. Update component chained callbacks
{
my $test_app = Dash->new;
$test_app->layout(
html->Div(
children => [ dcc->Input( id => 'input-id', value => 'initial value', type => 'text' ),
html->Div( id => 'output-id' )
]
)
t/web-app/mojo/00-routes.t view on Meta::CPAN
my $t = Test::Mojo->new( $app->backend );
$t->get_ok('/')->status_is(200)->content_like(qr/Loading/);
$t->get_ok('/_dash-component-suites/dash_renderer/dash_renderer.min.js')->status_is(200);
$t->get_ok('/_dash-layout')->status_is(200)->json_is( {} );
$t->get_ok('/_dash-dependencies')->status_is(200)->json_is( [] );
$t->post_ok('/_dash-update-component')->status_is(200)->json_is( { response => "There is no registered callbacks" } );
$t->get_ok('/_favicon.ico')->status_is(200)->content_type_is('image/x-icon');