├── .babelrc
├── .editorconfig
├── .gitignore
├── LICENSE
├── Makefile
├── README.md
├── build-runtime.json
├── docs
├── decorators
│ ├── action.md
│ ├── component.md
│ ├── model.md
│ ├── on.md
│ ├── pubsub.md
│ ├── style.md
│ └── view.md
└── libs
│ ├── customelement.md
│ ├── eventhandler.md
│ ├── pubsub.md
│ ├── router.md
│ ├── stylesheet.md
│ └── view.md
├── gulpfile.js
├── jspm.browser.js
├── jspm.config.js
├── karma.conf.js
├── lerna.json
├── mocha.opts
├── package.json
├── packages
├── app-decorators-cli-deps
│ ├── appdec.json
│ └── package.json
├── app-decorators-element-to-function
│ ├── README.md
│ ├── index.js
│ └── package.json
├── app-decorators-simple-it
│ ├── .babelrc
│ ├── package.json
│ └── src
│ │ └── index.js
├── app-decorators-todomvc
│ ├── .babelrc
│ ├── LICENSE
│ ├── Makefile
│ ├── README.md
│ ├── assets
│ │ └── todomvc-app-decorators.png
│ ├── gulpfile.js
│ ├── index.html
│ ├── index.js
│ ├── jspm.config.js
│ ├── package.json
│ └── src
│ │ ├── app.js
│ │ ├── dom.js
│ │ ├── todo-item.js
│ │ ├── todo-list.js
│ │ ├── todo-new.js
│ │ └── utils.js
├── app-decorators
│ ├── .babelrc
│ ├── bootstrap.js
│ ├── component.tpl
│ ├── html.tpl
│ ├── jspm.config.js
│ ├── jspm.config.json
│ ├── package.json
│ └── server.js
├── babel-plugin-app-decorators-action-bundle
│ └── README.md
├── babel-plugin-app-decorators-component-register
│ ├── .babelrc
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── Makefile
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.js
│ └── test
│ │ └── index.js
├── babel-plugin-app-decorators-component
│ ├── .babelrc
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── Makefile
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── elements.js
│ │ └── index.js
│ └── test
│ │ └── index.js
├── babel-plugin-app-decorators-element-to-function
│ ├── .babelrc
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── elements.js
│ │ └── index.js
│ └── test
│ │ └── index.js
├── babel-plugin-app-decorators-style-precompile
│ ├── .babelrc
│ ├── README.md
│ ├── package.json
│ └── src
│ │ ├── index.js
│ │ └── index.test.js
├── babel-plugin-app-decorators-view-precompile
│ ├── .babelrc
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── Makefile
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.js
│ └── test
│ │ └── index.js
├── babel-preset-app-decorators
│ ├── .babelrc
│ ├── .editorconfig
│ ├── Makefile
│ ├── README.md
│ ├── package.json
│ └── src
│ │ └── index.js
└── postcss-parse-atrule-events
│ ├── .babelrc
│ ├── README.md
│ ├── package.json
│ └── src
│ ├── index.js
│ └── index.test.js
├── src
├── apps
│ ├── pubsub.js
│ └── router.js
├── bootstrap.js
├── configs
│ ├── elements.js
│ ├── route.config.client.js
│ └── window-events.js
├── datas
│ ├── init-maps.js
│ └── polyfills.js
├── decorators
│ ├── action.js
│ ├── component.js
│ ├── model.js
│ ├── modelpool.js
│ ├── on.js
│ ├── pubsub.js
│ ├── style.js
│ └── view.js
├── helpers
│ ├── browser-detect.js
│ ├── delay.js
│ ├── extract-dom-properties.js
│ ├── guid.js
│ ├── history.back-forward-and-wait.js
│ ├── jquery.click-and-wait.js
│ ├── lazyPolyfillLoader.js
│ ├── namespace.js
│ ├── queryString.js
│ ├── string.js
│ └── trigger.js
├── index.js
└── libs
│ ├── customelement.js
│ ├── dependencies.js
│ ├── element-to-function.js
│ ├── eventhandler.js
│ ├── pubsub.js
│ ├── random-storage.js
│ ├── router.js
│ ├── router.runtime.js
│ ├── stylesheet.js
│ └── view.js
└── test
├── .babelrc
├── decorators
├── action.spec.js
├── component.spec.js
├── on.spec.js
├── pipe.spec.js
├── style.spec.js
└── view.spec.js
├── fixture
├── server-styles-4000.js
└── styles
│ ├── test-1.css
│ ├── test-2.css
│ └── test-3.css
├── helpers
├── extract-dom-properties.spec.js
├── guid.spec.js
├── namespace.spec.js
├── querString.spec.js
└── remove-gutter.js
├── imports
├── app.spec.js
└── testcomponent.js
├── libs
├── customelement.spec.js
├── element-to-function.spec.js
├── eventhandler.spec.js
├── router.spec.js
├── stylesheet.spec.js
└── view.spec.js
└── mocks
├── event.js
└── location.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["es2015", {
4 | "modules" : "systemjs"
5 | }],
6 | "app-decorators"
7 | ]
8 | }
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*]
2 | indent_style = tab
3 | indent_size = 4
4 | end_of_line = lf
5 | charset = utf-8
6 | trim_trailing_whitespace = true
7 | insert_final_newline = true
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | ideas
3 | .DS_Store
4 | docs/.DS_Store
5 | node_modules
6 | jspm_packages
7 | packages/app-decorators/src
8 | packages/app-decorators/test
9 | packages/app-decorators/runtime.js
10 | packages/app-decorators-todomvc/dist/
11 | packages/**/lib/
12 | packages/**/tmp/
13 | packages/**/node_modules
14 | packages/**/jspm_packages
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Serkan Sipahi
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | default:
2 | @echo ""
3 | @echo "Available Targets:"
4 | @echo ""
5 | @echo " make install"
6 | @echo " make compile"
7 | @echo " make test"
8 | @echo " make clean"
9 | @echo " make publish (npm)"
10 | @echo ""
11 | @echo " lerna-test"
12 | @echo " lerna-clean"
13 | @echo " lerna-publish"
14 | @echo " lerna-publish-version version=1.0.0"
15 | @echo " lerna-updated"
16 | @echo " lerna-ncu"
17 | @echo " lerna-ncu-update"
18 | @echo " lerna-npm-install-save module=underscore"
19 | @echo " lerna-npm-install-save-dev module=app-decorators"
20 | @echo ""
21 |
22 | install: jspm-install-packages prepare-compile gulp-compile
23 |
24 | compile: prepare-compile gulp-compile-watch
25 |
26 | publish: lerna-publish
27 |
28 | node_modules:
29 | npm install --no-package-lock
30 |
31 | jspm-install-packages:
32 | $(jspm) install
33 |
34 | gulp-compile:
35 | $(gulp) compile;
36 |
37 | gulp-compile-watch:
38 | $(gulp) compile-watch;
39 |
40 | lerna-init:
41 | lerna init $(set);
42 |
43 | lerna-publish-version:
44 | lerna publish --repo-version $(version) --exact --force-publish=* $(set);
45 |
46 | lerna-publish:
47 | make bundle-runtime && lerna publish --exact --force-publish=* $(set);
48 |
49 | lerna-updated:
50 | lerna updated $(set);
51 |
52 | lerna-ncu:
53 | lerna exec -- ncu;
54 |
55 | lerna-ncu-update:
56 | lerna exec -- ncu -u;
57 |
58 | lerna-npm-install-save:
59 | lerna exec -- npm install $(module) --save;
60 |
61 | lerna-npm-install-save-dev:
62 | lerna exec -- npm install $(module) --save-dev;
63 |
64 | lerna-clean:
65 | command -v lerna >/dev/null && lerna clean --yes;
66 |
67 | lerna-test:
68 | lerna run test
69 |
70 | lerna-bootstrap:
71 | lerna bootstrap -- --no-package-lock;
72 |
73 | bundle-runtime:
74 | $(jspm) bundle app-decorators packages/app-decorators/runtime.js \
75 | --config build-runtime.json \
76 | --minify \
77 | --skip-source-maps;
78 |
79 | test:
80 | $(karma) start
81 |
82 | clean:
83 | rm -rf node_modules jspm_packages; \
84 | make clean-package-compiled;
85 |
86 | clean-package-compiled:
87 | rm -rf packages/*/{lib,dist}; \
88 | rm -rf packages/app-decorators/{build,dist,tmp,src,test,node_modules,jspm_packages};
89 |
90 | start-asset-css-server:
91 | node test/fixture/server-styles-4000.js
92 |
93 | prepare-compile:
94 | rm -rf packages/app-decorators/{lib,src,test,tmp}; \
95 | mkdir -p packages/app-decorators/tmp; \
96 | cp jspm.browser.js jspm.config.js packages/app-decorators/tmp; \
97 | make start-asset-css-server;
98 |
99 | fix-nested-node_modules:
100 | rm -rf packages/app-decorators/node_modules/node_modules;
101 |
102 | jspm = ./node_modules/.bin/jspm
103 | karma = ./node_modules/.bin/karma
104 | gulp = ./node_modules/.bin/gulp
105 |
106 | .PHONY: install test clean node_modules jspm-install-packages compile test lerna-init lerna-publish;
107 | MAKEFLAGS = -s
108 |
--------------------------------------------------------------------------------
/build-runtime.json:
--------------------------------------------------------------------------------
1 | {
2 | "transpiler": false,
3 | "packageConfigPaths": [
4 | "npm:@*/*.json",
5 | "npm:*.json",
6 | "github:*/*.json"
7 | ],
8 | "paths": {
9 | "github": "jspm_packages/github/",
10 | "npm:": "jspm_packages/npm/",
11 | "src/": "lib/",
12 | "test/": "test/",
13 | "app-decorators/": "packages/app-decorators/"
14 | },
15 | "map": {
16 | "app-decorators": "app-decorators/src/index",
17 | "app-decorators/src/bootstrap": "app-decorators/src/bootstrap",
18 | "app-decorators/src/libs/customelement": "app-decorators/src/libs/customelement",
19 | "app-decorators/src/libs/random-storage": "app-decorators/src/libs/random-storage",
20 | "app-decorators/src/libs/element-to-function": "app-decorators/src/libs/element-to-function"
21 | },
22 | "packages": {
23 | "packages": {
24 | "defaultExtension": "js"
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/docs/decorators/action.md:
--------------------------------------------------------------------------------
1 | ### @action
2 |
3 | ```js
4 | import { component, action, view } from 'app-decorators';
5 |
6 |
7 | @view(`
8 | |||
9 | `)
10 |
11 | @component()
12 | class Sidebar {
13 |
14 | /**
15 | * Sidebar
16 | * @param {Event} event
17 | * @param {object} params
18 | */
19 | @action('?sidebar={{state}}') sidebar({ event, params, search, hash }){
20 |
21 | console.log(
22 | event, // Event
23 | event.target, //
61 |
62 |
63 |
64 | @component
65 |
66 |
67 |
68 |
69 | Hello World
70 |
71 |
72 |