├── .gitignore ├── .versions ├── Gulpfile.js ├── README.md ├── blaze-material-ui-tests.js ├── demo.png ├── lib ├── iron-elements │ ├── IronIcon │ │ ├── IronIcon.js │ │ ├── IronIcon.scss │ │ ├── IronIcon.tpl.jade │ │ └── README.md │ └── IronSelector │ │ ├── IronSelector.js │ │ ├── IronSelector.scss │ │ ├── IronSelector.tpl.jade │ │ └── README.md ├── layout │ └── layout.scss ├── molecules │ └── MarkedElement │ │ ├── MarkedElement.js │ │ ├── MarkedElement.scss │ │ ├── MarkedElement.tpl.jade │ │ └── README.md ├── paper-elements │ ├── PaperButton │ │ ├── PaperButton.js │ │ ├── PaperButton.scss │ │ ├── PaperButton.tpl.jade │ │ └── README.md │ ├── PaperCheckbox │ │ ├── PaperCheckbox.js │ │ ├── PaperCheckbox.scss │ │ ├── PaperCheckbox.tpl.jade │ │ └── README.md │ ├── PaperDialog │ │ ├── PaperDialog.js │ │ ├── PaperDialog.scss │ │ ├── PaperDialog.tpl.jade │ │ └── README.md │ ├── PaperDrawerPanel │ │ ├── PaperDrawerPanel.js │ │ ├── PaperDrawerPanel.scss │ │ ├── PaperDrawerPanel.tpl.jade │ │ ├── PaperDrawerPanelDrawer.tpl.jade │ │ ├── PaperDrawerPanelMain.tpl.jade │ │ └── README.md │ ├── PaperDropdown │ │ ├── PaperDropdown.js │ │ ├── PaperDropdown.scss │ │ ├── PaperDropdown.tpl.jade │ │ └── README.md │ ├── PaperDropdownMenu │ │ ├── PaperDropdownMenu.js │ │ ├── PaperDropdownMenu.scss │ │ ├── PaperDropdownMenu.tpl.jade │ │ └── README.md │ ├── PaperFab │ │ ├── PaperFab.js │ │ ├── PaperFab.scss │ │ ├── PaperFab.tpl.jade │ │ └── README.md │ ├── PaperHeaderPanel │ │ ├── PaperHeaderPanel.js │ │ ├── PaperHeaderPanel.scss │ │ ├── PaperHeaderPanel.tpl.jade │ │ ├── PaperHeaderPanelMain.tpl.jade │ │ └── README.md │ ├── PaperIconButton │ │ ├── PaperIconButton.js │ │ ├── PaperIconButton.scss │ │ ├── PaperIconButton.tpl.jade │ │ └── README.md │ ├── PaperInput │ │ ├── PaperInput.js │ │ ├── PaperInput.scss │ │ ├── PaperInput.tpl.jade │ │ ├── PaperInputContainer.tpl.jade │ │ └── README.md │ ├── PaperItem │ │ ├── PaperItem.js │ │ ├── PaperItem.scss │ │ ├── PaperItem.tpl.jade │ │ └── README.md │ ├── PaperMaterial │ │ ├── PaperMaterial.js │ │ ├── PaperMaterial.scss │ │ ├── PaperMaterial.tpl.jade │ │ └── README.md │ ├── PaperMenu │ │ ├── PaperMenu.js │ │ ├── PaperMenu.scss │ │ ├── PaperMenu.tpl.jade │ │ └── README.md │ ├── PaperMenuButton │ │ ├── PaperMenuButton.js │ │ ├── PaperMenuButton.scss │ │ ├── PaperMenuButton.tpl.jade │ │ └── README.md │ ├── PaperProgress │ │ ├── PaperProgress.js │ │ ├── PaperProgress.scss │ │ ├── PaperProgress.tpl.jade │ │ └── README.md │ ├── PaperRadioButton │ │ ├── PaperRadioButton.js │ │ ├── PaperRadioButton.scss │ │ ├── PaperRadioButton.tpl.jade │ │ └── README.md │ ├── PaperRipple │ │ ├── PaperRipple.js │ │ ├── PaperRipple.scss │ │ ├── PaperRipple.tpl.jade │ │ └── README.md │ ├── PaperSpinner │ │ ├── PaperSpinner.js │ │ ├── PaperSpinner.scss │ │ ├── PaperSpinner.tpl.jade │ │ └── README.md │ ├── PaperTab │ │ ├── PaperTab.js │ │ ├── PaperTab.scss │ │ ├── PaperTab.tpl.jade │ │ └── README.md │ ├── PaperTabs │ │ ├── PaperTabs.js │ │ ├── PaperTabs.scss │ │ ├── PaperTabs.tpl.jade │ │ └── README.md │ ├── PaperToast │ │ ├── PaperToast.js │ │ ├── PaperToast.scss │ │ ├── PaperToast.tpl.jade │ │ └── README.md │ ├── PaperToggleButton │ │ ├── PaperToggleButton.js │ │ ├── PaperToggleButton.scss │ │ ├── PaperToggleButton.tpl.jade │ │ └── README.md │ ├── PaperToolbar │ │ ├── PaperToolbar.js │ │ ├── PaperToolbar.scss │ │ ├── PaperToolbar.tpl.jade │ │ ├── PaperToolbarBottom.tpl.jade │ │ ├── PaperToolbarMiddle.tpl.jade │ │ ├── PaperToolbarTop.tpl.jade │ │ └── README.md │ └── PaperTooltip │ │ ├── PaperTooltip.js │ │ ├── PaperTooltip.scss │ │ ├── PaperTooltip.tpl.jade │ │ └── README.md └── services │ └── IconService.js ├── package.js ├── package.json └── vendors ├── autogrowtextarea ├── .gitignore ├── README ├── bower.json ├── index.html ├── jquery-1.8.1.min.js ├── jquery.autogrowtextarea.js └── jquery.autogrowtextarea.min.js ├── highlight ├── CHANGES.md ├── LICENSE ├── README.md ├── README.ru.md ├── highlight.pack.js └── styles │ ├── agate.css │ ├── androidstudio.css │ ├── arta.css │ ├── ascetic.css │ ├── atelier-cave.dark.css │ ├── atelier-cave.light.css │ ├── atelier-dune.dark.css │ ├── atelier-dune.light.css │ ├── atelier-estuary.dark.css │ ├── atelier-estuary.light.css │ ├── atelier-forest.dark.css │ ├── atelier-forest.light.css │ ├── atelier-heath.dark.css │ ├── atelier-heath.light.css │ ├── atelier-lakeside.dark.css │ ├── atelier-lakeside.light.css │ ├── atelier-plateau.dark.css │ ├── atelier-plateau.light.css │ ├── atelier-savanna.dark.css │ ├── atelier-savanna.light.css │ ├── atelier-seaside.dark.css │ ├── atelier-seaside.light.css │ ├── atelier-sulphurpool.dark.css │ ├── atelier-sulphurpool.light.css │ ├── brown_paper.css │ ├── brown_papersq.png │ ├── codepen-embed.css │ ├── color-brewer.css │ ├── dark.css │ ├── darkula.css │ ├── default.css │ ├── docco.css │ ├── far.css │ ├── foundation.css │ ├── github-gist.css │ ├── github.css │ ├── googlecode.css │ ├── grayscale.css │ ├── hopscotch.css │ ├── hybrid.css │ ├── idea.css │ ├── ir_black.css │ ├── kimbie.dark.css │ ├── kimbie.light.css │ ├── magula.css │ ├── mono-blue.css │ ├── monokai.css │ ├── monokai_sublime.css │ ├── obsidian.css │ ├── paraiso.dark.css │ ├── paraiso.light.css │ ├── pojoaque.css │ ├── pojoaque.jpg │ ├── railscasts.css │ ├── rainbow.css │ ├── school_book.css │ ├── school_book.png │ ├── solarized_dark.css │ ├── solarized_light.css │ ├── sunburst.css │ ├── tomorrow-night-blue.css │ ├── tomorrow-night-bright.css │ ├── tomorrow-night-eighties.css │ ├── tomorrow-night.css │ ├── tomorrow.css │ ├── vs.css │ ├── xcode.css │ └── zenburn.css ├── marked ├── .npmignore ├── .travis.yml ├── LICENSE ├── Makefile ├── README.md ├── bin │ └── marked ├── bower.json ├── component.json ├── doc │ ├── broken.md │ └── todo.md ├── index.js ├── lib │ └── marked.js ├── man │ └── marked.1 ├── marked.min.js └── package.json └── remarkable ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .gitignore ├── .nojekyll ├── .npmignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── benchmark ├── fixtures │ ├── block-bq-flat.md │ ├── block-bq-nested.md │ ├── block-code.md │ ├── block-fences.md │ ├── block-heading.md │ ├── block-hr.md │ ├── block-html.md │ ├── block-lheading.md │ ├── block-list-flat.md │ ├── block-list-nested.md │ ├── block-ref-flat.md │ ├── block-ref-nested.md │ ├── block-tables.md │ ├── inline-autolink.md │ ├── inline-backticks.md │ ├── inline-em-flat.md │ ├── inline-em-nested.md │ ├── inline-em-worst.md │ ├── inline-entity.md │ ├── inline-escape.md │ ├── inline-html.md │ ├── inline-links-flat.md │ ├── inline-links-nested.md │ ├── inline-newlines.md │ ├── lorem1.txt │ ├── rawtabs.md │ └── spec.txt ├── implementations │ ├── commonmark-reference │ │ └── index.js │ ├── current-commonmark │ │ └── index.js │ ├── current │ │ └── index.js │ └── marked-0.3.2 │ │ └── index.js ├── index.js └── profile.js ├── bin └── remarkable.js ├── bower.json ├── dist ├── remarkable.js └── remarkable.min.js ├── index.js ├── lib ├── common │ ├── entities.js │ ├── html_blocks.js │ ├── html_re.js │ ├── url_schemas.js │ └── utils.js ├── configs │ ├── commonmark.js │ ├── default.js │ └── full.js ├── helpers │ ├── normalize_link.js │ ├── normalize_reference.js │ ├── parse_link_destination.js │ ├── parse_link_label.js │ └── parse_link_title.js ├── index.js ├── parser_block.js ├── parser_core.js ├── parser_inline.js ├── renderer.js ├── ruler.js ├── rules.js ├── rules_block │ ├── blockquote.js │ ├── code.js │ ├── deflist.js │ ├── fences.js │ ├── footnote.js │ ├── heading.js │ ├── hr.js │ ├── htmlblock.js │ ├── lheading.js │ ├── list.js │ ├── paragraph.js │ ├── state_block.js │ └── table.js ├── rules_core │ ├── abbr.js │ ├── abbr2.js │ ├── block.js │ ├── footnote_tail.js │ ├── inline.js │ ├── linkify.js │ ├── references.js │ ├── replacements.js │ └── smartquotes.js └── rules_inline │ ├── autolink.js │ ├── backticks.js │ ├── del.js │ ├── emphasis.js │ ├── entity.js │ ├── escape.js │ ├── footnote_inline.js │ ├── footnote_ref.js │ ├── htmltag.js │ ├── ins.js │ ├── links.js │ ├── mark.js │ ├── newline.js │ ├── state_inline.js │ ├── sub.js │ ├── sup.js │ └── text.js ├── package.json ├── support ├── demodata.js ├── entities.js └── specsplit.js └── test ├── commonmark.js ├── fixtures ├── commonmark │ ├── bad.txt │ ├── good.txt │ └── spec.txt └── remarkable │ ├── abbr.txt │ ├── commonmark_extras.txt │ ├── deflist.txt │ ├── del.txt │ ├── footnotes.txt │ ├── ins.txt │ ├── linkify.txt │ ├── mark.txt │ ├── proto.txt │ ├── smartquotes.txt │ ├── sub.txt │ ├── sup.txt │ ├── tables.txt │ ├── typographer.txt │ └── xss.txt ├── misc.js ├── remarkable.js ├── ruler.js └── utils.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | #backup files 6 | *.bak 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | 13 | # Temporary files 14 | tmp 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Coverage directory used by tools like istanbul 20 | coverage 21 | 22 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 23 | .grunt 24 | 25 | # node-waf configuration 26 | .lock-wscript 27 | 28 | # Compiled binary addons (http://nodejs.org/api/addons.html) 29 | build/Release 30 | 31 | # Dependency directory 32 | # https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git 33 | node_modules -------------------------------------------------------------------------------- /.versions: -------------------------------------------------------------------------------- 1 | babel-compiler@5.8.24_1 2 | babel-runtime@0.1.4 3 | base64@1.0.4 4 | binary-heap@1.0.4 5 | blaze@2.1.3 6 | blaze-tools@1.0.4 7 | boilerplate-generator@1.0.4 8 | caching-compiler@1.0.0 9 | caching-html-compiler@1.0.2 10 | callback-hook@1.0.4 11 | check@1.1.0 12 | codefights:blaze-material-ui@0.1.8 13 | coffeescript@1.0.11 14 | ddp@1.2.2 15 | ddp-client@1.2.1 16 | ddp-common@1.2.2 17 | ddp-server@1.2.2 18 | deps@1.0.9 19 | diff-sequence@1.0.1 20 | ecmascript@0.1.6 21 | ecmascript-runtime@0.2.6 22 | ejson@1.0.7 23 | fourseven:scss@3.3.3_3 24 | geojson-utils@1.0.4 25 | html-tools@1.0.5 26 | htmljs@1.0.5 27 | id-map@1.0.4 28 | jquery@1.11.4 29 | local-test:codefights:blaze-material-ui@0.1.8 30 | logging@1.0.8 31 | meteor@1.1.10 32 | minifiers@1.1.7 33 | minimongo@1.0.10 34 | mongo@1.1.3 35 | mongo-id@1.0.1 36 | mquandalle:jade@0.4.4 37 | mquandalle:jade-compiler@0.4.4 38 | npm-mongo@1.4.39_1 39 | observe-sequence@1.0.7 40 | ordered-dict@1.0.4 41 | peerlibrary:assert@0.2.5 42 | peerlibrary:base-component@0.13.0 43 | peerlibrary:blaze-components@0.14.0 44 | peerlibrary:computed-field@0.3.0 45 | peerlibrary:reactive-field@0.1.0 46 | promise@0.5.1 47 | random@1.0.5 48 | reactive-var@1.0.6 49 | retry@1.0.4 50 | routepolicy@1.0.6 51 | spacebars@1.0.7 52 | spacebars-compiler@1.0.7 53 | templating@1.1.5 54 | templating-tools@1.0.0 55 | tinytest@1.0.6 56 | tracker@1.0.9 57 | ui@1.0.8 58 | underscore@1.0.4 59 | webapp@1.2.3 60 | webapp-hashing@1.0.5 61 | -------------------------------------------------------------------------------- /Gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var argv = require('yargs').argv; 3 | var template = require('gulp-template'); 4 | var rename = require("gulp-rename"); 5 | 6 | 7 | gulp.task('component', [], function() { 8 | return gulp.src('gulp/template/*') 9 | .pipe(template({name: argv.name})) 10 | .pipe(rename(function (path) { 11 | path.dirname = argv.name; 12 | if(path.basename !== 'README') { 13 | path.basename = argv.name; 14 | } 15 | if(path.extname === '.jade') { 16 | path.extname = '.tpl.jade'; 17 | } 18 | })) 19 | .pipe(gulp.dest('./lib/'+ argv.type)); 20 | }); 21 | 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # blaze-material-ui 2 | 3 | > This is an alpha release so use it at your own risk. See below for a list of apps that use this in production 4 | 5 | 6 | ## Installation 7 | 8 | ```shell 9 | meteor add codefights:blaze-material-ui 10 | ``` 11 | 12 | ## Screenshots 13 | 14 |  15 | 16 | 17 | ## Demos 18 | 19 | ### Component Catalog 20 | [official demo page](http://blaze-material-ui.meteor.com/) 21 | 22 | ### Apps using this library 23 | [CodeFights](https://codefights.com) 24 | 25 | 26 | ## Browser support 27 | 28 | Currently targeted browsers are: 29 | 30 | * Chrome (Desktop, Android) 31 | * Firefox 32 | * Safari 33 | 34 | (some browsers might have layout issues) 35 | 36 | ## Issues 37 | 38 | Please feel free to contribute or report issues. 39 | 40 | Since this is an alpha version we are making a new concept for or release candidate. It is most likely going to be a complete rewrite but we are happy about feedback and suggestions. 41 | 42 | 43 | ## Paper elements for Meteor 44 | 45 | This library provides material design elements in meteor. 46 | It is built on top of [meteor-blaze-components](https://github.com/peerlibrary/meteor-blaze-components) which uses [blaze](https://github.com/meteor/blaze) 47 | 48 | 49 | ## Create components from gulp 50 | 51 | ```shell 52 | ## requires --type and --name to be set 53 | ## --type will declare the folder 54 | ## --name will declare the component name 55 | gulp component --type=paper-elements --name=PaperButton 56 | ``` 57 | 58 | will create 59 | ``` 60 | lib 61 | ┗━┳ paper-elements 62 | ┗━┳ PaperButton 63 | ┣━ PaperButton.js 64 | ┣━ PaperButton.scss 65 | ┗━ PaperButton.tpl.jade 66 | ``` 67 | 68 | ## Usage 69 | 70 | ### Spacebars 71 | ```handlebars 72 |
73 | {{#PaperButton}} 74 | Button 75 | {{/PaperButton}} 76 | 77 | ``` 78 | 79 | ### Jade 80 | ```jade 81 | body 82 | +PaperButton() 83 | | Button 84 | ``` 85 | -------------------------------------------------------------------------------- /blaze-material-ui-tests.js: -------------------------------------------------------------------------------- 1 | // Write your tests here! 2 | // Here is an example. 3 | Tinytest.add('example', function (test) { 4 | test.equal(true, true); 5 | }); 6 | -------------------------------------------------------------------------------- /demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSignal/blaze-material-ui/5c8e9d59919b14f7d85b3c7934b0d7e311707b48/demo.png -------------------------------------------------------------------------------- /lib/iron-elements/IronIcon/IronIcon.js: -------------------------------------------------------------------------------- 1 | Material = Material || {}; 2 | 3 | Material.IronIcon = IronIcon = class IronIcon extends BlazeComponent { 4 | 5 | constructor() { 6 | super(); 7 | } 8 | 9 | onCreated() { 10 | this.iconService = Material.iconService; 11 | } 12 | /** 13 | * @param {String} name The name of the icon (category:iconName) 14 | * @return {String} Retuns an SVG 15 | */ 16 | getSVG(name) { 17 | 18 | let icon = this.data().icon.split(':'); 19 | let group; 20 | let iconName; 21 | let svg; 22 | if (icon[1]) { 23 | group = icon[0]; 24 | iconName = icon[1]; 25 | svg = this.iconService.getIcon(group, iconName); 26 | 27 | } else { 28 | svg = ''; 29 | } 30 | return svg; 31 | } 32 | 33 | }; 34 | 35 | IronIcon.register('IronIcon'); -------------------------------------------------------------------------------- /lib/iron-elements/IronIcon/IronIcon.scss: -------------------------------------------------------------------------------- 1 | iron-icon { 2 | display: inline-block; 3 | vertical-align: middle; 4 | background-repeat: no-repeat; 5 | fill: currentcolor; 6 | position: relative; 7 | height: 24px; 8 | width: 24px; 9 | pointer-events: none; 10 | } -------------------------------------------------------------------------------- /lib/iron-elements/IronIcon/IronIcon.tpl.jade: -------------------------------------------------------------------------------- 1 | iron-icon(class=className 2 | aria-label=label 3 | data-id=id 4 | icon=icon)!= getSVG 5 | -------------------------------------------------------------------------------- /lib/iron-elements/IronIcon/README.md: -------------------------------------------------------------------------------- 1 | # IronIcon 2 | 3 | ## Reference 4 | * Material Icon Library - https://www.google.com/design/icons/ 5 | 6 | ## Usage 7 | 8 | Basic usage 9 | 10 | ```handlebars 11 | {{>IronIcon icon="navigation:menu"}} 12 | ``` 13 | 14 | Add a custom className 15 | 16 | ```handlebars 17 | {{>IronIcon className="category:icon-name"}} 18 | ``` 19 | -------------------------------------------------------------------------------- /lib/iron-elements/IronSelector/IronSelector.js: -------------------------------------------------------------------------------- 1 | Material = Material || {} 2 | 3 | 4 | Material.IronSelector = IronSelector = class IronSelector extends BlazeComponent { 5 | 6 | constructor() { 7 | super(); 8 | this.updateSelectedIndex = this.updateSelectedIndex.bind(this); 9 | this.updateSelection = this.updateSelection.bind(this); 10 | } 11 | 12 | /** 13 | * set defaults 14 | */ 15 | onCreated () { 16 | this.selected = new ReactiveVar(0); 17 | //console.log(this.data().onUpdate) 18 | //this.updateParent = this.data().update; 19 | this.autorun(this.updateSelectedIndex); 20 | } 21 | 22 | updateSelectedIndex () { 23 | this.selected.set(this.data().selected || 0); 24 | } 25 | 26 | 27 | handleClick (e) { 28 | var $element = $(e.target).closest('iron-selector>*'); 29 | let inScope = $(e.target).closest('iron-selector')[0] == $(this.firstNode())[0]; 30 | if (!inScope) { 31 | return false; 32 | } 33 | var selected = $element.index(); 34 | this.selected.set(selected); 35 | this.updateSelection(); 36 | if (typeof this.data().onUpdate === 'function') { 37 | this.data().onUpdate(this); 38 | } 39 | 40 | } 41 | 42 | updateSelection () { 43 | let selected = parseInt(this.selected.get(),10); 44 | var $elements = this.findAll('>*>*'); 45 | $elements.forEach((item, index)=>{ 46 | let isSelected = index === selected; 47 | item.classList.toggle('iron-selected', isSelected); 48 | }); 49 | } 50 | 51 | /** 52 | * after render 53 | */ 54 | onRendered () { 55 | this.selector = this.childrenComponentsWith('selected'); 56 | this.autorun(this.updateSelection); 57 | 58 | } 59 | 60 | events () { 61 | return [{ 62 | 'click': this.handleClick 63 | }]; 64 | } 65 | } 66 | 67 | IronSelector.register('IronSelector'); -------------------------------------------------------------------------------- /lib/iron-elements/IronSelector/IronSelector.scss: -------------------------------------------------------------------------------- 1 | iron-selector { 2 | visibility: hidden; 3 | > * { 4 | visibility: visible; 5 | } 6 | } -------------------------------------------------------------------------------- /lib/iron-elements/IronSelector/IronSelector.tpl.jade: -------------------------------------------------------------------------------- 1 | iron-selector(class=className selected=selected.get) 2 | +Template.contentBlock -------------------------------------------------------------------------------- /lib/iron-elements/IronSelector/README.md: -------------------------------------------------------------------------------- 1 | # IronSelector 2 | 3 | 4 | ## Screenshot 5 |  6 | 7 | ## Usage 8 | 9 | Basic usage 10 | 11 | ``` 12 | {{#IronSelector}} 13 | 1 14 | 2 15 | 3 16 | 4 17 | {{/IronSelector}} 18 | ``` 19 | 20 | Add a custom className 21 | 22 | ``` 23 | {{#IronSelector className="my-custom-class"}} 24 | 1 25 | 2 26 | 3 27 | 4 28 | {{/IronSelector}} 29 | ``` 30 | 31 | 32 | ``` 33 | {{#IronSelector selected="2"}} 34 | 1 35 | 2 36 | 3 37 | 4 38 | {{/IronSelector}} 39 | ``` 40 | 41 | 42 | ## JavaScript Callback 43 | 44 | ```handlebars 45 | {{#IronSelector onUpdate=myUpdateCallback}} 46 | 1 47 | 2 48 | 3 49 | 4 50 | {{/IronSelector}} 51 | 52 | ``` 53 | ```javascript 54 | myUpdateCallback: function(instance) { 55 | return function(selector){ 56 | alert('selected: ' + selector.selected.get()); 57 | }(instance) 58 | } 59 | ``` -------------------------------------------------------------------------------- /lib/molecules/MarkedElement/MarkedElement.js: -------------------------------------------------------------------------------- 1 | class MarkedElement extends BlazeComponent { 2 | 3 | /** 4 | * set defaults 5 | */ 6 | onCreated() {} 7 | 8 | /** 9 | * after render 10 | */ 11 | onRendered() {} 12 | 13 | /** 14 | * Run markdown via the 'marked.js' library 15 | * https://github.com/chjj/marked 16 | * @return {String} Returns raw HTML as a string 17 | * @usage 18 | * 19 | * ### Spacebars 20 | * ```handlebars 21 | *10 | **test** 11 | | 12 |
20 | 21 | test 22 | 23 | | 24 | 25 |
The HTML specification 11 | is maintained by the W3C.
12 | . 13 | 14 | They can be multiline (see pandoc implementation). Not sure about newlines, but we should at least skip those definitions: 15 | 16 | . 17 | *[ 18 | foo 19 | bar 20 | ]: desc 21 | foo 22 | . 23 |foo
24 | . 25 | 26 | They can contain arbitrary markup (see pandoc implementation): 27 | 28 | . 29 | *[`]:`]: foo 30 | \`]:\` 31 | . 32 |`]:`
33 | . 34 | 35 | Can contain matched brackets: 36 | 37 | . 38 | *[[abbr]]: foo 39 | [abbr] 40 | . 41 |[abbr]
42 | . 43 | 44 | No empty abbreviations: 45 | 46 | . 47 | *[foo]: 48 | foo 49 | . 50 |*[foo]: 51 | foo
52 | . 53 | 54 | Intersecting abbreviations (first should match): 55 | 56 | . 57 | *[Bar Foo]: 123 58 | *[Foo Bar]: 456 59 | 60 | Foo Bar Foo 61 | 62 | Bar Foo Bar 63 | . 64 |Foo Bar Foo
65 |Bar Foo Bar
66 | . 67 | 68 | Don't bother with nested abbreviations (yet?): 69 | 70 | . 71 | *[JS]: javascript 72 | *[HTTP]: hyper text blah blah 73 | *[JS HTTP]: is awesome 74 | JS HTTP is a collection of low-level javascript HTTP-related modules 75 | . 76 |JS HTTP is a collection of low-level javascript HTTP-related modules
77 | . 78 | 79 | Don't match the middle of the string: 80 | 81 | . 82 | *[foo]: blah 83 | *[bar]: blah 84 | foobar 85 | . 86 |foobar
87 | . 88 | -------------------------------------------------------------------------------- /vendors/remarkable/test/fixtures/remarkable/del.txt: -------------------------------------------------------------------------------- 1 | . 2 | ~~Strikeout~~ 3 | . 4 |Strikeout
~~test~~
15 |**test**
~~link~~
25 |~~link~~
26 | . 27 | 28 | Strikeouts have the same priority as emphases with respect to backticks: 29 | . 30 | ~~`code~~` 31 | 32 | `~~code`~~ 33 | . 34 |~~code~~
~~code
~~
foo bar baz
f o o b a r
foo ~~ bar ~~ baz
56 | . 57 | 58 | 59 | Newline should be considered a whitespace: 60 | 61 | . 62 | ~~test 63 | ~~ 64 | 65 | ~~ 66 | test~~ 67 | 68 | ~~ 69 | test 70 | ~~ 71 | . 72 |~~test 73 | ~~
74 |~~ 75 | test~~
76 |~~ 77 | test 78 | ~~
79 | . 80 | -------------------------------------------------------------------------------- /vendors/remarkable/test/fixtures/remarkable/ins.txt: -------------------------------------------------------------------------------- 1 | . 2 | ++Insert++ 3 | . 4 |Insert
5 | . 6 | 7 | 8 | These are not inserts, you have to use exactly two "++": 9 | . 10 | x +++foo+++ 11 | 12 | x ++foo+++ 13 | 14 | x +++foo++ 15 | . 16 |x +++foo+++
17 |x ++foo+++
18 |x +++foo++
19 | . 20 | 21 | Inserts have the same priority as emphases: 22 | 23 | . 24 | **++test**++ 25 | 26 | ++**test++** 27 | . 28 |++test++
29 |**test**
30 | . 31 | 32 | Inserts have the same priority as emphases with respect to links: 33 | . 34 | [++link]()++ 35 | 36 | ++[link++]() 37 | . 38 |++link++
39 |++link++
40 | . 41 | 42 | Inserts have the same priority as emphases with respect to backticks: 43 | . 44 | ++`code++` 45 | 46 | `++code`++ 47 | . 48 |++code++
++code
++
foo bar baz
57 | . 58 | 59 | . 60 | ++f **o ++o b++ a** r++ 61 | . 62 |f o o b a r
63 | . 64 | 65 | Should not have a whitespace between text and "++": 66 | . 67 | foo ++ bar ++ baz 68 | . 69 |foo ++ bar ++ baz
70 | . 71 | 72 | 73 | Newline should be considered a whitespace: 74 | 75 | . 76 | ++test 77 | ++ 78 | 79 | ++ 80 | test++ 81 | 82 | ++ 83 | test 84 | ++ 85 | . 86 |++test 87 | ++
88 |++ 89 | test++
90 |++ 91 | test 92 | ++
93 | . 94 | -------------------------------------------------------------------------------- /vendors/remarkable/test/fixtures/remarkable/linkify.txt: -------------------------------------------------------------------------------- 1 | linkify 2 | . 3 | url http://www.youtube.com/watch?v=5Jt5GEr4AYg. 4 | . 5 |url http://www.youtube.com/watch?v=5Jt5GEr4AYg.
6 | . 7 | 8 | 9 | don't touch text in links 10 | . 11 | [https://example.com](https://example.com) 12 | . 13 | 14 | . 15 | 16 | 17 | don't touch text in autolinks 18 | . 19 |www.example.org版权所有
46 | . 47 | 48 | 49 | emails 50 | . 51 | test@example.com 52 | 53 | mailto:test@example.com 54 | . 55 | 56 | 57 | . 58 | -------------------------------------------------------------------------------- /vendors/remarkable/test/fixtures/remarkable/mark.txt: -------------------------------------------------------------------------------- 1 | . 2 | ==Mark== 3 | . 4 |Mark
5 | . 6 | 7 | 8 | These are not marks, you have to use exactly two "==": 9 | . 10 | x ===foo=== 11 | 12 | x ==foo=== 13 | 14 | x ===foo== 15 | . 16 |x ===foo===
17 |x ==foo===
18 |x ===foo==
19 | . 20 | 21 | Marks have the same priority as emphases: 22 | 23 | . 24 | **==test**== 25 | 26 | ==**test==** 27 | . 28 |==test==
29 |**test**
30 | . 31 | 32 | Marks have the same priority as emphases with respect to links: 33 | . 34 | [==link]()== 35 | 36 | ==[link==]() 37 | . 38 |==link==
39 |==link==
40 | . 41 | 42 | Marks have the same priority as emphases with respect to backticks: 43 | . 44 | ==`code==` 45 | 46 | `==code`== 47 | . 48 |==code==
==code
==
foo bar baz
57 | . 58 | 59 | . 60 | ==f **o ==o b== a** r== 61 | . 62 |f o o b a r
63 | . 64 | 65 | Should not have a whitespace between text and "==": 66 | . 67 | foo == bar == baz 68 | . 69 |foo == bar == baz
70 | . 71 | 72 | 73 | Newline should be considered a whitespace: 74 | 75 | . 76 | ==test 77 | == 78 | 79 | == 80 | test== 81 | 82 | == 83 | test 84 | == 85 | . 86 |== 88 | test==
89 |== 90 | test 91 | ==
92 | . 93 | -------------------------------------------------------------------------------- /vendors/remarkable/test/fixtures/remarkable/proto.txt: -------------------------------------------------------------------------------- 1 | 2 | . 3 | [__proto__] 4 | 5 | [__proto__]: blah 6 | . 7 | 8 | . 9 | 10 | . 11 | [^__proto__] 12 | 13 | [^__proto__]: blah 14 | . 15 | 16 |blah ↩
20 |proto __proto__
31 | . 32 | 33 | . 34 | [hasOwnProperty] 35 | 36 | [hasOwnProperty]: blah 37 | . 38 | 39 | . 40 | 41 | . 42 | [^hasOwnProperty] 43 | 44 | [^hasOwnProperty]: blah 45 | . 46 | 47 |blah ↩
51 |hasOwnProperty
62 | . 63 | -------------------------------------------------------------------------------- /vendors/remarkable/test/fixtures/remarkable/smartquotes.txt: -------------------------------------------------------------------------------- 1 | Should parse nested quotes: 2 | 3 | . 4 | "foo 'bar' baz" 5 | . 6 |“foo ‘bar’ baz”
7 | . 8 | 9 | . 10 | 'foo 'bar' baz' 11 | . 12 |‘foo ‘bar’ baz’
13 | . 14 | 15 | 16 | Should not overlap quotes: 17 | 18 | . 19 | 'foo "bar' baz" 20 | . 21 |‘foo "bar’ baz"
22 | . 23 | 24 | 25 | Should match quotes on the same level: 26 | 27 | . 28 | "foo *bar* baz" 29 | . 30 |“foo bar baz”
31 | . 32 | 33 | 34 | Should not match quotes on different levels: 35 | 36 | . 37 | *"foo* bar" 38 | 39 | "foo *bar"* 40 | . 41 |"foo bar"
42 |"foo bar"
43 | . 44 | 45 | . 46 | *"foo* bar *baz"* 47 | . 48 |"foo bar baz"
49 | . 50 | 51 | 52 | Should try and find matching quote in this case: 53 | 54 | . 55 | "foo "bar 'baz" 56 | . 57 |"foo “bar 'baz”
58 | . 59 | 60 | 61 | Should not touch 'inches' in quotes: 62 | 63 | . 64 | "Monitor 21"" 65 | . 66 |“Monitor 21"”
67 | . 68 | 69 | 70 | Should render an apostrophe as a rsquo: 71 | 72 | . 73 | This isn't and can't be the best approach to implement this... 74 | . 75 |This isn’t and can’t be the best approach to implement this…
76 | . 77 | 78 | 79 | Apostrophe could end the word, that's why original smartypants replaces all of them as rsquo: 80 | 81 | . 82 | users' stuff 83 | . 84 |users’ stuff
85 | . 86 | -------------------------------------------------------------------------------- /vendors/remarkable/test/fixtures/remarkable/sub.txt: -------------------------------------------------------------------------------- 1 | 2 | . 3 | ~foo\~ 4 | . 5 |~foo~
6 | . 7 | 8 | . 9 | ~foo bar~ 10 | . 11 |~foo bar~
12 | . 13 | 14 | . 15 | ~foo\ bar\ baz~ 16 | . 17 |foo bar baz
18 | . 19 | 20 | . 21 | ~\ foo\ ~ 22 | . 23 |foo
24 | . 25 | 26 | . 27 | ~foo\\\\\\\ bar~ 28 | . 29 |foo\\\ bar
30 | . 31 | 32 | . 33 | ~foo\\\\\\ bar~ 34 | . 35 |~foo\\\ bar~
36 | . 37 | -------------------------------------------------------------------------------- /vendors/remarkable/test/fixtures/remarkable/sup.txt: -------------------------------------------------------------------------------- 1 | 2 | . 3 | ^test^ 4 | . 5 |test
6 | . 7 | 8 | . 9 | ^foo\^ 10 | . 11 |^foo^
12 | . 13 | 14 | . 15 | 2^4 + 3^5 16 | . 17 |2^4 + 3^5
18 | . 19 | 20 | . 21 | ^foo~bar^baz^bar~foo^ 22 | . 23 |foo~barbazbar~foo
24 | . 25 | 26 | . 27 | ^\ foo\ ^ 28 | . 29 |foo
30 | . 31 | 32 | . 33 | ^foo\\\\\\\ bar^ 34 | . 35 |foo\\\ bar
36 | . 37 | 38 | . 39 | ^foo\\\\\\ bar^ 40 | . 41 |^foo\\\ bar^
42 | . 43 | -------------------------------------------------------------------------------- /vendors/remarkable/test/fixtures/remarkable/typographer.txt: -------------------------------------------------------------------------------- 1 | . 2 | (bad) 3 | . 4 |(bad)
5 | . 6 | 7 | 8 | copyright 9 | . 10 | (c) (C) 11 | . 12 |© ©
13 | . 14 | 15 | 16 | reserved 17 | . 18 | (r) (R) 19 | . 20 |® ®
21 | . 22 | 23 | 24 | trademark 25 | . 26 | (tm) (TM) 27 | . 28 |™ ™
29 | . 30 | 31 | 32 | paragraph 33 | . 34 | (p) (P) 35 | . 36 |§ §
37 | . 38 | 39 | 40 | plus-minus 41 | . 42 | +-5 43 | . 44 |±5
45 | . 46 | 47 | 48 | ellipsis 49 | . 50 | test.. test... test..... test?..... test!.... 51 | . 52 |test… test… test… test?.. test!..
53 | . 54 | 55 | 56 | dupes 57 | . 58 | !!!!!! ???? ,, 59 | . 60 |!!! ??? ,
61 | . 62 | 63 | 64 | dashes 65 | . 66 | ---remarkable --- super--- 67 | 68 | remarkable---awesome 69 | 70 | abc ---- 71 | . 72 |—remarkable — super—
73 |remarkable—awesome
74 |abc ----
75 | . 76 | . 77 | --remarkable -- super-- 78 | 79 | remarkable--awesome 80 | . 81 |–remarkable – super–
82 |remarkable–awesome
83 | . 84 | 85 | -------------------------------------------------------------------------------- /vendors/remarkable/test/fixtures/remarkable/xss.txt: -------------------------------------------------------------------------------- 1 | . 2 | [normal link](javascript) 3 | . 4 | 5 | . 6 | 7 | 8 | 9 | Should not allow some protocols in links and images 10 | 11 | . 12 | [xss link](javascript:alert(1)) 13 | 14 | [xss link](JAVASCRIPT:alert(1)) 15 | 16 | [xss link](vbscript:alert(1)) 17 | 18 | [xss link](VBSCRIPT:alert(1)) 19 | 20 | [xss link](file:///123) 21 | . 22 |[xss link](javascript:alert(1))
23 |[xss link](JAVASCRIPT:alert(1))
24 |[xss link](vbscript:alert(1))
25 |[xss link](VBSCRIPT:alert(1))
26 |[xss link](file:///123)
27 | . 28 | 29 | 30 | . 31 | [xss link]("><script>alert("xss")</script>) 32 | . 33 | 34 | . 35 | 36 | . 37 | [xss link]([xss link](<javascript:alert(1)>)
40 | . 41 | 42 | . 43 | [xss link](javascript:alert(1)) 44 | . 45 |[xss link](javascript:alert(1))
46 | . 47 | 48 | 49 | Image parser use the same code base. 50 | 51 | . 52 | ) 53 | . 54 |)
55 | . 56 | 57 | 58 | Autolinks 59 | 60 | . 61 |<javascript:alert(1)>
66 |<javascript:alert(1)>
67 | . 68 | 69 | 70 | Linkifier 71 | 72 | . 73 | javascript:alert(1) 74 | 75 | javascript:alert(1) 76 | . 77 |javascript:alert(1)
78 |javascript:alert(1)
79 | . 80 | -------------------------------------------------------------------------------- /vendors/remarkable/test/remarkable.js: -------------------------------------------------------------------------------- 1 | /*global describe*/ 2 | 'use strict'; 3 | 4 | 5 | var path = require('path'); 6 | 7 | 8 | var utils = require('./utils'); 9 | var Remarkable = require('../'); 10 | 11 | 12 | describe('remarkable', function () { 13 | var md = new Remarkable('full', { 14 | html: true, 15 | langPrefix: '', 16 | typographer: true, 17 | linkify: true 18 | }); 19 | 20 | utils.addTests(path.join(__dirname, 'fixtures/remarkable'), md); 21 | }); 22 | -------------------------------------------------------------------------------- /vendors/remarkable/test/utils.js: -------------------------------------------------------------------------------- 1 | /*global describe, it*/ 2 | 'use strict'; 3 | 4 | 5 | var fs = require('fs'); 6 | var path = require('path'); 7 | var assert = require('assert'); 8 | 9 | 10 | function addTests(fPath, markdown, skip) { 11 | var input, 12 | stat = fs.statSync(fPath); 13 | 14 | if (stat.isFile()) { 15 | input = fs.readFileSync(fPath, 'utf8'); 16 | 17 | input = input.replace(/→/g, '\t'); 18 | 19 | describe(fPath, function () { 20 | input.replace(/^\.\n([\s\S]*?)^\.\n([\s\S]*?)^\.$/gm, function(__, md, html, offset, orig) { 21 | var line = orig.slice(0, offset).split(/\r?\n/g).length; 22 | 23 | // Also skip tests if file name starts with "_" 24 | if (!skip && path.basename(fPath)[0] !== '_') { 25 | it('line ' + line, function () { 26 | assert.strictEqual(html, markdown.render(md)); 27 | }); 28 | } else { 29 | it.skip('line ' + line, function () { 30 | assert.strictEqual(html, markdown.render(md)); 31 | }); 32 | } 33 | }); 34 | }); 35 | 36 | return; 37 | } 38 | 39 | if (stat.isDirectory()) { 40 | fs.readdirSync(fPath).forEach(function (name) { 41 | addTests(path.join(fPath, name), markdown, skip); 42 | }); 43 | } 44 | } 45 | 46 | 47 | module.exports.addTests = addTests; 48 | --------------------------------------------------------------------------------