🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

vue-announcer

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-announcer - npm Package Compare versions

Comparing version

to
1.0.0

5

CHANGELOG.md

@@ -5,2 +5,7 @@ # Change Log

<a name="1.0.0"></a>
# [1.0.0](https://github.com/vue-a11y/vue-announcer/compare/v0.1.1...v1.0.0) (2018-05-22)
<a name="0.1.1"></a>

@@ -7,0 +12,0 @@ ## [0.1.1](https://github.com/vue-a11y/vue-announcer/compare/v0.0.3...v0.1.1) (2018-05-22)

218

dist/vue-announcer.amd.js

@@ -1,217 +0,1 @@

define(function () { 'use strict';
//
//
//
//
//
//
//
//
//
//
var script = {
name: 'VueAnnouncer',
data: function data () {
return {
content: ''
}
},
created: function created () {
this.$announcer.data = this.$data;
}
}
var __vue_script__ = script;
/* template */
var __vue_render__ = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c("div", {
staticClass: "announcer",
attrs: { id: "announcer", "aria-live": "polite", "aria-atomic": "true" },
domProps: { textContent: _vm._s(_vm.content) }
})
};
var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;
var __vue_template__ = typeof __vue_render__ !== 'undefined'
? { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }
: {};
/* style */
var __vue_inject_styles__ = function (inject) {
if (!inject) { return }
inject("data-v-81147d56_0", { source: "\n.announcer[data-v-81147d56] {\r\n position: absolute;\r\n left: -10000px;\r\n top: auto;\r\n width: 1px;\r\n height: 1px;\r\n overflow: hidden;\n}\r\n", map: undefined, media: undefined });
};
/* scoped */
var __vue_scope_id__ = "data-v-81147d56";
/* module identifier */
var __vue_module_identifier__ = undefined;
/* functional template */
var __vue_is_functional_template__ = false;
/* component normalizer */
function __vue_normalize__(
template, style, script$$1,
scope, functional, moduleIdentifier,
createInjector, createInjectorSSR
) {
var component = script$$1 || {};
{
component.__file = "D:\\Work\\Projetos\\Open-source\\Github\\Organization\\vue-a11y\\repositories\\vue-a11y-announcer\\src\\vue-announcer.vue";
}
if (!component.render) {
component.render = template.render;
component.staticRenderFns = template.staticRenderFns;
component._compiled = true;
if (functional) { component.functional = true; }
}
component._scopeId = scope;
{
var hook;
if (style) {
hook = function(context) {
style.call(this, createInjector(context));
};
}
if (hook !== undefined) {
if (component.functional) {
// register for functional component in vue file
var originalRender = component.render;
component.render = function renderWithStyleInjection(h, context) {
hook.call(context);
return originalRender(h, context)
};
} else {
// inject component registration as beforeCreate hook
var existing = component.beforeCreate;
component.beforeCreate = existing ? [].concat(existing, hook) : [hook];
}
}
}
return component
}
/* style inject */
function __vue_create_injector__() {
var head = document.head || document.getElementsByTagName('head')[0];
var styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {});
var isOldIE =
typeof navigator !== 'undefined' &&
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
return function addStyle(id, css) {
if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present.
var group = isOldIE ? css.media || 'default' : id;
var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined });
if (!style.ids.includes(id)) {
var code = css.source;
var index = style.ids.length;
style.ids.push(id);
if (isOldIE) {
style.element = style.element || document.querySelector('style[data-group=' + group + ']');
}
if (!style.element) {
var el = style.element = document.createElement('style');
el.type = 'text/css';
if (css.media) { el.setAttribute('media', css.media); }
if (isOldIE) {
el.setAttribute('data-group', group);
el.setAttribute('data-next-index', '0');
}
head.appendChild(el);
}
if (isOldIE) {
index = parseInt(style.element.getAttribute('data-next-index'));
style.element.setAttribute('data-next-index', index + 1);
}
if (style.element.styleSheet) {
style.parts.push(code);
style.element.styleSheet.cssText = style.parts
.filter(Boolean)
.join('\n');
} else {
var textNode = document.createTextNode(code);
var nodes = style.element.childNodes;
if (nodes[index]) { style.element.removeChild(nodes[index]); }
if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); }
else { style.element.appendChild(textNode); }
}
}
}
}
/* style inject SSR */
var VueAnnouncer = __vue_normalize__(
__vue_template__,
__vue_inject_styles__,
typeof __vue_script__ === 'undefined' ? {} : __vue_script__,
__vue_scope_id__,
__vue_is_functional_template__,
__vue_module_identifier__,
typeof __vue_create_injector__ !== 'undefined' ? __vue_create_injector__ : function () {},
typeof __vue_create_injector_ssr__ !== 'undefined' ? __vue_create_injector_ssr__ : function () {}
)
var OPTIONS = {
complementRoute: 'has loaded'
};
function install (Vue, options, router) {
if ( options === void 0 ) options = {};
if ( router === void 0 ) router = null;
options = Object.assign({}, options, OPTIONS);
Vue.component('VueAnnouncer', VueAnnouncer);
Vue.prototype.$announcer = {
set: function set (message) {
var this$1 = this;
if (this.data) {
this.data.content = '';
Vue.nextTick()
.then(function () {
this$1.data.content = message;
});
}
},
data: null
};
// If set the router, will be announced the change of route
if (router) {
router.afterEach(function (to) {
Vue.prototype.$announcer.set(((to.meta.announcer || document.title.trim()) + " " + (options.complementRoute)));
});
}
}
// auto install
if (typeof window !== 'undefined' && typeof window.Vue !== 'undefined') {
window.Vue.use(install);
}
return install;
});
define(function(){'use strict';var a={name:'VueAnnouncer',data:function a(){return{content:''}},created:function a(){this.$announcer.data=this.$data}},b=a,c=function(){var a=this,b=a.$createElement,c=a._self._c||b;return c("div",{staticClass:"announcer",attrs:{id:"announcer","aria-live":"polite","aria-atomic":"true"},domProps:{textContent:a._s(a.content)}})},d=[];c._withStripped=!0;var e=typeof c!=='undefined'?{render:c,staticRenderFns:d}:{},f=function(a){if(!a){return}a("data-v-81147d56_0",{source:"\n.announcer[data-v-81147d56] {\r\n position: absolute;\r\n left: -10000px;\r\n top: auto;\r\n width: 1px;\r\n height: 1px;\r\n overflow: hidden;\n}\r\n",map:undefined,media:undefined})},g="data-v-81147d56",i=undefined,j=!1;function k(a,b,c,d,e,f,g,i){var j=c||{};{j.__file="D:\\Work\\Projetos\\Open-source\\Github\\Organization\\vue-a11y\\repositories\\vue-a11y-announcer\\src\\vue-announcer.vue"};j.render||(j.render=a.render,j.staticRenderFns=a.staticRenderFns,j._compiled=!0,e&&(j.functional=!0));j._scopeId=d;{var k;b&&(k=function(a){b.call(this,g(a))});if(k!==undefined){if(j.functional){var l=j.render;j.render=function c(a,b){k.call(b);return l(a,b)}}else{var m=j.beforeCreate;j.beforeCreate=m?[].concat(m,k):[k]}}};return j}function l(){var a=document.head||document.getElementsByTagName('head')[0],b=l.styles||(l.styles={}),c=typeof navigator!=='undefined'&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function f(d,e){if(document.querySelector('style[data-vue-ssr-id~="'+d+'"]')){return}var g=c?e.media||'default':d,h=b[g]||(b[g]={ids:[],parts:[],element:undefined});if(!h.ids.includes(d)){var i=e.source,j=h.ids.length;h.ids.push(d);c&&(h.element=h.element||document.querySelector('style[data-group='+g+']'));if(!h.element){var k=h.element=document.createElement('style');k.type='text/css';e.media&&k.setAttribute('media',e.media);c&&(k.setAttribute('data-group',g),k.setAttribute('data-next-index','0'));a.appendChild(k)}c&&(j=parseInt(h.element.getAttribute('data-next-index')),h.element.setAttribute('data-next-index',j+1));if(h.element.styleSheet)h.parts.push(i),h.element.styleSheet.cssText=h.parts.filter(Boolean).join('\n');else{var l=document.createTextNode(i),m=h.element.childNodes;m[j]&&h.element.removeChild(m[j]);m.length?h.element.insertBefore(l,m[j]):h.element.appendChild(l)}}}}var m=k(e,f,typeof b==='undefined'?{}:b,g,j,i,typeof l!=='undefined'?l:function(){},typeof __vue_create_injector_ssr__!=='undefined'?__vue_create_injector_ssr__:function(){}),n={complementRoute:'has loaded'};function o(a,b,c){b===void 0&&(b={});c===void 0&&(c=null);b=Object.assign({},b,n);a.component('VueAnnouncer',m);a.prototype.$announcer={set:function c(b){var d=this;this.data&&(this.data.content='',a.nextTick().then(function(){d.data.content=b}))},data:null};c&&c.afterEach(function(c){a.prototype.$announcer.set(((c.meta.announcer||document.title.trim())+" "+b.complementRoute))})}typeof window!=='undefined'&&typeof window.Vue!=='undefined'&&window.Vue.use(o);return o})

@@ -1,215 +0,1 @@

'use strict';
//
//
//
//
//
//
//
//
//
//
var script = {
name: 'VueAnnouncer',
data: function data () {
return {
content: ''
}
},
created: function created () {
this.$announcer.data = this.$data;
}
}
var __vue_script__ = script;
/* template */
var __vue_render__ = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c("div", {
staticClass: "announcer",
attrs: { id: "announcer", "aria-live": "polite", "aria-atomic": "true" },
domProps: { textContent: _vm._s(_vm.content) }
})
};
var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;
var __vue_template__ = typeof __vue_render__ !== 'undefined'
? { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }
: {};
/* style */
var __vue_inject_styles__ = function (inject) {
if (!inject) { return }
inject("data-v-81147d56_0", { source: "\n.announcer[data-v-81147d56] {\r\n position: absolute;\r\n left: -10000px;\r\n top: auto;\r\n width: 1px;\r\n height: 1px;\r\n overflow: hidden;\n}\r\n", map: undefined, media: undefined });
};
/* scoped */
var __vue_scope_id__ = "data-v-81147d56";
/* module identifier */
var __vue_module_identifier__ = undefined;
/* functional template */
var __vue_is_functional_template__ = false;
/* component normalizer */
function __vue_normalize__(
template, style, script$$1,
scope, functional, moduleIdentifier,
createInjector, createInjectorSSR
) {
var component = script$$1 || {};
{
component.__file = "D:\\Work\\Projetos\\Open-source\\Github\\Organization\\vue-a11y\\repositories\\vue-a11y-announcer\\src\\vue-announcer.vue";
}
if (!component.render) {
component.render = template.render;
component.staticRenderFns = template.staticRenderFns;
component._compiled = true;
if (functional) { component.functional = true; }
}
component._scopeId = scope;
{
var hook;
if (style) {
hook = function(context) {
style.call(this, createInjector(context));
};
}
if (hook !== undefined) {
if (component.functional) {
// register for functional component in vue file
var originalRender = component.render;
component.render = function renderWithStyleInjection(h, context) {
hook.call(context);
return originalRender(h, context)
};
} else {
// inject component registration as beforeCreate hook
var existing = component.beforeCreate;
component.beforeCreate = existing ? [].concat(existing, hook) : [hook];
}
}
}
return component
}
/* style inject */
function __vue_create_injector__() {
var head = document.head || document.getElementsByTagName('head')[0];
var styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {});
var isOldIE =
typeof navigator !== 'undefined' &&
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
return function addStyle(id, css) {
if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present.
var group = isOldIE ? css.media || 'default' : id;
var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined });
if (!style.ids.includes(id)) {
var code = css.source;
var index = style.ids.length;
style.ids.push(id);
if (isOldIE) {
style.element = style.element || document.querySelector('style[data-group=' + group + ']');
}
if (!style.element) {
var el = style.element = document.createElement('style');
el.type = 'text/css';
if (css.media) { el.setAttribute('media', css.media); }
if (isOldIE) {
el.setAttribute('data-group', group);
el.setAttribute('data-next-index', '0');
}
head.appendChild(el);
}
if (isOldIE) {
index = parseInt(style.element.getAttribute('data-next-index'));
style.element.setAttribute('data-next-index', index + 1);
}
if (style.element.styleSheet) {
style.parts.push(code);
style.element.styleSheet.cssText = style.parts
.filter(Boolean)
.join('\n');
} else {
var textNode = document.createTextNode(code);
var nodes = style.element.childNodes;
if (nodes[index]) { style.element.removeChild(nodes[index]); }
if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); }
else { style.element.appendChild(textNode); }
}
}
}
}
/* style inject SSR */
var VueAnnouncer = __vue_normalize__(
__vue_template__,
__vue_inject_styles__,
typeof __vue_script__ === 'undefined' ? {} : __vue_script__,
__vue_scope_id__,
__vue_is_functional_template__,
__vue_module_identifier__,
typeof __vue_create_injector__ !== 'undefined' ? __vue_create_injector__ : function () {},
typeof __vue_create_injector_ssr__ !== 'undefined' ? __vue_create_injector_ssr__ : function () {}
)
var OPTIONS = {
complementRoute: 'has loaded'
};
function install (Vue, options, router) {
if ( options === void 0 ) options = {};
if ( router === void 0 ) router = null;
options = Object.assign({}, options, OPTIONS);
Vue.component('VueAnnouncer', VueAnnouncer);
Vue.prototype.$announcer = {
set: function set (message) {
var this$1 = this;
if (this.data) {
this.data.content = '';
Vue.nextTick()
.then(function () {
this$1.data.content = message;
});
}
},
data: null
};
// If set the router, will be announced the change of route
if (router) {
router.afterEach(function (to) {
Vue.prototype.$announcer.set(((to.meta.announcer || document.title.trim()) + " " + (options.complementRoute)));
});
}
}
// auto install
if (typeof window !== 'undefined' && typeof window.Vue !== 'undefined') {
window.Vue.use(install);
}
module.exports = install;
'use strict';var script={name:'VueAnnouncer',data:function a(){return{content:''}},created:function a(){this.$announcer.data=this.$data}},__vue_script__=script,__vue_render__=function(){var a=this,b=a.$createElement,c=a._self._c||b;return c("div",{staticClass:"announcer",attrs:{id:"announcer","aria-live":"polite","aria-atomic":"true"},domProps:{textContent:a._s(a.content)}})},__vue_staticRenderFns__=[];__vue_render__._withStripped=!0;var __vue_template__=typeof __vue_render__!=='undefined'?{render:__vue_render__,staticRenderFns:__vue_staticRenderFns__}:{},__vue_inject_styles__=function(a){if(!a){return}a("data-v-81147d56_0",{source:"\n.announcer[data-v-81147d56] {\r\n position: absolute;\r\n left: -10000px;\r\n top: auto;\r\n width: 1px;\r\n height: 1px;\r\n overflow: hidden;\n}\r\n",map:undefined,media:undefined})},__vue_scope_id__="data-v-81147d56",__vue_module_identifier__=undefined,__vue_is_functional_template__=!1;function __vue_normalize__(a,b,c,d,e,f,g,i){var j=c||{};{j.__file="D:\\Work\\Projetos\\Open-source\\Github\\Organization\\vue-a11y\\repositories\\vue-a11y-announcer\\src\\vue-announcer.vue"};j.render||(j.render=a.render,j.staticRenderFns=a.staticRenderFns,j._compiled=!0,e&&(j.functional=!0));j._scopeId=d;{var k;b&&(k=function(a){b.call(this,g(a))});if(k!==undefined){if(j.functional){var l=j.render;j.render=function c(a,b){k.call(b);return l(a,b)}}else{var m=j.beforeCreate;j.beforeCreate=m?[].concat(m,k):[k]}}};return j}function __vue_create_injector__(){var a=document.head||document.getElementsByTagName('head')[0],b=__vue_create_injector__.styles||(__vue_create_injector__.styles={}),c=typeof navigator!=='undefined'&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function f(d,e){if(document.querySelector('style[data-vue-ssr-id~="'+d+'"]')){return}var g=c?e.media||'default':d,h=b[g]||(b[g]={ids:[],parts:[],element:undefined});if(!h.ids.includes(d)){var i=e.source,j=h.ids.length;h.ids.push(d);c&&(h.element=h.element||document.querySelector('style[data-group='+g+']'));if(!h.element){var k=h.element=document.createElement('style');k.type='text/css';e.media&&k.setAttribute('media',e.media);c&&(k.setAttribute('data-group',g),k.setAttribute('data-next-index','0'));a.appendChild(k)}c&&(j=parseInt(h.element.getAttribute('data-next-index')),h.element.setAttribute('data-next-index',j+1));if(h.element.styleSheet)h.parts.push(i),h.element.styleSheet.cssText=h.parts.filter(Boolean).join('\n');else{var l=document.createTextNode(i),m=h.element.childNodes;m[j]&&h.element.removeChild(m[j]);m.length?h.element.insertBefore(l,m[j]):h.element.appendChild(l)}}}}var VueAnnouncer=__vue_normalize__(__vue_template__,__vue_inject_styles__,typeof __vue_script__==='undefined'?{}:__vue_script__,__vue_scope_id__,__vue_is_functional_template__,__vue_module_identifier__,typeof __vue_create_injector__!=='undefined'?__vue_create_injector__:function(){},typeof __vue_create_injector_ssr__!=='undefined'?__vue_create_injector_ssr__:function(){}),OPTIONS={complementRoute:'has loaded'};function install(a,b,c){b===void 0&&(b={});c===void 0&&(c=null);b=Object.assign({},b,OPTIONS);a.component('VueAnnouncer',VueAnnouncer);a.prototype.$announcer={set:function c(b){var d=this;this.data&&(this.data.content='',a.nextTick().then(function(){d.data.content=b}))},data:null};c&&c.afterEach(function(c){a.prototype.$announcer.set(((c.meta.announcer||document.title.trim())+" "+b.complementRoute))})}typeof window!=='undefined'&&typeof window.Vue!=='undefined'&&window.Vue.use(install);module.exports=install

@@ -1,213 +0,1 @@

//
//
//
//
//
//
//
//
//
//
var script = {
name: 'VueAnnouncer',
data: function data () {
return {
content: ''
}
},
created: function created () {
this.$announcer.data = this.$data;
}
}
var __vue_script__ = script;
/* template */
var __vue_render__ = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c("div", {
staticClass: "announcer",
attrs: { id: "announcer", "aria-live": "polite", "aria-atomic": "true" },
domProps: { textContent: _vm._s(_vm.content) }
})
};
var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;
var __vue_template__ = typeof __vue_render__ !== 'undefined'
? { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }
: {};
/* style */
var __vue_inject_styles__ = function (inject) {
if (!inject) { return }
inject("data-v-81147d56_0", { source: "\n.announcer[data-v-81147d56] {\r\n position: absolute;\r\n left: -10000px;\r\n top: auto;\r\n width: 1px;\r\n height: 1px;\r\n overflow: hidden;\n}\r\n", map: undefined, media: undefined });
};
/* scoped */
var __vue_scope_id__ = "data-v-81147d56";
/* module identifier */
var __vue_module_identifier__ = undefined;
/* functional template */
var __vue_is_functional_template__ = false;
/* component normalizer */
function __vue_normalize__(
template, style, script$$1,
scope, functional, moduleIdentifier,
createInjector, createInjectorSSR
) {
var component = script$$1 || {};
{
component.__file = "D:\\Work\\Projetos\\Open-source\\Github\\Organization\\vue-a11y\\repositories\\vue-a11y-announcer\\src\\vue-announcer.vue";
}
if (!component.render) {
component.render = template.render;
component.staticRenderFns = template.staticRenderFns;
component._compiled = true;
if (functional) { component.functional = true; }
}
component._scopeId = scope;
{
var hook;
if (style) {
hook = function(context) {
style.call(this, createInjector(context));
};
}
if (hook !== undefined) {
if (component.functional) {
// register for functional component in vue file
var originalRender = component.render;
component.render = function renderWithStyleInjection(h, context) {
hook.call(context);
return originalRender(h, context)
};
} else {
// inject component registration as beforeCreate hook
var existing = component.beforeCreate;
component.beforeCreate = existing ? [].concat(existing, hook) : [hook];
}
}
}
return component
}
/* style inject */
function __vue_create_injector__() {
var head = document.head || document.getElementsByTagName('head')[0];
var styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {});
var isOldIE =
typeof navigator !== 'undefined' &&
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
return function addStyle(id, css) {
if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present.
var group = isOldIE ? css.media || 'default' : id;
var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined });
if (!style.ids.includes(id)) {
var code = css.source;
var index = style.ids.length;
style.ids.push(id);
if (isOldIE) {
style.element = style.element || document.querySelector('style[data-group=' + group + ']');
}
if (!style.element) {
var el = style.element = document.createElement('style');
el.type = 'text/css';
if (css.media) { el.setAttribute('media', css.media); }
if (isOldIE) {
el.setAttribute('data-group', group);
el.setAttribute('data-next-index', '0');
}
head.appendChild(el);
}
if (isOldIE) {
index = parseInt(style.element.getAttribute('data-next-index'));
style.element.setAttribute('data-next-index', index + 1);
}
if (style.element.styleSheet) {
style.parts.push(code);
style.element.styleSheet.cssText = style.parts
.filter(Boolean)
.join('\n');
} else {
var textNode = document.createTextNode(code);
var nodes = style.element.childNodes;
if (nodes[index]) { style.element.removeChild(nodes[index]); }
if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); }
else { style.element.appendChild(textNode); }
}
}
}
}
/* style inject SSR */
var VueAnnouncer = __vue_normalize__(
__vue_template__,
__vue_inject_styles__,
typeof __vue_script__ === 'undefined' ? {} : __vue_script__,
__vue_scope_id__,
__vue_is_functional_template__,
__vue_module_identifier__,
typeof __vue_create_injector__ !== 'undefined' ? __vue_create_injector__ : function () {},
typeof __vue_create_injector_ssr__ !== 'undefined' ? __vue_create_injector_ssr__ : function () {}
)
var OPTIONS = {
complementRoute: 'has loaded'
};
function install (Vue, options, router) {
if ( options === void 0 ) options = {};
if ( router === void 0 ) router = null;
options = Object.assign({}, options, OPTIONS);
Vue.component('VueAnnouncer', VueAnnouncer);
Vue.prototype.$announcer = {
set: function set (message) {
var this$1 = this;
if (this.data) {
this.data.content = '';
Vue.nextTick()
.then(function () {
this$1.data.content = message;
});
}
},
data: null
};
// If set the router, will be announced the change of route
if (router) {
router.afterEach(function (to) {
Vue.prototype.$announcer.set(((to.meta.announcer || document.title.trim()) + " " + (options.complementRoute)));
});
}
}
// auto install
if (typeof window !== 'undefined' && typeof window.Vue !== 'undefined') {
window.Vue.use(install);
}
export default install;
var script={name:'VueAnnouncer',data:function a(){return{content:''}},created:function a(){this.$announcer.data=this.$data}},__vue_script__=script,__vue_render__=function(){var a=this,b=a.$createElement,c=a._self._c||b;return c("div",{staticClass:"announcer",attrs:{id:"announcer","aria-live":"polite","aria-atomic":"true"},domProps:{textContent:a._s(a.content)}})},__vue_staticRenderFns__=[];__vue_render__._withStripped=!0;var __vue_template__=typeof __vue_render__!=='undefined'?{render:__vue_render__,staticRenderFns:__vue_staticRenderFns__}:{},__vue_inject_styles__=function(a){if(!a){return}a("data-v-81147d56_0",{source:"\n.announcer[data-v-81147d56] {\r\n position: absolute;\r\n left: -10000px;\r\n top: auto;\r\n width: 1px;\r\n height: 1px;\r\n overflow: hidden;\n}\r\n",map:undefined,media:undefined})},__vue_scope_id__="data-v-81147d56",__vue_module_identifier__=undefined,__vue_is_functional_template__=!1;function __vue_normalize__(a,b,c,d,e,f,g,i){var j=c||{};{j.__file="D:\\Work\\Projetos\\Open-source\\Github\\Organization\\vue-a11y\\repositories\\vue-a11y-announcer\\src\\vue-announcer.vue"};j.render||(j.render=a.render,j.staticRenderFns=a.staticRenderFns,j._compiled=!0,e&&(j.functional=!0));j._scopeId=d;{var k;b&&(k=function(a){b.call(this,g(a))});if(k!==undefined){if(j.functional){var l=j.render;j.render=function c(a,b){k.call(b);return l(a,b)}}else{var m=j.beforeCreate;j.beforeCreate=m?[].concat(m,k):[k]}}};return j}function __vue_create_injector__(){var a=document.head||document.getElementsByTagName('head')[0],b=__vue_create_injector__.styles||(__vue_create_injector__.styles={}),c=typeof navigator!=='undefined'&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function f(d,e){if(document.querySelector('style[data-vue-ssr-id~="'+d+'"]')){return}var g=c?e.media||'default':d,h=b[g]||(b[g]={ids:[],parts:[],element:undefined});if(!h.ids.includes(d)){var i=e.source,j=h.ids.length;h.ids.push(d);c&&(h.element=h.element||document.querySelector('style[data-group='+g+']'));if(!h.element){var k=h.element=document.createElement('style');k.type='text/css';e.media&&k.setAttribute('media',e.media);c&&(k.setAttribute('data-group',g),k.setAttribute('data-next-index','0'));a.appendChild(k)}c&&(j=parseInt(h.element.getAttribute('data-next-index')),h.element.setAttribute('data-next-index',j+1));if(h.element.styleSheet)h.parts.push(i),h.element.styleSheet.cssText=h.parts.filter(Boolean).join('\n');else{var l=document.createTextNode(i),m=h.element.childNodes;m[j]&&h.element.removeChild(m[j]);m.length?h.element.insertBefore(l,m[j]):h.element.appendChild(l)}}}}var VueAnnouncer=__vue_normalize__(__vue_template__,__vue_inject_styles__,typeof __vue_script__==='undefined'?{}:__vue_script__,__vue_scope_id__,__vue_is_functional_template__,__vue_module_identifier__,typeof __vue_create_injector__!=='undefined'?__vue_create_injector__:function(){},typeof __vue_create_injector_ssr__!=='undefined'?__vue_create_injector_ssr__:function(){}),OPTIONS={complementRoute:'has loaded'};function install(a,b,c){b===void 0&&(b={});c===void 0&&(c=null);b=Object.assign({},b,OPTIONS);a.component('VueAnnouncer',VueAnnouncer);a.prototype.$announcer={set:function c(b){var d=this;this.data&&(this.data.content='',a.nextTick().then(function(){d.data.content=b}))},data:null};c&&c.afterEach(function(c){a.prototype.$announcer.set(((c.meta.announcer||document.title.trim())+" "+b.complementRoute))})}typeof window!=='undefined'&&typeof window.Vue!=='undefined'&&window.Vue.use(install);export default install

@@ -1,221 +0,1 @@

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.VueAnnouncer = factory());
}(this, (function () { 'use strict';
//
//
//
//
//
//
//
//
//
//
var script = {
name: 'VueAnnouncer',
data: function data () {
return {
content: ''
}
},
created: function created () {
this.$announcer.data = this.$data;
}
}
var __vue_script__ = script;
/* template */
var __vue_render__ = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c("div", {
staticClass: "announcer",
attrs: { id: "announcer", "aria-live": "polite", "aria-atomic": "true" },
domProps: { textContent: _vm._s(_vm.content) }
})
};
var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;
var __vue_template__ = typeof __vue_render__ !== 'undefined'
? { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }
: {};
/* style */
var __vue_inject_styles__ = function (inject) {
if (!inject) { return }
inject("data-v-81147d56_0", { source: "\n.announcer[data-v-81147d56] {\r\n position: absolute;\r\n left: -10000px;\r\n top: auto;\r\n width: 1px;\r\n height: 1px;\r\n overflow: hidden;\n}\r\n", map: undefined, media: undefined });
};
/* scoped */
var __vue_scope_id__ = "data-v-81147d56";
/* module identifier */
var __vue_module_identifier__ = undefined;
/* functional template */
var __vue_is_functional_template__ = false;
/* component normalizer */
function __vue_normalize__(
template, style, script$$1,
scope, functional, moduleIdentifier,
createInjector, createInjectorSSR
) {
var component = script$$1 || {};
{
component.__file = "D:\\Work\\Projetos\\Open-source\\Github\\Organization\\vue-a11y\\repositories\\vue-a11y-announcer\\src\\vue-announcer.vue";
}
if (!component.render) {
component.render = template.render;
component.staticRenderFns = template.staticRenderFns;
component._compiled = true;
if (functional) { component.functional = true; }
}
component._scopeId = scope;
{
var hook;
if (style) {
hook = function(context) {
style.call(this, createInjector(context));
};
}
if (hook !== undefined) {
if (component.functional) {
// register for functional component in vue file
var originalRender = component.render;
component.render = function renderWithStyleInjection(h, context) {
hook.call(context);
return originalRender(h, context)
};
} else {
// inject component registration as beforeCreate hook
var existing = component.beforeCreate;
component.beforeCreate = existing ? [].concat(existing, hook) : [hook];
}
}
}
return component
}
/* style inject */
function __vue_create_injector__() {
var head = document.head || document.getElementsByTagName('head')[0];
var styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {});
var isOldIE =
typeof navigator !== 'undefined' &&
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
return function addStyle(id, css) {
if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present.
var group = isOldIE ? css.media || 'default' : id;
var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined });
if (!style.ids.includes(id)) {
var code = css.source;
var index = style.ids.length;
style.ids.push(id);
if (isOldIE) {
style.element = style.element || document.querySelector('style[data-group=' + group + ']');
}
if (!style.element) {
var el = style.element = document.createElement('style');
el.type = 'text/css';
if (css.media) { el.setAttribute('media', css.media); }
if (isOldIE) {
el.setAttribute('data-group', group);
el.setAttribute('data-next-index', '0');
}
head.appendChild(el);
}
if (isOldIE) {
index = parseInt(style.element.getAttribute('data-next-index'));
style.element.setAttribute('data-next-index', index + 1);
}
if (style.element.styleSheet) {
style.parts.push(code);
style.element.styleSheet.cssText = style.parts
.filter(Boolean)
.join('\n');
} else {
var textNode = document.createTextNode(code);
var nodes = style.element.childNodes;
if (nodes[index]) { style.element.removeChild(nodes[index]); }
if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); }
else { style.element.appendChild(textNode); }
}
}
}
}
/* style inject SSR */
var VueAnnouncer = __vue_normalize__(
__vue_template__,
__vue_inject_styles__,
typeof __vue_script__ === 'undefined' ? {} : __vue_script__,
__vue_scope_id__,
__vue_is_functional_template__,
__vue_module_identifier__,
typeof __vue_create_injector__ !== 'undefined' ? __vue_create_injector__ : function () {},
typeof __vue_create_injector_ssr__ !== 'undefined' ? __vue_create_injector_ssr__ : function () {}
)
var OPTIONS = {
complementRoute: 'has loaded'
};
function install (Vue, options, router) {
if ( options === void 0 ) options = {};
if ( router === void 0 ) router = null;
options = Object.assign({}, options, OPTIONS);
Vue.component('VueAnnouncer', VueAnnouncer);
Vue.prototype.$announcer = {
set: function set (message) {
var this$1 = this;
if (this.data) {
this.data.content = '';
Vue.nextTick()
.then(function () {
this$1.data.content = message;
});
}
},
data: null
};
// If set the router, will be announced the change of route
if (router) {
router.afterEach(function (to) {
Vue.prototype.$announcer.set(((to.meta.announcer || document.title.trim()) + " " + (options.complementRoute)));
});
}
}
// auto install
if (typeof window !== 'undefined' && typeof window.Vue !== 'undefined') {
window.Vue.use(install);
}
return install;
})));
!function(a,b){typeof exports==='object'&&typeof module!=='undefined'?module.exports=b():typeof define==='function'&&define.amd?define(b):(a.VueAnnouncer=b())}(this,(function(){'use strict';var a={name:'VueAnnouncer',data:function a(){return{content:''}},created:function a(){this.$announcer.data=this.$data}},b=a,c=function(){var a=this,b=a.$createElement,c=a._self._c||b;return c("div",{staticClass:"announcer",attrs:{id:"announcer","aria-live":"polite","aria-atomic":"true"},domProps:{textContent:a._s(a.content)}})},d=[];c._withStripped=!0;var e=typeof c!=='undefined'?{render:c,staticRenderFns:d}:{},f=function(a){if(!a){return}a("data-v-81147d56_0",{source:"\n.announcer[data-v-81147d56] {\r\n position: absolute;\r\n left: -10000px;\r\n top: auto;\r\n width: 1px;\r\n height: 1px;\r\n overflow: hidden;\n}\r\n",map:undefined,media:undefined})},g="data-v-81147d56",i=undefined,j=!1;function k(a,b,c,d,e,f,g,i){var j=c||{};{j.__file="D:\\Work\\Projetos\\Open-source\\Github\\Organization\\vue-a11y\\repositories\\vue-a11y-announcer\\src\\vue-announcer.vue"};j.render||(j.render=a.render,j.staticRenderFns=a.staticRenderFns,j._compiled=!0,e&&(j.functional=!0));j._scopeId=d;{var k;b&&(k=function(a){b.call(this,g(a))});if(k!==undefined){if(j.functional){var l=j.render;j.render=function c(a,b){k.call(b);return l(a,b)}}else{var m=j.beforeCreate;j.beforeCreate=m?[].concat(m,k):[k]}}};return j}function l(){var a=document.head||document.getElementsByTagName('head')[0],b=l.styles||(l.styles={}),c=typeof navigator!=='undefined'&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function f(d,e){if(document.querySelector('style[data-vue-ssr-id~="'+d+'"]')){return}var g=c?e.media||'default':d,h=b[g]||(b[g]={ids:[],parts:[],element:undefined});if(!h.ids.includes(d)){var i=e.source,j=h.ids.length;h.ids.push(d);c&&(h.element=h.element||document.querySelector('style[data-group='+g+']'));if(!h.element){var k=h.element=document.createElement('style');k.type='text/css';e.media&&k.setAttribute('media',e.media);c&&(k.setAttribute('data-group',g),k.setAttribute('data-next-index','0'));a.appendChild(k)}c&&(j=parseInt(h.element.getAttribute('data-next-index')),h.element.setAttribute('data-next-index',j+1));if(h.element.styleSheet)h.parts.push(i),h.element.styleSheet.cssText=h.parts.filter(Boolean).join('\n');else{var l=document.createTextNode(i),m=h.element.childNodes;m[j]&&h.element.removeChild(m[j]);m.length?h.element.insertBefore(l,m[j]):h.element.appendChild(l)}}}}var m=k(e,f,typeof b==='undefined'?{}:b,g,j,i,typeof l!=='undefined'?l:function(){},typeof __vue_create_injector_ssr__!=='undefined'?__vue_create_injector_ssr__:function(){}),n={complementRoute:'has loaded'};function o(a,b,c){b===void 0&&(b={});c===void 0&&(c=null);b=Object.assign({},b,n);a.component('VueAnnouncer',m);a.prototype.$announcer={set:function c(b){var d=this;this.data&&(this.data.content='',a.nextTick().then(function(){d.data.content=b}))},data:null};c&&c.afterEach(function(c){a.prototype.$announcer.set(((c.meta.announcer||document.title.trim())+" "+b.complementRoute))})}typeof window!=='undefined'&&typeof window.Vue!=='undefined'&&window.Vue.use(o);return o}))
{
"name": "vue-announcer",
"version": "0.1.2",
"version": "1.0.0",
"description": "A simple way with Vue to announce any information to the screen readers.",

@@ -66,6 +66,3 @@ "main": "dist/vue-announcer.js",

"vue-template-compiler": "^2.5.16"
},
"dependencies": {
"rollup-plugin-commonjs": "^9.1.3"
}
}
import resolve from 'rollup-plugin-node-resolve'
import replace from 'rollup-plugin-replace'
import VueLoader from 'rollup-plugin-vue'
import babel from 'rollup-plugin-babel'
import buble from 'rollup-plugin-buble'
import eslint from 'rollup-plugin-eslint'
import commonJs from 'rollup-plugin-commonjs'
import chokidar from 'chokidar'

@@ -16,15 +15,17 @@

plugins: [
babel({
include: [
'node_modules/vue-template-es2015-compiler'
]
}),
eslint({
include: './src/**'
}),
resolve(),
commonJs(),
VueLoader({
compileTemplate: true
}),
buble({
objectAssign: 'Object.assign',
jsx: 'h'
}),
resolve({
jsnext: true,
main: true,
browser: true
}),
replace({

@@ -31,0 +32,0 @@ 'process.env.NODE_ENV': JSON.stringify('development')

import resolve from 'rollup-plugin-node-resolve'
import replace from 'rollup-plugin-replace'
import VueLoader from 'rollup-plugin-vue'
import commonJs from 'rollup-plugin-commonjs'
import butternut from 'rollup-plugin-butternut'
import babel from 'rollup-plugin-babel'
import buble from 'rollup-plugin-buble'

@@ -11,13 +10,15 @@ export default {

plugins: [
babel({
include: [
'node_modules/vue-template-es2015-compiler'
]
}),
butternut(),
resolve(),
commonJs(),
VueLoader({
compileTemplate: true
}),
buble({
objectAssign: 'Object.assign',
jsx: 'h'
}),
butternut(),
resolve({
jsnext: true,
main: true,
browser: true
}),
replace({

@@ -24,0 +25,0 @@ 'process.env.NODE_ENV': JSON.stringify('production')

Sorry, the diff of this file is not supported yet