├── src ├── init.client.js ├── addons │ ├── tardis │ │ ├── bundles │ │ │ └── .gitignore │ │ ├── routes.jsx │ │ ├── components │ │ │ ├── Tardis.jsx │ │ │ └── TardisGallery.jsx │ │ ├── settings.default.js │ │ ├── styles.css │ │ └── TardisGallery.server.js │ └── utilities.js ├── nuclearDefinitions │ ├── stores │ │ ├── index.js │ │ ├── settings.js │ │ └── routerState.js │ ├── getters.js │ ├── actions.js │ └── index.js ├── babelBlacklist.js ├── defaults │ ├── styles │ │ ├── fonts.css │ │ ├── init.css │ │ └── react-native.css │ └── Scaffold.jsx ├── init.common.js ├── mixins │ ├── Settings.jsx │ ├── NuclearContext.jsx │ ├── SettingsContext.jsx │ ├── Title.jsx │ ├── Nuclear.jsx │ └── TitleContext.jsx ├── init.server.js ├── createHandlerWithAmbidexContext.jsx ├── render.client.js ├── createWebpackSettings.js └── Ambidex.server.js ├── .gitignore ├── .editorconfig ├── LICENSE.md ├── package.json ├── CHANGELOG.md ├── README.md └── STYLE_GUIDE.md /src/init.client.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./init.common.js"); 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | cache/ 3 | .sass-cache/ 4 | *.sublime-* 5 | npm-debug.log 6 | -------------------------------------------------------------------------------- /src/addons/tardis/bundles/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /src/nuclearDefinitions/stores/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "routerState": require("./routerState"), 3 | "settings": require("./settings"), 4 | }; 5 | -------------------------------------------------------------------------------- /src/nuclearDefinitions/getters.js: -------------------------------------------------------------------------------- 1 | var routerState = ["routerState"]; 2 | var settings = ["settings"]; 3 | 4 | module.exports = { 5 | routerState, 6 | settings 7 | }; 8 | -------------------------------------------------------------------------------- /src/nuclearDefinitions/actions.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "simple": [ 3 | "loadSettings", 4 | "routerStateChanged", 5 | ] 6 | }; 7 | -------------------------------------------------------------------------------- /src/nuclearDefinitions/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "simpleActions": require("./actions").simple, 3 | "stores": require("./stores"), 4 | "getters": require("./getters"), 5 | }; 6 | -------------------------------------------------------------------------------- /src/addons/tardis/routes.jsx: -------------------------------------------------------------------------------- 1 | var React = require("react/addons"); 2 | var ReactRouter = require("react-router"); 3 | 4 | var Route = ReactRouter.Route; 5 | 6 | module.exports = ; 10 | -------------------------------------------------------------------------------- /src/babelBlacklist.js: -------------------------------------------------------------------------------- 1 | // Don't transpile the dependencies we know work with ES5. Manually 2 | // blacklisting isn't super scalable, but it does allow developers to break 3 | // their codebases into modules easily without sweating JS versions. 4 | 5 | module.exports = /node_modules\/(mach|react|babel|immutable|lazy\.js|webpack|socket.io|[\w\-]+\-loader\/)/; 6 | -------------------------------------------------------------------------------- /src/defaults/styles/fonts.css: -------------------------------------------------------------------------------- 1 | /* Make Roboto (the font of Material Design and the Android UI) our default 2 | * font. */ 3 | 4 | @import url("https://fonts.googleapis.com/css?family=Roboto:500,500italic,400,400italic,300,300italic|Roboto+Condensed:400"); 5 | 6 | body { 7 | font-family: "Roboto", sans-serif; 8 | } 9 | -------------------------------------------------------------------------------- /src/nuclearDefinitions/stores/settings.js: -------------------------------------------------------------------------------- 1 | var Immutable = require("immutable"); 2 | 3 | var settings = { 4 | "initialize": function () { 5 | this.on( 6 | this.actions.loadSettings, 7 | 8 | (lastValue, { settings }) => settings 9 | ); 10 | } 11 | }; 12 | 13 | module.exports = settings; 14 | -------------------------------------------------------------------------------- /src/init.common.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "addons": { 3 | "utilities": require("./addons/utilities.js"), 4 | }, 5 | 6 | "mixins": { 7 | "Nuclear": require("./mixins/Nuclear.jsx"), 8 | "Settings": require("./mixins/Settings.jsx"), 9 | "Title": require("./mixins/Title.jsx"), 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /src/nuclearDefinitions/stores/routerState.js: -------------------------------------------------------------------------------- 1 | var Immutable = require("immutable"); 2 | 3 | var routerState = { 4 | "initialize": function () { 5 | this.on( 6 | this.actions.routerStateChanged, 7 | 8 | (lastValue, { routerState }) => Immutable.fromJS(routerState) 9 | ); 10 | } 11 | }; 12 | 13 | module.exports = routerState; 14 | -------------------------------------------------------------------------------- /src/defaults/styles/init.css: -------------------------------------------------------------------------------- 1 | /* React Native utilizes inline styles with flexbox for layout. In the 2 | * spirit of "Learn Once, Write Everywhere", Ambidex sets the same 3 | * defaults as React Native for authors who use inline styles. 4 | * 5 | * If you'd like to opt-out, just set settings.FILESYSTEM_PATHS["STYLES"] 6 | * to a file you control. */ 7 | 8 | @import url("./fonts.css"); 9 | @import url("./react-native.css"); 10 | -------------------------------------------------------------------------------- /src/mixins/Settings.jsx: -------------------------------------------------------------------------------- 1 | var React = require("react/addons"); 2 | 3 | var SettingsMixin = { 4 | "contextTypes": { 5 | "ambidexSettings": React.PropTypes.object.isRequired, 6 | }, 7 | 8 | "getAmbidexSettings": function () { 9 | return this.context.ambidexSettings; 10 | } 11 | }; 12 | 13 | module.exports = SettingsMixin; 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | 10 | # Change these settings to your own preference 11 | indent_style = space 12 | indent_size = 2 13 | 14 | # We recommend you to keep these unchanged 15 | end_of_line = lf 16 | charset = utf-8 17 | trim_trailing_whitespace = true 18 | insert_final_newline = true 19 | 20 | [*.md] 21 | trim_trailing_whitespace = false 22 | 23 | [*.jsx] 24 | trim_trailing_whitespace = false 25 | -------------------------------------------------------------------------------- /src/addons/tardis/components/Tardis.jsx: -------------------------------------------------------------------------------- 1 | var React = require("react/addons"); 2 | 3 | var Tardis = React.createClass( 4 | { 5 | "render": function () { 6 | // iOS will ignore the width/height of an iframe, 7 | // but we can wrap it in an explicitly-sized div 8 | return
9 |