{page.title || \'Not found\'}
{page.body || \'Specified id is not found.\'}
├── .editorconfig
├── .eslintignore
├── .eslintrc
├── .gitignore
├── .travis.yml
├── LICENSE
├── Makefile
├── README.md
├── example
├── css
│ └── styles.css
├── dist
│ ├── alltags.js
│ └── app.built.js
├── index.html
├── js
│ ├── app.js
│ └── app.precompiled.js
├── requirejs.build.js
├── requirejs.config.js
├── requirejs_bundled.html
├── requirejs_example.html
├── systemjs_example.html
├── systemjs_precompiled.html
└── tags
│ ├── panels.tag
│ ├── timer.tag
│ └── todo.tag
├── jspm.config.js
├── package-lock.json
├── package.json
├── requirejs-riot.js
├── systemjs-riot.js
└── test
└── test.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # http://editorconfig.org
4 |
5 | root = true
6 |
7 | [*]
8 | indent_style = space
9 | indent_size = 2
10 | end_of_line = lf
11 | charset = utf-8
12 | trim_trailing_whitespace = true
13 | insert_final_newline = true
14 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | example/*.html
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": "eslint:recommended",
4 | "env":
5 | {
6 | "browser": true,
7 | "node": true,
8 | "es6": true,
9 | "amd": true
10 | },
11 | globals:
12 | {
13 | "require": false,
14 | "requirejs": false,
15 | "define": false,
16 | "describe": false,
17 | "it": false,
18 | "System":false,
19 | "SystemJS":false
20 |
21 | },
22 |
23 | "ecmaFeatures":
24 | {
25 | "arrowFunctions": true,
26 | "binaryLiterals": true,
27 | "blockBindings": true,
28 | "classes": true,
29 | "defaultParams": true,
30 | "destructuring": true,
31 | "forOf": true,
32 | "generators": true,
33 | "modules": true,
34 | "objectLiteralComputedProperties": true,
35 | "objectLiteralDuplicateProperties": true,
36 | "objectLiteralShorthandMethods": true,
37 | "objectLiteralShorthandProperties": true,
38 | "octalLiterals": true,
39 | "regexUFlag": true,
40 | "regexYFlag": true,
41 | "spread": true,
42 | "superInFunctions": true,
43 | "templateStrings": true,
44 | "unicodeCodePointEscapes": true,
45 | "globalReturn": true,
46 | "jsx": true
47 | },
48 |
49 | "rules":
50 | {
51 |
52 | //
53 | //Possible Errors
54 | //
55 | // The following rules point out areas where you might have made mistakes.
56 | //
57 | "comma-dangle": 2, // disallow or enforce trailing commas
58 | "no-cond-assign": 2, // disallow assignment in conditional expressions
59 | "no-console": 0, // disallow use of console (off by default in the node environment)
60 | "no-constant-condition": 2, // disallow use of constant expressions in conditions
61 | "no-control-regex": 2, // disallow control characters in regular expressions
62 | "no-debugger": 2, // disallow use of debugger
63 | "no-dupe-args": 2, // disallow duplicate arguments in functions
64 | "no-dupe-keys": 2, // disallow duplicate keys when creating object literals
65 | "no-duplicate-case": 2, // disallow a duplicate case label.
66 | "no-empty": 2, // disallow empty statements
67 |
68 | "no-ex-assign": 2, // disallow assigning to the exception in a catch block
69 | "no-extra-boolean-cast": 2, // disallow double-negation boolean casts in a boolean context
70 | "no-extra-parens": 0, // disallow unnecessary parentheses (off by default)
71 | "no-extra-semi": 2, // disallow unnecessary semicolons
72 | "no-func-assign": 2, // disallow overwriting functions written as function declarations
73 | "no-inner-declarations": 2, // disallow function or variable declarations in nested blocks
74 | "no-invalid-regexp": 2, // disallow invalid regular expression strings in the RegExp constructor
75 | "no-irregular-whitespace": 2, // disallow irregular whitespace outside of strings and comments
76 | "no-negated-in-lhs": 2, // disallow negation of the left operand of an in expression
77 | "no-obj-calls": 2, // disallow the use of object properties of the global object (Math and JSON) as functions
78 | "no-regex-spaces": 2, // disallow multiple spaces in a regular expression literal
79 | "no-sparse-arrays": 2, // disallow sparse arrays
80 | "no-unreachable": 2, // disallow unreachable statements after a return, throw, continue, or break statement
81 | "use-isnan": 2, // disallow comparisons with the value NaN
82 | "valid-jsdoc": 2, // Ensure JSDoc comments are valid (off by default)
83 | "valid-typeof": 2, // Ensure that the results of typeof are compared against a valid string
84 |
85 | //
86 | // Best Practices
87 | //
88 | // These are rules designed to prevent you from making mistakes.
89 | // They either prescribe a better way of doing something or help you avoid footguns.
90 | //
91 | "block-scoped-var": 0, // treat var statements as if they were block scoped (off by default). 0: deep destructuring is not compatible https://github.com/eslint/eslint/issues/1863
92 | "complexity": 0, // specify the maximum cyclomatic complexity allowed in a program (off by default)
93 | "consistent-return": 2, // require return statements to either always or never specify values
94 | "curly": 2, // specify curly brace conventions for all control statements
95 | "default-case": 2, // require default case in switch statements (off by default)
96 | "dot-notation": 2, // encourages use of dot notation whenever possible
97 | "eqeqeq": 2, // require the use of === and !==
98 | "guard-for-in": 2, // make sure for-in loops have an if statement (off by default)
99 | "no-alert": 2, // disallow the use of alert, confirm, and prompt
100 | "no-caller": 2, // disallow use of arguments.caller or arguments.callee
101 | "no-div-regex": 2, // disallow division operators explicitly at beginning of regular expression (off by default)
102 | "no-else-return": 2, // disallow else after a return in an if (off by default)
103 |
104 | "no-eq-null": 2, // disallow comparisons to null without a type-checking operator (off by default)
105 | "no-eval": 2, // disallow use of eval()
106 | "no-extend-native": 2, // disallow adding to native types
107 | "no-extra-bind": 2, // disallow unnecessary function binding
108 | "no-fallthrough": 2, // disallow fallthrough of case statements
109 | "no-floating-decimal": 2, // disallow the use of leading or trailing decimal points in numeric literals (off by default)
110 | "no-implied-eval": 2, // disallow use of eval()-like methods
111 | "no-iterator": 2, // disallow usage of __iterator__ property
112 | "no-labels": 2, // disallow use of labeled statements
113 | "no-lone-blocks": 2, // disallow unnecessary nested blocks
114 | "no-loop-func": 2, // disallow creation of functions within loops
115 | "no-multi-spaces": 2, // disallow use of multiple spaces
116 | "no-multi-str": 2, // disallow use of multiline strings
117 | "no-native-reassign": 2, // disallow reassignments of native objects
118 | "no-new": 2, // disallow use of new operator when not part of the assignment or comparison
119 | "no-new-func": 2, // disallow use of new operator for Function object
120 | "no-new-wrappers": 2, // disallows creating new instances of String,Number, and Boolean
121 | "no-octal": 2, // disallow use of octal literals
122 | "no-octal-escape": 2, // disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251";
123 | "no-param-reassign": 2, // disallow reassignment of function parameters (off by default)
124 | "no-process-env": 2, // disallow use of process.env (off by default)
125 | "no-proto": 2, // disallow usage of __proto__ property
126 | "no-redeclare": 2, // disallow declaring the same variable more then once
127 | "no-return-assign": 2, // disallow use of assignment in return statement
128 | "no-script-url": 2, // disallow use of javascript: urls.
129 | "no-self-compare": 2, // disallow comparisons where both sides are exactly the same (off by default)
130 | "no-sequences": 2, // disallow use of comma operator
131 | "no-throw-literal": 2, // restrict what can be thrown as an exception (off by default)
132 | "no-unused-expressions": 2, // disallow usage of expressions in statement position
133 | "no-void": 2, // disallow use of void operator (off by default)
134 | "no-warning-comments": [0,
135 | {
136 | "terms": ["todo", "fixme"],
137 | "location": "start"
138 | }], // disallow usage of configurable warning terms in comments": 2, // e.g. TODO or FIXME (off by default)
139 | "no-with": 2, // disallow use of the with statement
140 | "radix": 2, // require use of the second argument for parseInt() (off by default)
141 | "vars-on-top": 0, // requires to declare all vars on top of their containing scope (off by default)
142 | "wrap-iife": 2, // require immediate function invocation to be wrapped in parentheses (off by default)
143 | "yoda": 2, // require or disallow Yoda conditions
144 |
145 | //
146 | // Strict Mode
147 | //
148 | // These rules relate to using strict mode.
149 | //
150 | "strict": 0, // controls location of Use Strict Directives. 0: required by `babel-eslint`
151 |
152 | //
153 | // Variables
154 | //
155 | // These rules have to do with variable declarations.
156 | //
157 | "no-catch-shadow": 2, // disallow the catch clause parameter name being the same as a variable in the outer scope (off by default in the node environment)
158 | "no-delete-var": 2, // disallow deletion of variables
159 | "no-label-var": 2, // disallow labels that share a name with a variable
160 | "no-shadow": 2, // disallow declaration of variables already declared in the outer scope
161 | "no-shadow-restricted-names": 2, // disallow shadowing of names such as arguments
162 | "no-undef": 2, // disallow use of undeclared variables unless mentioned in a /*global */ block
163 | "no-undef-init": 2, // disallow use of undefined when initializing variables
164 | "no-undefined": 2, // disallow use of undefined variable (off by default)
165 | "no-unused-vars": 0, // disallow declaration of variables that are not used in the code
166 | "no-use-before-define": 2, // disallow use of variables before they are defined
167 |
168 | //
169 | //Stylistic Issues
170 | //
171 | // These rules are purely matters of style and are quite subjective.
172 | //
173 | "indent": [0, "tab"], // this option sets a specific tab width for your code (off by default)
174 | "brace-style": 1, // enforce one true brace style (off by default)
175 | "camelcase": 0, // require camel case names
176 | "comma-spacing": [1,
177 | {
178 | "before": false,
179 | "after": true
180 | }], // enforce spacing before and after comma
181 | "comma-style": [1, "last"], // enforce one true comma style (off by default)
182 | "consistent-this": [1, "_this"], // enforces consistent naming when capturing the current execution context (off by default)
183 | "eol-last": 1, // enforce newline at the end of file, with no multiple empty lines
184 | "func-names": 0, // require function expressions to have a name (off by default)
185 | "func-style": 0, // enforces use of function declarations or expressions (off by default)
186 | "key-spacing": [1,
187 | {
188 | "beforeColon": false,
189 | "afterColon": true
190 | }], // enforces spacing between keys and values in object literal properties
191 | "max-nested-callbacks": [1, 4], // specify the maximum depth callbacks can be nested (off by default)
192 | "new-cap": [1,
193 | {
194 | newIsCap: true,
195 | capIsNew: false
196 | }], // require a capital letter for constructors
197 | "new-parens": 1, // disallow the omission of parentheses when invoking a constructor with no arguments
198 | "newline-after-var": 0, // allow/disallow an empty newline after var statement (off by default)
199 | "no-array-constructor": 1, // disallow use of the Array constructor
200 | "no-inline-comments": 0, // disallow comments inline after code (off by default)
201 | "no-lonely-if": 1, // disallow if as the only statement in an else block (off by default)
202 | "no-mixed-spaces-and-tabs": 1, // disallow mixed spaces and tabs for indentation
203 | "no-multiple-empty-lines": [1,
204 | {
205 | "max": 2
206 | }], // disallow multiple empty lines (off by default)
207 | "no-nested-ternary": 1, // disallow nested ternary expressions (off by default)
208 | "no-new-object": 1, // disallow use of the Object constructor
209 | "no-spaced-func": 1, // disallow space between function identifier and application
210 | "no-ternary": 0, // disallow the use of ternary operators (off by default)
211 | "no-trailing-spaces": 1, // disallow trailing whitespace at the end of lines
212 | "no-underscore-dangle": 0, // disallow dangling underscores in identifiers
213 | //"one-var": [1, "never"], // allow just one var statement per function (off by default)
214 | "operator-assignment": [1, "never"], // require assignment operator shorthand where possible or prohibit it entirely (off by default)
215 | "padded-blocks": [0, "always"], // enforce padding within blocks (off by default)
216 | "quote-props": [0, "as-needed"], // require quotes around object literal property names (off by default)
217 | "quotes": [0, "single"], // specify whether double or single quotes should be used
218 | "semi": [1, "always"], // require or disallow use of semicolons instead of ASI
219 | "semi-spacing": [1,
220 | {
221 | "before": false,
222 | "after": true
223 | }], // enforce spacing before and after semicolons
224 | "sort-vars": 0, // sort variables within the same declaration block (off by default)
225 | "keyword-spacing": [2,
226 | {
227 | "before": true,
228 | "after": true
229 | }], // require a space after certain keywords (off by default)
230 | "space-before-blocks": [1, "always"], // require or disallow space before blocks (off by default)
231 |
232 |
233 | //"space-infix-ops": [1], // require spaces around operators
234 | //"space-return-throw-case": [1, "always"], // require a space after return, throw, and case
235 | "space-unary-ops": [1,
236 | {
237 | "words": true,
238 | "nonwords": false
239 | }], // Require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
240 | "wrap-regex": 0, // require regex literals to be wrapped in parentheses (off by default)
241 |
242 | //
243 | // ECMAScript 6
244 | //
245 | // These rules are only relevant to ES6 environments and are off by default.
246 | //
247 | "no-var": 0, // require let or const instead of var (off by default)
248 | "generator-star-spacing": [2, "before"], // enforce the spacing around the * in generator functions (off by default)
249 |
250 | //
251 | // Legacy
252 | //
253 | // The following rules are included for compatibility with JSHint and JSLint.
254 | // While the names of the rules may not match up with the JSHint/JSLint counterpart,
255 | // the functionality is the same.
256 | //
257 | "max-depth": [2, 3], // specify the maximum depth that blocks can be nested (off by default)
258 | "max-len": [2, 150, 2], // specify the maximum length of a line in your program (off by default)
259 | "max-params": [1, 5], // limits the number of parameters that can be used in the function declaration. (off by default)
260 | "max-statements": 0, // specify the maximum number of statement allowed in a function (off by default)
261 | "no-bitwise": 1, // disallow use of bitwise operators (off by default)
262 | "no-plusplus": 0, // disallow use of unary operators, ++ and -- (off by default)
263 |
264 |
265 | }
266 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | jspm_packages
3 | fabfile*
4 | example/dist/*.tag.js
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "8.11"
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014-2015 Guy Bedford
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | 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, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 |
2 | VERSION = $(shell cat package.json | sed -n 's/.*"version": "\([^"]*\)",/\1/p')
3 |
4 | SHELL = /usr/bin/env bash
5 |
6 | default: install
7 | .PHONY: default test install tag
8 |
9 | version:
10 | @echo $(VERSION)
11 |
12 |
13 | install:
14 | npm install
15 |
16 |
17 | test:
18 | $$(npm bin)/jspm install --quick
19 | $$(npm bin)/mocha
20 |
21 | runexample: build serve
22 |
23 | serve:
24 | @echo "Point your browser to http://localhost:3000/example/ to check the examples"
25 | $$(npm bin)/serve .
26 |
27 | build:
28 | @echo "Generating a single bundle of all tags"
29 | $$(npm bin)/jspm build 'tags/todo.tag + tags/timer.tag + tags/panels.tag - riot' example/dist/alltags.js --format umd --skip-source-maps
30 | @echo "Generating a monolihyc build using r.js optimizer"
31 | $$(npm bin)/r.js -o example/requirejs.build.js
32 |
33 |
34 | update_version:
35 | @echo "Current version is " ${VERSION}
36 | @echo "Next version is " $(v)
37 | sed -i s/'"$(VERSION)"'/'"$(v)"'/ package.json
38 |
39 | tag_and_push:
40 | git add --all
41 | git commit -a -m "Tag v$(v) $(m)"
42 | git tag v$(v)
43 | git push
44 | git push --tags
45 | npm publish
46 |
47 | tag: update_version tag_and_push
48 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Riot Tag Plugin for SystemJS and RequireJS
2 |
3 | [](https://travis-ci.org/HuasoFoundries/systemjs-riot) [](https://codeclimate.com/github/HuasoFoundries/systemjs-riot)
4 | [](https://www.npmjs.com/package/systemjs-riot)
5 |
6 | This is a loader plugin that enables to dynamically compile [Riot](http://riotjs.com/) tags
7 | from [jspm](https://jspm.io)/[SystemJS](https://github.com/systemjs/systemjs) or [RequireJS](http://requirejs.org/)
8 | and statically inline them during your build task.
9 |
10 | Prior to version 1.2.0 the requirejs part of this loader was a separate project known as [requirejs-riot](https://www.npmjs.com/package/requirejs-riot),
11 | which is now deprecated in favor of this one.
12 |
13 |
14 | ### Usage with JSPM/SystemJS
15 |
16 | To use it you should install it with jspm:
17 |
18 |
19 | ```
20 | jspm install tag
21 | ```
22 |
23 |
24 | After that you can include Riot tags in your modules:
25 |
26 | ```js
27 | import riot from 'riot';
28 | import 'app.tag!';
29 |
30 | riot.mount('app');
31 |
32 | ```
33 |
34 | You can also use it when defining AMD style modules, and combine it with the `pluginFirst` option
35 | of your SystemJS project to use it like:
36 |
37 | ```js
38 | define(['riot','tag!todo.tag'], function(riot) {
39 | riot.mount('todo');
40 | riot.route.start(true);
41 | });
42 | ```
43 |
44 | ### Usage with RequireJS
45 |
46 |
47 | Install using npm like so:
48 |
49 | ```sh
50 | npm install systemjs-riot
51 | ```
52 |
53 | Add the proper config to your main requirejs.config. For example:
54 |
55 | ```js
56 | requirejs.config({
57 | paths: {
58 | "riot": "/node_modules/riot/riot+compiler.min",
59 | "tag": "../requirejs-riot",
60 | "tags": "./tags",
61 | "dist": "./dist"
62 | }
63 | });
64 | ```
65 |
66 | Then load your tags by prepending `tag!` to their path:
67 |
68 |
69 | ```js
70 | define(['riot','tag!timer.tag'], function(riot) {
71 | riot.mount('timer', {
72 | start: 0
73 | });
74 | riot.route.start(true);
75 | });
76 | ```
77 |
78 |
79 |
80 |
81 | ## Running examples
82 |
83 | Install [serve](https://www.npmjs.com/package/serve) or any other basic webserver
84 |
85 | ```sh
86 | make runexample
87 | ```
88 |
89 | Then point your browser to `http://localhost:3000/`
90 |
91 |
92 |
93 | ### Precompilation and Bundling
94 |
95 | When you bundle or build your project, the tags will be precompiled and inlined as part of the process.
96 |
97 | The `make runexamples` task does run `make build`, which uses both `jspm` and `r.js` to generate working
98 | bundles that you can inspect. The tasks run under the hood are:
99 |
100 | **for jspm**:
101 |
102 | ```sh
103 | jspm build 'tag!tags/todo.tag + tag!tags/timer.tag + tag!tags/app.tag - riot' example/dist/alltags.js --format umd
104 | ```
105 |
106 | **for the `r.js` optimizer**
107 |
108 | ```sh
109 | ./node_modules/.bin/r.js -o example/requirejs.build.js
110 | ```
111 |
112 |
113 |
114 | ## Tests
115 |
116 | ```bash
117 | npm install
118 | npm test
119 | ```
120 |
--------------------------------------------------------------------------------
/example/css/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: 'myriad pro', sans-serif;
3 | font-size: 20px;
4 | border: 0;
5 | }
6 |
7 | form input {
8 | font-size: 85%;
9 | padding: .4em;
10 | border: 1px solid #ccc;
11 | border-radius: 2px;
12 | }
13 |
14 | button {
15 | background-color: #1FADC5;
16 | border: 1px solid rgba(0, 0, 0, .2);
17 | font-size: 75%;
18 | color: #fff;
19 | padding: .4em 1.2em;
20 | border-radius: 2em;
21 | cursor: pointer;
22 | margin: 0 .23em;
23 | outline: none;
24 | }
25 |
26 | button[disabled] {
27 | background-color: #ddd;
28 | color: #aaa;
29 | }
30 |
31 | ul {
32 | padding: 0;
33 | }
34 |
35 | li {
36 | list-style-type: none;
37 | padding: .2em 0;
38 | }
39 |
40 | .completed {
41 | text-decoration: line-through;
42 | color: #ccc;
43 | }
44 |
45 | label {
46 | cursor: pointer;
47 | }
48 |
49 | timer {
50 | display: block;
51 | max-width: 300px;
52 | margin: 0 auto;
53 | border: 1px solid rgba(64, 139, 194, .5);
54 | border-radius: 6px;
55 | color: rgba(64, 139, 194, 1);
56 | height: 100px;
57 | line-height: 100px;
58 | text-align: center;
59 | background: white;
60 | }
61 |
62 | p {
63 | margin: 0;
64 | }
65 |
66 | .menu {
67 | width: 100%;
68 | text-align: center;
69 |
70 | margin: 0 auto;
71 | }
72 |
73 | .menu a {
74 | float: left;
75 | display: inline-block;
76 | width: 23%;
77 | border: 1px solid #CCC;
78 | padding: 5px 2px;
79 | text-decoration: none;
80 | font-size: 14px;
81 | }
82 |
83 | .menu a:hover {
84 | background-color: #EEE;
85 | }
86 |
87 | .tagcontainer {
88 | width: 100%;
89 | height: 100%;
90 | float: left;
91 | }
92 |
93 | .tagcontainer>div {
94 | float: left;
95 | }
96 |
97 | .tagcontainer .timercontainer {
98 | width: 20%;
99 | text-align: center;
100 | }
101 |
102 | .tagcontainer .appcontainer {
103 | width: 40%;
104 | margin: 0 5%;
105 | text-align: center;
106 | }
107 |
108 | .tagcontainer .todocontainer {
109 | width: 25%;
110 | }
111 |
--------------------------------------------------------------------------------
/example/dist/alltags.js:
--------------------------------------------------------------------------------
1 | (function (global, factory) {
2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('riot')) :
3 | typeof define === 'function' && define.amd ? define(['exports', 'riot'], factory) :
4 | (factory((global.tags = {}),null));
5 | }(this, (function (exports,riot) { 'use strict';
6 |
7 | riot = riot && riot.hasOwnProperty('default') ? riot['default'] : riot;
8 |
9 | riot.tag2('panels', ' {page.body || \'Specified id is not found.\'}{page.title || \'Not found\'}
Seconds Elapsed: {time}
', '', '', function (opts) { 23 | this.time = opts.start || 0; 24 | 25 | this.tick = function () { 26 | this.update({ time: ++this.time }); 27 | }.bind(this); 28 | 29 | var timer = setInterval(this.tick, 1000); 30 | 31 | this.on('unmount', function () { 32 | clearInterval(timer); 33 | }); 34 | }); 35 | 36 | riot.tag2('todo', ']/.test(e)&&(e=e.replace(A,function(e){return a.push(e),""})),e=e.trim().replace(/\s+/g," "),a.length&&(e=e.replace(/\u0002/g,function(){return a.shift()}))}return o.compact&&(e=e.replace(j,"><$1")),r(e,i).replace(k,"")}function i(t,n,r){return Array.isArray(n)?(r=n,n={}):(r||(r=[]),n||(n={})),r._bp=ge.array(n.brackets),o(e(t),n,r)}function a(e){var t,n,r,o,i=[],a=RegExp;for(~e.indexOf("/")&&(e=function(e,t,n){for(t.lastIndex=0;n=t.exec(e);)"/"!==n[0][0]||n[1]||n[2]||(e=a.leftContext+" "+a.rightContext,t.lastIndex=n[3]+1);return e}(e,Z));t=e.match(z);)i.push(a.leftContext),e=a.rightContext,r=function(e,t){var n,r=1;for(t.lastIndex=0;r&&(n=t.exec(e));)"{"===n[0]?++r:"}"===n[0]&&--r;return r?e.length:t.lastIndex}(e,K),o=t[1],n=!/^(?:if|while|for|switch|catch|function)$/.test(o),o=n?t[0].replace(o,"this."+o+" = function"):t[0],i.push(o,e.slice(0,r)),e=e.slice(r),n&&!/^\s*.\s*bind\b/.test(e)&&i.push(".bind(this)");return i.length?i.join("")+e:e}function u(e,t,n,r,o){return/\S/.test(e)?(n||(n=t.type),(t.parser||n&&be._req("js."+n,!0)||a)(e,r,o).replace(/\r\n?/g,"\n").replace(k,"")):""}function s(e,t,n,r){return"string"==typeof t&&(r=n,n=t,t={}),n&&"object"==typeof n&&(r=n,n=""),r||(r={}),u(e,t||{},n,r.parserOptions,r.url)}function c(e,t){return t.replace(G,function(t,n,r){return r?(r=r.replace(/[^,]+/g,function(t){var n=t.trim();return n&&"from"!==n&&"to"!==n&&"%"!==n.slice(-1)?n=n.indexOf(":scope")<0?e+" "+n+',[riot-tag="'+e+'"] '+n+',[data-is="'+e+'"] '+n:n.replace(":scope",e)+","+n.replace(":scope",'[riot-tag="'+e+'"]')+","+n.replace(":scope",'[data-is="'+e+'"]'):t}),n?n+" "+r:r):t})}function f(e,t,n,r){var o=(r||(r={})).scoped;if(n)if("scoped-css"===n)o=!0;else if("css"!==n){var i=be._req("css."+n,!0);e=i(t,e,r.parserOpts||{},r.url)}if(e=e.replace(ge.R_MLCOMMS,"").replace(/\s+/g," ").trim(),o){if(!t)throw new Error("Can not parse scoped CSS without a tagName");e=c(t,e)}return e}function l(e,t,n){return t&&"object"==typeof t?(n=t,t=""):n||(n={}),f(e,n.tagName,t,n)}function p(e,t){return e?(e=B+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+B,t&&~e.indexOf("\n")?e.replace(/\n/g,"\\n"):e):"''"}function d(e,t,n,r,o,i,a){var u=a.debug?",\n ":", ",s="});";return o&&"\n"!==o.slice(-1)&&(s="\n"+s),i+"riot.tag2('"+e+B+u+p(t,1)+u+p(n)+u+p(r)+", function(opts) {\n"+o+s}function g(e){if(/<[-\w]/.test(e))for(var t,n=e.lastIndexOf("<"),r=e.length;~n;){if(t=e.slice(n,r).match(X))return n+=t.index+t[0].length,t=e.slice(0,n),"<-/>\n"===t.slice(-5)&&(t=t.slice(0,-5)),[t,e.slice(n)];r=n,n=e.lastIndexOf("<",n-1)}return["",e]}function m(e){if(e){var t=e.match(U);if(t=t&&(t[2]||t[3]))return t.replace("text/","")}return""}function h(e,t){if(e){var n=e.match(RegExp("\\s"+t+W,"i"));if(n=n&&n[1])return/^['"]/.test(n)?n.slice(1,-1):n}return""}function v(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function x(e){var t=v(h(e,"options"));return t?JSON.parse(t):null}function b(e,t,n,r){var o=m(n),i=h(n,"src"),a=C({},t.parserOptions.js);return!i&&u(e,t,o,C(a,x(n)),r)}function y(e,t,n,r,o){var i=C({},t.parserOptions.style),a={parserOpts:C(i,x(n)),scoped:n&&/\sscoped(\s|=|$)/i.test(n),url:r};return f(e,o,m(n)||t.style,a)}function w(e,t,n,r){return be._req("html."+n,!0)(e,r,t)}function _(i,a,s){var c,f=[],l={template:{},js:{},style:{}};a||(a={}),a.parserOptions=C(l,a.parserOptions||{}),c=a.exclude?function(e){return a.exclude.indexOf(e)<0}:function(){return 1},s||(s="");var p=ge.array(a.brackets);return a.template&&(i=w(i,s,a.template,a.parserOptions.template)),i=e(i).replace(J,function(e,i,l,m,h,v){var x="",w="",_="",C="",O=[];if(O._bp=p,l=l.toLowerCase(),m=m&&c("attribs")?r(t(n(m,a,O),O),O):"",(h||(h=v))&&/\S/.test(h))if(v)c("html")&&(_=o(v,a,O));else{h=h.replace(RegExp("^"+i,"gm"),""),h=h.replace(ee,function(e,t,n){return c("css")&&(w+=(w?" ":"")+y(n,a,t,s,l)),""}),h=h.replace(Y,function(e,t,n){if(c("js")){var r=b(n,a,t,s);r&&(x+=(x?"\n":"")+r)}return""});var S=g(h.replace(k,""));c("html")&&(_=o(S[0],a,O)),c("js")&&(h=u(S[1],a,null,null,s),h&&(x+=(x?"\n":"")+h),x=x.replace($,function(e){return C+=e.trim()+"\n",""}))}return x=/\S/.test(x)?x.replace(/\n{3,}/g,"\n\n"):"",a.entities?(f.push({tagName:l,html:_,css:w,attribs:m,js:x,imports:C}),""):d(l,_,w,m,x,C,a)}),a.entities?f:i}var C=be.utils.extend,O=/"[^"\n\\]*(?:\\[\S\s][^"\n\\]*)*"|'[^'\n\\]*(?:\\[\S\s][^'\n\\]*)*'/.source,S=ge.R_STRINGS.source,E=/ *([-\w:\xA0-\xFF]+) ?(?:= ?('[^']*'|"[^"]*"|\S+))?/g,N=RegExp(//.source+"|"+O,"g"),L=/<(-?[A-Za-z][-\w\xA0-\xFF]*)(?:\s+([^"'\/>]*(?:(?:"[^"]*"|'[^']*'|\/[^>])[^'"\/>]*)*)|\s*)(\/?)>/g,j=/>[ \t]+<(-?[A-Za-z]|\/[-A-Za-z])/g,M=RegExp("^(?:disabled|checked|readonly|required|allowfullscreen|auto(?:focus|play)|compact|controls|default|formnovalidate|hidden|ismap|itemscope|loop|multiple|muted|no(?:resize|shade|validate|wrap)?|open|reversed|seamless|selected|sortable|truespeed|typemustmatch)$"),T=["style","src","d"],R=/^(?:input|img|br|wbr|hr|area|base|col|embed|keygen|link|meta|param|source|track)$/,A=/]*|"[^"]*")*)?>([\S\s]+?)<\/pre\s*>/gi,I=/^"(?:number|date(?:time)?|time|month|email|color)\b/i,$=/^\s*import(?:(?:\s|[^\s'"])*)['|"].*\n?/gm,k=/[ \t]+$/gm,F=V(/@#\d/,"x01"),P=V(/@#(\d+)/g,"x01"),H="#",D="⁗",q='"',B="'",z=/^[ \t]*([$_A-Za-z][$\w]*)\s*\([^()]*\)\s*{/m,K=RegExp("[{}]|"+ge.S_QBLOCKS,"g"),Z=RegExp(ge.R_MLCOMMS.source+"|//[^\r\n]*|"+ge.S_QBLOCKS,"g"),G=RegExp("([{}]|^)[ ;]*([^@ ;{}][^{}]*)(?={)|"+O,"g"),U=/\stype\s*=\s*(?:(['"])(.+?)\1|(\S+))/i,W="\\s*=\\s*("+S+"|{[^}]+}|\\S+)",X=/\/>\n|^<(?:\/?-?[A-Za-z][-\w\xA0-\xFF]*\s*|-?[A-Za-z][-\w\xA0-\xFF]*\s+[-\w:\xA0-\xFF][\S\s]*?)>\n/,J=RegExp(/^([ \t]*)<(-?[A-Za-z][-\w\xA0-\xFF]*)(?:\s+([^'"\/>]+(?:(?:@|\/[^>])[^'"\/>]*)*)|\s*)?(?:\/>|>[ \t]*\n?([\S\s]*)^\1<\/\2\s*>|>(.*)<\/\2\s*>)/.source.replace("@",S),"gim"),Y=/ 9 | 10 | 16 | 17 | 18 | 19 |25 |26 |39 | 40 | 41 |27 |30 |Timer
28 |29 | 31 |34 |Panels
32 |33 | 35 |38 |Todo
36 |37 |