docs-renderer-vue2
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -97,3 +97,3 @@ module.exports = | ||
// CONCATENATED MODULE: /mnt/c/Users/Dan Jutan/WebstormProjects/docs-cms/node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js | ||
// CONCATENATED MODULE: /Users/danjutan/WebstormProjects/docs-cms/node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js | ||
// This file is imported into lib/wc client bundles. | ||
@@ -122,3 +122,3 @@ | ||
// CONCATENATED MODULE: /mnt/c/Users/Dan Jutan/WebstormProjects/docs-cms/node_modules/tslib/tslib.es6.js | ||
// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.js | ||
/*! ***************************************************************************** | ||
@@ -347,7 +347,210 @@ Copyright (c) Microsoft Corporation. | ||
// CONCATENATED MODULE: /Users/danjutan/WebstormProjects/docs-cms/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b1c526a2-vue-loader-template"}!/Users/danjutan/WebstormProjects/docs-cms/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!/Users/danjutan/WebstormProjects/docs-cms/node_modules/cache-loader/dist/cjs.js??ref--0-0!/Users/danjutan/WebstormProjects/docs-cms/node_modules/vue-loader/lib??vue-loader-options!./src/components/DefaultTable.vue?vue&type=template&id=5a72f336& | ||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"doc-table-root",style:(_vm.rootStyles)},_vm._l((_vm.tableData.cells),function(_,i){return _c('div',{staticClass:"doc-table-cell",style:(_vm.cellStyles(i))},[_vm._t(("cell:" + i))],2)}),0)} | ||
var staticRenderFns = [] | ||
// CONCATENATED MODULE: ./src/components/DefaultTable.vue?vue&type=template&id=5a72f336& | ||
// CONCATENATED MODULE: /Users/danjutan/WebstormProjects/docs-cms/node_modules/cache-loader/dist/cjs.js??ref--0-0!/Users/danjutan/WebstormProjects/docs-cms/node_modules/vue-loader/lib??vue-loader-options!./src/components/DefaultTable.vue?vue&type=script&lang=js& | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
/* harmony default export */ var DefaultTablevue_type_script_lang_js_ = ({ | ||
name: "DefaultTable", | ||
props: { | ||
tableData: { | ||
type: Object, | ||
required: true, | ||
} | ||
}, | ||
computed: { | ||
numRows() { | ||
return this.tableData.rows.length; | ||
}, | ||
numColumns() { | ||
return this.tableData.rows[0].length; | ||
}, | ||
rootStyles() { | ||
const gridTemplateAreas = this.tableData.rows.map(row => | ||
`"${row | ||
.map(i => `area${i}`) | ||
.join(" ")}"`) | ||
.join(" "); | ||
return { | ||
display: "grid", | ||
gridTemplateAreas | ||
} | ||
}, | ||
cellSpans() { | ||
const spans = {} | ||
for (let y = 0; y < this.numRows; y++) { | ||
const row = this.tableData.rows[y]; | ||
for (let x = 0; x < this.numColumns; x++) { | ||
if (row[x] > -1) { | ||
if (row[x] in spans) { | ||
const span = spans[row[x]]; | ||
span.rowEnd = y; | ||
span.rowStart = y; | ||
} else { | ||
spans[row[x]] = { | ||
rowStart: y, | ||
colStart: x, | ||
rowEnd: y, | ||
colEnd: x | ||
} | ||
} | ||
} | ||
} | ||
} | ||
return spans; | ||
} | ||
}, | ||
methods: { | ||
cellStyles(index) { | ||
return { | ||
gridArea: `area${index}` | ||
} | ||
} | ||
}, | ||
mounted() { | ||
console.log("table mounted") | ||
} | ||
}); | ||
// CONCATENATED MODULE: ./src/components/DefaultTable.vue?vue&type=script&lang=js& | ||
/* harmony default export */ var components_DefaultTablevue_type_script_lang_js_ = (DefaultTablevue_type_script_lang_js_); | ||
// CONCATENATED MODULE: /Users/danjutan/WebstormProjects/docs-cms/node_modules/vue-loader/lib/runtime/componentNormalizer.js | ||
/* globals __VUE_SSR_CONTEXT__ */ | ||
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules). | ||
// This module is a runtime utility for cleaner component module output and will | ||
// be included in the final webpack user bundle. | ||
function normalizeComponent ( | ||
scriptExports, | ||
render, | ||
staticRenderFns, | ||
functionalTemplate, | ||
injectStyles, | ||
scopeId, | ||
moduleIdentifier, /* server only */ | ||
shadowMode /* vue-cli only */ | ||
) { | ||
// Vue.extend constructor export interop | ||
var options = typeof scriptExports === 'function' | ||
? scriptExports.options | ||
: scriptExports | ||
// render functions | ||
if (render) { | ||
options.render = render | ||
options.staticRenderFns = staticRenderFns | ||
options._compiled = true | ||
} | ||
// functional template | ||
if (functionalTemplate) { | ||
options.functional = true | ||
} | ||
// scopedId | ||
if (scopeId) { | ||
options._scopeId = 'data-v-' + scopeId | ||
} | ||
var hook | ||
if (moduleIdentifier) { // server build | ||
hook = function (context) { | ||
// 2.3 injection | ||
context = | ||
context || // cached call | ||
(this.$vnode && this.$vnode.ssrContext) || // stateful | ||
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional | ||
// 2.2 with runInNewContext: true | ||
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { | ||
context = __VUE_SSR_CONTEXT__ | ||
} | ||
// inject component styles | ||
if (injectStyles) { | ||
injectStyles.call(this, context) | ||
} | ||
// register component module identifier for async chunk inferrence | ||
if (context && context._registeredComponents) { | ||
context._registeredComponents.add(moduleIdentifier) | ||
} | ||
} | ||
// used by ssr in case component is cached and beforeCreate | ||
// never gets called | ||
options._ssrRegister = hook | ||
} else if (injectStyles) { | ||
hook = shadowMode | ||
? function () { | ||
injectStyles.call( | ||
this, | ||
(options.functional ? this.parent : this).$root.$options.shadowRoot | ||
) | ||
} | ||
: injectStyles | ||
} | ||
if (hook) { | ||
if (options.functional) { | ||
// for template-only hot-reload because in that case the render fn doesn't | ||
// go through the normalizer | ||
options._injectStyles = hook | ||
// register for functional component in vue file | ||
var originalRender = options.render | ||
options.render = function renderWithStyleInjection (h, context) { | ||
hook.call(context) | ||
return originalRender(h, context) | ||
} | ||
} else { | ||
// inject component registration as beforeCreate hook | ||
var existing = options.beforeCreate | ||
options.beforeCreate = existing | ||
? [].concat(existing, hook) | ||
: [hook] | ||
} | ||
} | ||
return { | ||
exports: scriptExports, | ||
options: options | ||
} | ||
} | ||
// CONCATENATED MODULE: ./src/components/DefaultTable.vue | ||
/* normalize component */ | ||
var component = normalizeComponent( | ||
components_DefaultTablevue_type_script_lang_js_, | ||
render, | ||
staticRenderFns, | ||
false, | ||
null, | ||
null, | ||
null | ||
) | ||
/* harmony default export */ var DefaultTable = (component.exports); | ||
// CONCATENATED MODULE: ./src/components/Renderer.ts | ||
/* harmony default export */ var Renderer = (external_commonjs_vue_commonjs2_vue_root_Vue_default.a.extend({ | ||
functional: true, | ||
name: "Renderer", | ||
props: { | ||
@@ -363,9 +566,9 @@ content: { | ||
}, | ||
tableComponent: { | ||
type: [Object, Boolean], | ||
default: function () { return (DefaultTable); } | ||
}, | ||
inlineSlotFormat: { | ||
type: RegExp, | ||
default: function () { return (/\[\^(\d*[a-zA-z]+\d*)\](?:(.+)\[\/\1\])*/g); } | ||
}, | ||
ignoreCss: { | ||
type: Array, | ||
default: function () { return ([]); } | ||
} | ||
@@ -421,9 +624,3 @@ }, | ||
if ("element" in data) { | ||
var nodeData = __assign({}, (data.attrs && { attrs: data.attrs })); | ||
if (data.style) { | ||
nodeData.style = Object.fromEntries(Object.entries(data.style).filter(function (_a) { | ||
var _b = __read(_a, 1), key = _b[0]; | ||
return !(context.props.ignoreCss.includes(key)); | ||
})); | ||
} | ||
var nodeData = __assign(__assign({}, (data.style && { style: data.style })), (data.attrs && { attrs: data.attrs })); | ||
return h(data.element, nodeData, fromContentArray(data.children)); | ||
@@ -454,2 +651,13 @@ } | ||
} | ||
if ("rows" in data) { | ||
if (typeof context.props.tableComponent == "object") { | ||
var slotsEntries = data.cells.map(function (contentData, index) { return ["cell:" + index, function () { return fromContentArray(contentData); }]; }); | ||
return h(context.props.tableComponent, { | ||
props: { | ||
tableData: data | ||
}, | ||
scopedSlots: Object.fromEntries(slotsEntries) | ||
}); | ||
} | ||
} | ||
return false; | ||
@@ -460,7 +668,7 @@ } | ||
} | ||
return h("div", context.data, fromContentArray(context.props.content)); | ||
return h("div", fromContentArray(context.props.content)); | ||
} | ||
})); | ||
// CONCATENATED MODULE: /mnt/c/Users/Dan Jutan/WebstormProjects/docs-cms/node_modules/@vue/cli-service/lib/commands/build/entry-lib.js | ||
// CONCATENATED MODULE: /Users/danjutan/WebstormProjects/docs-cms/node_modules/@vue/cli-service/lib/commands/build/entry-lib.js | ||
@@ -467,0 +675,0 @@ |
@@ -106,3 +106,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
// CONCATENATED MODULE: /mnt/c/Users/Dan Jutan/WebstormProjects/docs-cms/node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js | ||
// CONCATENATED MODULE: /Users/danjutan/WebstormProjects/docs-cms/node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js | ||
// This file is imported into lib/wc client bundles. | ||
@@ -131,3 +131,3 @@ | ||
// CONCATENATED MODULE: /mnt/c/Users/Dan Jutan/WebstormProjects/docs-cms/node_modules/tslib/tslib.es6.js | ||
// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.js | ||
/*! ***************************************************************************** | ||
@@ -356,7 +356,210 @@ Copyright (c) Microsoft Corporation. | ||
// CONCATENATED MODULE: /Users/danjutan/WebstormProjects/docs-cms/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b1c526a2-vue-loader-template"}!/Users/danjutan/WebstormProjects/docs-cms/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!/Users/danjutan/WebstormProjects/docs-cms/node_modules/cache-loader/dist/cjs.js??ref--0-0!/Users/danjutan/WebstormProjects/docs-cms/node_modules/vue-loader/lib??vue-loader-options!./src/components/DefaultTable.vue?vue&type=template&id=5a72f336& | ||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"doc-table-root",style:(_vm.rootStyles)},_vm._l((_vm.tableData.cells),function(_,i){return _c('div',{staticClass:"doc-table-cell",style:(_vm.cellStyles(i))},[_vm._t(("cell:" + i))],2)}),0)} | ||
var staticRenderFns = [] | ||
// CONCATENATED MODULE: ./src/components/DefaultTable.vue?vue&type=template&id=5a72f336& | ||
// CONCATENATED MODULE: /Users/danjutan/WebstormProjects/docs-cms/node_modules/cache-loader/dist/cjs.js??ref--0-0!/Users/danjutan/WebstormProjects/docs-cms/node_modules/vue-loader/lib??vue-loader-options!./src/components/DefaultTable.vue?vue&type=script&lang=js& | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
/* harmony default export */ var DefaultTablevue_type_script_lang_js_ = ({ | ||
name: "DefaultTable", | ||
props: { | ||
tableData: { | ||
type: Object, | ||
required: true, | ||
} | ||
}, | ||
computed: { | ||
numRows() { | ||
return this.tableData.rows.length; | ||
}, | ||
numColumns() { | ||
return this.tableData.rows[0].length; | ||
}, | ||
rootStyles() { | ||
const gridTemplateAreas = this.tableData.rows.map(row => | ||
`"${row | ||
.map(i => `area${i}`) | ||
.join(" ")}"`) | ||
.join(" "); | ||
return { | ||
display: "grid", | ||
gridTemplateAreas | ||
} | ||
}, | ||
cellSpans() { | ||
const spans = {} | ||
for (let y = 0; y < this.numRows; y++) { | ||
const row = this.tableData.rows[y]; | ||
for (let x = 0; x < this.numColumns; x++) { | ||
if (row[x] > -1) { | ||
if (row[x] in spans) { | ||
const span = spans[row[x]]; | ||
span.rowEnd = y; | ||
span.rowStart = y; | ||
} else { | ||
spans[row[x]] = { | ||
rowStart: y, | ||
colStart: x, | ||
rowEnd: y, | ||
colEnd: x | ||
} | ||
} | ||
} | ||
} | ||
} | ||
return spans; | ||
} | ||
}, | ||
methods: { | ||
cellStyles(index) { | ||
return { | ||
gridArea: `area${index}` | ||
} | ||
} | ||
}, | ||
mounted() { | ||
console.log("table mounted") | ||
} | ||
}); | ||
// CONCATENATED MODULE: ./src/components/DefaultTable.vue?vue&type=script&lang=js& | ||
/* harmony default export */ var components_DefaultTablevue_type_script_lang_js_ = (DefaultTablevue_type_script_lang_js_); | ||
// CONCATENATED MODULE: /Users/danjutan/WebstormProjects/docs-cms/node_modules/vue-loader/lib/runtime/componentNormalizer.js | ||
/* globals __VUE_SSR_CONTEXT__ */ | ||
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules). | ||
// This module is a runtime utility for cleaner component module output and will | ||
// be included in the final webpack user bundle. | ||
function normalizeComponent ( | ||
scriptExports, | ||
render, | ||
staticRenderFns, | ||
functionalTemplate, | ||
injectStyles, | ||
scopeId, | ||
moduleIdentifier, /* server only */ | ||
shadowMode /* vue-cli only */ | ||
) { | ||
// Vue.extend constructor export interop | ||
var options = typeof scriptExports === 'function' | ||
? scriptExports.options | ||
: scriptExports | ||
// render functions | ||
if (render) { | ||
options.render = render | ||
options.staticRenderFns = staticRenderFns | ||
options._compiled = true | ||
} | ||
// functional template | ||
if (functionalTemplate) { | ||
options.functional = true | ||
} | ||
// scopedId | ||
if (scopeId) { | ||
options._scopeId = 'data-v-' + scopeId | ||
} | ||
var hook | ||
if (moduleIdentifier) { // server build | ||
hook = function (context) { | ||
// 2.3 injection | ||
context = | ||
context || // cached call | ||
(this.$vnode && this.$vnode.ssrContext) || // stateful | ||
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional | ||
// 2.2 with runInNewContext: true | ||
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { | ||
context = __VUE_SSR_CONTEXT__ | ||
} | ||
// inject component styles | ||
if (injectStyles) { | ||
injectStyles.call(this, context) | ||
} | ||
// register component module identifier for async chunk inferrence | ||
if (context && context._registeredComponents) { | ||
context._registeredComponents.add(moduleIdentifier) | ||
} | ||
} | ||
// used by ssr in case component is cached and beforeCreate | ||
// never gets called | ||
options._ssrRegister = hook | ||
} else if (injectStyles) { | ||
hook = shadowMode | ||
? function () { | ||
injectStyles.call( | ||
this, | ||
(options.functional ? this.parent : this).$root.$options.shadowRoot | ||
) | ||
} | ||
: injectStyles | ||
} | ||
if (hook) { | ||
if (options.functional) { | ||
// for template-only hot-reload because in that case the render fn doesn't | ||
// go through the normalizer | ||
options._injectStyles = hook | ||
// register for functional component in vue file | ||
var originalRender = options.render | ||
options.render = function renderWithStyleInjection (h, context) { | ||
hook.call(context) | ||
return originalRender(h, context) | ||
} | ||
} else { | ||
// inject component registration as beforeCreate hook | ||
var existing = options.beforeCreate | ||
options.beforeCreate = existing | ||
? [].concat(existing, hook) | ||
: [hook] | ||
} | ||
} | ||
return { | ||
exports: scriptExports, | ||
options: options | ||
} | ||
} | ||
// CONCATENATED MODULE: ./src/components/DefaultTable.vue | ||
/* normalize component */ | ||
var component = normalizeComponent( | ||
components_DefaultTablevue_type_script_lang_js_, | ||
render, | ||
staticRenderFns, | ||
false, | ||
null, | ||
null, | ||
null | ||
) | ||
/* harmony default export */ var DefaultTable = (component.exports); | ||
// CONCATENATED MODULE: ./src/components/Renderer.ts | ||
/* harmony default export */ var Renderer = (external_commonjs_vue_commonjs2_vue_root_Vue_default.a.extend({ | ||
functional: true, | ||
name: "Renderer", | ||
props: { | ||
@@ -372,9 +575,9 @@ content: { | ||
}, | ||
tableComponent: { | ||
type: [Object, Boolean], | ||
default: function () { return (DefaultTable); } | ||
}, | ||
inlineSlotFormat: { | ||
type: RegExp, | ||
default: function () { return (/\[\^(\d*[a-zA-z]+\d*)\](?:(.+)\[\/\1\])*/g); } | ||
}, | ||
ignoreCss: { | ||
type: Array, | ||
default: function () { return ([]); } | ||
} | ||
@@ -430,9 +633,3 @@ }, | ||
if ("element" in data) { | ||
var nodeData = __assign({}, (data.attrs && { attrs: data.attrs })); | ||
if (data.style) { | ||
nodeData.style = Object.fromEntries(Object.entries(data.style).filter(function (_a) { | ||
var _b = __read(_a, 1), key = _b[0]; | ||
return !(context.props.ignoreCss.includes(key)); | ||
})); | ||
} | ||
var nodeData = __assign(__assign({}, (data.style && { style: data.style })), (data.attrs && { attrs: data.attrs })); | ||
return h(data.element, nodeData, fromContentArray(data.children)); | ||
@@ -463,2 +660,13 @@ } | ||
} | ||
if ("rows" in data) { | ||
if (typeof context.props.tableComponent == "object") { | ||
var slotsEntries = data.cells.map(function (contentData, index) { return ["cell:" + index, function () { return fromContentArray(contentData); }]; }); | ||
return h(context.props.tableComponent, { | ||
props: { | ||
tableData: data | ||
}, | ||
scopedSlots: Object.fromEntries(slotsEntries) | ||
}); | ||
} | ||
} | ||
return false; | ||
@@ -469,7 +677,7 @@ } | ||
} | ||
return h("div", context.data, fromContentArray(context.props.content)); | ||
return h("div", fromContentArray(context.props.content)); | ||
} | ||
})); | ||
// CONCATENATED MODULE: /mnt/c/Users/Dan Jutan/WebstormProjects/docs-cms/node_modules/@vue/cli-service/lib/commands/build/entry-lib.js | ||
// CONCATENATED MODULE: /Users/danjutan/WebstormProjects/docs-cms/node_modules/@vue/cli-service/lib/commands/build/entry-lib.js | ||
@@ -476,0 +684,0 @@ |
@@ -1,2 +0,2 @@ | ||
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue")):"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["docsRenderer"]=e(require("vue")):t["docsRenderer"]=e(t["Vue"])})("undefined"!==typeof self?self:this,(function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s="1c25")}({"1c25":function(t,e,r){"use strict";if(r.r(e),"undefined"!==typeof window){var n=window.document.currentScript,o=r("405b");n=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var i=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(r.p=i[1])}var u=function(){return u=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},u.apply(this,arguments)};function c(t){var e="function"===typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(t,e){var r="function"===typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),u=[];try{while((void 0===e||e-- >0)&&!(n=i.next()).done)u.push(n.value)}catch(c){o={error:c}}finally{try{n&&!n.done&&(r=i["return"])&&r.call(i)}finally{if(o)throw o.error}}return u}function l(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}var a=r("8bbf"),p=r.n(a),s=p.a.extend({functional:!0,props:{content:{type:Array,required:!0,default:function(){return[]}},components:{type:Object,default:function(){return{}}},inlineSlotFormat:{type:RegExp,default:function(){return/\[\^(\d*[a-zA-z]+\d*)\](?:(.+)\[\/\1\])*/g}},ignoreCss:{type:Array,default:function(){return[]}}},render:function(t,e){function r(r){var o,i;if("string"==typeof r){var a=r.matchAll(e.props.inlineSlotFormat),p=[];try{for(var s=c(a),d=s.next();!d.done;d=s.next()){var y=d.value;if(void 0!=y.index){var m=y[1],v=y[2];if(m in e.scopedSlots){var b=e.scopedSlots[m]({inner:v});if(b){var h=y.index,g=h+y[0].length;p.push({start:h,end:g,slot:b})}}}}}catch(w){o={error:w}}finally{try{d&&!d.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}if(!p.length)return r;var S=[],x=0;return p.sort((function(t,e){return t.start-e.start})).forEach((function(t){var e=t.start,n=t.end,o=t.slot;x!=e&&S.push(r.slice(x,e)),S.push.apply(S,l(o)),x=n})),x!=r.length&&S.push(r.slice(x)),S}if("element"in r){var j=u({},r.attrs&&{attrs:r.attrs});return r.style&&(j.style=Object.fromEntries(Object.entries(r.style).filter((function(t){var r=f(t,1),n=r[0];return!e.props.ignoreCss.includes(n)})))),t(r.element,j,n(r.children))}if("component"in r){j={};if(!(r.component in e.props.components))return!1;if(r.props&&(j.props=r.props),r.slots){var O=Object.entries(r.slots).map((function(t){var e=f(t,2),r=e[0],o=e[1];return[r,function(){return n(o)}]}));j.scopedSlots=Object.fromEntries(O)}return t(e.props.components[r.component],j)}if("slot"in r&&r.slot in e.scopedSlots){b=e.scopedSlots[r.slot]({});if(b)return b}return!1}function n(t){return t.map((function(t){return r(t)})).flat(1).filter(Boolean)}return t("div",e.data,n(e.props.content))}});e["default"]=s},"405b":function(t,e,r){var n,o,i;(function(r,u){o=[],n=u,i="function"===typeof n?n.apply(e,o):n,void 0===i||(t.exports=i)})("undefined"!==typeof self&&self,(function(){function t(){var e=Object.getOwnPropertyDescriptor(document,"currentScript");if(!e&&"currentScript"in document&&document.currentScript)return document.currentScript;if(e&&e.get!==t&&document.currentScript)return document.currentScript;try{throw new Error}catch(d){var r,n,o,i=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,u=/@([^@]*):(\d+):(\d+)\s*$/gi,c=i.exec(d.stack)||u.exec(d.stack),f=c&&c[1]||!1,l=c&&c[2]||!1,a=document.location.href.replace(document.location.hash,""),p=document.getElementsByTagName("script");f===a&&(r=document.documentElement.outerHTML,n=new RegExp("(?:[^\\n]+?\\n){0,"+(l-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=r.replace(n,"$1").trim());for(var s=0;s<p.length;s++){if("interactive"===p[s].readyState)return p[s];if(p[s].src===f)return p[s];if(f===a&&p[s].innerHTML&&p[s].innerHTML.trim()===o)return p[s]}return null}}return t}))},"8bbf":function(e,r){e.exports=t}})})); | ||
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue")):"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["docsRenderer"]=e(require("vue")):t["docsRenderer"]=e(t["Vue"])})("undefined"!==typeof self?self:this,(function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s="1c25")}({"1c25":function(t,e,r){"use strict";if(r.r(e),"undefined"!==typeof window){var n=window.document.currentScript,o=r("405b");n=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var i=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(r.p=i[1])}var c=function(){return c=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},c.apply(this,arguments)};function u(t){var e="function"===typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(t,e){var r="function"===typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),c=[];try{while((void 0===e||e-- >0)&&!(n=i.next()).done)c.push(n.value)}catch(u){o={error:u}}finally{try{n&&!n.done&&(r=i["return"])&&r.call(i)}finally{if(o)throw o.error}}return c}function a(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(l(arguments[e]));return t}var s=r("8bbf"),f=r.n(s),p=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"doc-table-root",style:t.rootStyles},t._l(t.tableData.cells,(function(e,n){return r("div",{staticClass:"doc-table-cell",style:t.cellStyles(n)},[t._t("cell:"+n)],2)})),0)},d=[],m={name:"DefaultTable",props:{tableData:{type:Object,required:!0}},computed:{numRows(){return this.tableData.rows.length},numColumns(){return this.tableData.rows[0].length},rootStyles(){const t=this.tableData.rows.map(t=>`"${t.map(t=>"area"+t).join(" ")}"`).join(" ");return{display:"grid",gridTemplateAreas:t}},cellSpans(){const t={};for(let e=0;e<this.numRows;e++){const r=this.tableData.rows[e];for(let n=0;n<this.numColumns;n++)if(r[n]>-1)if(r[n]in t){const o=t[r[n]];o.rowEnd=e,o.rowStart=e}else t[r[n]]={rowStart:e,colStart:n,rowEnd:e,colEnd:n}}return t}},methods:{cellStyles(t){return{gridArea:"area"+t}}},mounted(){console.log("table mounted")}},y=m;function b(t,e,r,n,o,i,c,u){var l,a="function"===typeof t?t.options:t;if(e&&(a.render=e,a.staticRenderFns=r,a._compiled=!0),n&&(a.functional=!0),i&&(a._scopeId="data-v-"+i),c?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(c)},a._ssrRegister=l):o&&(l=u?function(){o.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(a.functional){a._injectStyles=l;var s=a.render;a.render=function(t,e){return l.call(e),s(t,e)}}else{var f=a.beforeCreate;a.beforeCreate=f?[].concat(f,l):[l]}return{exports:t,options:a}}var v=b(y,p,d,!1,null,null,null),h=v.exports,S=f.a.extend({functional:!0,name:"Renderer",props:{content:{type:Array,required:!0,default:function(){return[]}},components:{type:Object,default:function(){return{}}},tableComponent:{type:[Object,Boolean],default:function(){return h}},inlineSlotFormat:{type:RegExp,default:function(){return/\[\^(\d*[a-zA-z]+\d*)\](?:(.+)\[\/\1\])*/g}}},render:function(t,e){function r(r){var o,i;if("string"==typeof r){var s=r.matchAll(e.props.inlineSlotFormat),f=[];try{for(var p=u(s),d=p.next();!d.done;d=p.next()){var m=d.value;if(void 0!=m.index){var y=m[1],b=m[2];if(y in e.scopedSlots){var v=e.scopedSlots[y]({inner:b});if(v){var h=m.index,S=h+m[0].length;f.push({start:h,end:S,slot:v})}}}}}catch(x){o={error:x}}finally{try{d&&!d.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}if(!f.length)return r;var g=[],_=0;return f.sort((function(t,e){return t.start-e.start})).forEach((function(t){var e=t.start,n=t.end,o=t.slot;_!=e&&g.push(r.slice(_,e)),g.push.apply(g,a(o)),_=n})),_!=r.length&&g.push(r.slice(_)),g}if("element"in r){var w=c(c({},r.style&&{style:r.style}),r.attrs&&{attrs:r.attrs});return t(r.element,w,n(r.children))}if("component"in r){w={};if(!(r.component in e.props.components))return!1;if(r.props&&(w.props=r.props),r.slots){var j=Object.entries(r.slots).map((function(t){var e=l(t,2),r=e[0],o=e[1];return[r,function(){return n(o)}]}));w.scopedSlots=Object.fromEntries(j)}return t(e.props.components[r.component],w)}if("slot"in r&&r.slot in e.scopedSlots){v=e.scopedSlots[r.slot]({});if(v)return v}if("rows"in r&&"object"==typeof e.props.tableComponent){j=r.cells.map((function(t,e){return["cell:"+e,function(){return n(t)}]}));return t(e.props.tableComponent,{props:{tableData:r},scopedSlots:Object.fromEntries(j)})}return!1}function n(t){return t.map((function(t){return r(t)})).flat(1).filter(Boolean)}return t("div",n(e.props.content))}});e["default"]=S},"405b":function(t,e,r){var n,o,i;(function(r,c){o=[],n=c,i="function"===typeof n?n.apply(e,o):n,void 0===i||(t.exports=i)})("undefined"!==typeof self&&self,(function(){function t(){var e=Object.getOwnPropertyDescriptor(document,"currentScript");if(!e&&"currentScript"in document&&document.currentScript)return document.currentScript;if(e&&e.get!==t&&document.currentScript)return document.currentScript;try{throw new Error}catch(d){var r,n,o,i=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,c=/@([^@]*):(\d+):(\d+)\s*$/gi,u=i.exec(d.stack)||c.exec(d.stack),l=u&&u[1]||!1,a=u&&u[2]||!1,s=document.location.href.replace(document.location.hash,""),f=document.getElementsByTagName("script");l===s&&(r=document.documentElement.outerHTML,n=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=r.replace(n,"$1").trim());for(var p=0;p<f.length;p++){if("interactive"===f[p].readyState)return f[p];if(f[p].src===l)return f[p];if(l===s&&f[p].innerHTML&&f[p].innerHTML.trim()===o)return f[p]}return null}}return t}))},"8bbf":function(e,r){e.exports=t}})})); | ||
//# sourceMappingURL=docsRenderer.umd.min.js.map |
{ | ||
"name": "docs-renderer-vue2", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"main": "./dist/docsRenderer.common.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
181510
1410