From d9b8910870b096a8ab71ed165e97df8e2d7bbc6c Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Mon, 11 Apr 2022 17:28:51 +0800 Subject: [PATCH] build: version 3.2.0 --- CHANGELOG.md | 9 +++++ dist/vue-showdown.cjs.js | 14 +++---- dist/vue-showdown.d.ts | 76 ++++++++++++++++++++++++++++++------ dist/vue-showdown.esm.js | 9 ++--- dist/vue-showdown.esm.min.js | 6 +-- dist/vue-showdown.js | 16 ++++---- dist/vue-showdown.min.js | 4 +- package-lock.json | 4 +- package.json | 2 +- 9 files changed, 99 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a295714..97fbc0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# [3.2.0](https://github.com/meteorlxy/vue-showdown/compare/v3.1.0...v3.2.0) (2022-04-11) + + +### Features + +* bump to showdown v2 ([5e727f8](https://github.com/meteorlxy/vue-showdown/commit/5e727f8634da2f2d7bd809591bcfbfbe4a7ab7d1)) + + + # [3.1.0](https://github.com/meteorlxy/vue-showdown/compare/v3.0.0...v3.1.0) (2021-04-26) diff --git a/dist/vue-showdown.cjs.js b/dist/vue-showdown.cjs.js index 25d3474..d214880 100644 --- a/dist/vue-showdown.cjs.js +++ b/dist/vue-showdown.cjs.js @@ -1,10 +1,10 @@ /*! * vue-showdown - Use showdown as a vue component * - * @version v3.1.0 + * @version v3.2.0 * @link https://vue-showdown.js.org * @license MIT - * @copyright 2018-2021 meteorlxy + * @copyright 2018-2022 meteorlxy */ 'use strict'; @@ -23,14 +23,12 @@ function _interopNamespace(e) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, - get: function () { - return e[k]; - } + get: function () { return e[k]; } }); } }); } - n['default'] = e; + n["default"] = e; return Object.freeze(n); } @@ -147,7 +145,7 @@ const VueShowdown = vue.defineComponent({ return props.markdown; } // from default slot - const slot = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)[0]; + const slot = (_a = slots['default']) === null || _a === void 0 ? void 0 : _a.call(slots)[0]; if ((slot === null || slot === void 0 ? void 0 : slot.type) === vue.Text) { return slot.children; } @@ -200,4 +198,4 @@ const VueShowdownPlugin = { exports.showdown = showdown__namespace; exports.VueShowdown = VueShowdown; exports.VueShowdownPlugin = VueShowdownPlugin; -exports.default = VueShowdownPlugin; +exports["default"] = VueShowdownPlugin; diff --git a/dist/vue-showdown.d.ts b/dist/vue-showdown.d.ts index 7db2828..c4afa55 100644 --- a/dist/vue-showdown.d.ts +++ b/dist/vue-showdown.d.ts @@ -91,15 +91,70 @@ declare const VueShowdown: vue.DefineComponent<{ }; }, () => vue.VNode, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<{ - extensions: Required<(string | (() => showdown.ShowdownExtension | showdown.ShowdownExtension[]) | showdown.ShowdownExtension | showdown.ShowdownExtension[])[] | null | undefined>; - markdown: string | null; - tag: string; - flavor: showdown.Flavor | null; - options: showdown.ShowdownOptions; - vueTemplate: boolean; - vueTemplateData: Record; -} & {}>, { +}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly; + required: false; + default: null; + }; + /** + * HTML tag of the markdown wrapper + */ + tag: { + type: PropType; + required: false; + default: string; + }; + /** + * Showdown flavor + * + * @see https://github.com/showdownjs/showdown#flavors + */ + flavor: { + type: PropType; + required: false; + default: null; + }; + /** + * Showdown options + * + * @see https://github.com/showdownjs/showdown#valid-options + */ + options: { + type: PropType; + required: false; + default: () => {}; + }; + /** + * Showdown extensions + * + * @see https://github.com/showdownjs/showdown#extensions + */ + extensions: { + type: PropType showdown.ShowdownExtension | showdown.ShowdownExtension[]) | showdown.ShowdownExtension | showdown.ShowdownExtension[])[] | null | undefined>>; + required: false; + default: null; + }; + /** + * Treat the HTML string as Vue template. Require full build of Vue (runtime + complier) + */ + vueTemplate: { + type: BooleanConstructor; + required: false; + default: boolean; + }; + /** + * Define data which is available in the Vue template. Require `vueTemplate` to be enabled + */ + vueTemplateData: { + type: ObjectConstructor; + required: false; + default: () => {}; + }; +}>>, { extensions: Required<(string | (() => showdown.ShowdownExtension | showdown.ShowdownExtension[]) | showdown.ShowdownExtension | showdown.ShowdownExtension[])[] | null | undefined>; markdown: string | null; tag: string; @@ -125,5 +180,4 @@ declare const VueShowdown: vue.DefineComponent<{ */ declare const VueShowdownPlugin: Plugin; -export default VueShowdownPlugin; -export { VueShowdown, VueShowdownPlugin }; +export { VueShowdown, VueShowdownPlugin, VueShowdownPlugin as default }; diff --git a/dist/vue-showdown.esm.js b/dist/vue-showdown.esm.js index 77b9321..4c96571 100644 --- a/dist/vue-showdown.esm.js +++ b/dist/vue-showdown.esm.js @@ -1,10 +1,10 @@ /*! * vue-showdown - Use showdown as a vue component * - * @version v3.1.0 + * @version v3.2.0 * @link https://vue-showdown.js.org * @license MIT - * @copyright 2018-2021 meteorlxy + * @copyright 2018-2022 meteorlxy */ import * as showdown from 'showdown'; @@ -122,7 +122,7 @@ const VueShowdown = defineComponent({ return props.markdown; } // from default slot - const slot = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)[0]; + const slot = (_a = slots['default']) === null || _a === void 0 ? void 0 : _a.call(slots)[0]; if ((slot === null || slot === void 0 ? void 0 : slot.type) === Text) { return slot.children; } @@ -172,5 +172,4 @@ const VueShowdownPlugin = { }, }; -export default VueShowdownPlugin; -export { VueShowdown, VueShowdownPlugin }; +export { VueShowdown, VueShowdownPlugin, VueShowdownPlugin as default }; diff --git a/dist/vue-showdown.esm.min.js b/dist/vue-showdown.esm.min.js index b85bd11..a0a2083 100644 --- a/dist/vue-showdown.esm.min.js +++ b/dist/vue-showdown.esm.min.js @@ -1,9 +1,9 @@ /*! * vue-showdown - Use showdown as a vue component * - * @version v3.1.0 + * @version v3.2.0 * @link https://vue-showdown.js.org * @license MIT - * @copyright 2018-2021 meteorlxy + * @copyright 2018-2022 meteorlxy */ -import*as e from"showdown";export{e as showdown};import{defineComponent as t,computed as r,Text as l,h as o}from"vue";const n=t({name:"VueShowdown",props:{markdown:{type:String,required:!1,default:null},tag:{type:String,required:!1,default:"div"},flavor:{type:String,required:!1,default:null},options:{type:Object,required:!1,default:()=>({})},extensions:{type:Array,required:!1,default:null},vueTemplate:{type:Boolean,required:!1,default:!1},vueTemplateData:{type:Object,required:!1,default:()=>({})}},setup(t,{slots:n}){const a=r((()=>{const r=new e.Converter({extensions:t.extensions||void 0});return null!==t.flavor&&r.setFlavor(t.flavor),Object.entries(t.options).forEach((([e,t])=>{r.setOption(e,t)})),r})),u=r((()=>{var e;if(null!==t.markdown)return t.markdown;const r=null===(e=n.default)||void 0===e?void 0:e.call(n)[0];return(null==r?void 0:r.type)===l?r.children:""})),i=r((()=>a.value.makeHtml(u.value)));return()=>t.vueTemplate?o({setup:()=>t.vueTemplateData,template:`<${t.tag}>${i.value}`}):o(t.tag,{innerHTML:i.value})}}),a={install(t,{flavor:r=null,options:l={}}={}){null!==r&&e.setFlavor(r),Object.entries(l).forEach((([t,r])=>{e.setOption(t,r)})),t.component("VueShowdown",n)}};export default a;export{n as VueShowdown,a as VueShowdownPlugin}; +import*as e from"showdown";export{e as showdown};import{defineComponent as t,computed as r,Text as l,h as n}from"vue";const o=t({name:"VueShowdown",props:{markdown:{type:String,required:!1,default:null},tag:{type:String,required:!1,default:"div"},flavor:{type:String,required:!1,default:null},options:{type:Object,required:!1,default:()=>({})},extensions:{type:Array,required:!1,default:null},vueTemplate:{type:Boolean,required:!1,default:!1},vueTemplateData:{type:Object,required:!1,default:()=>({})}},setup(t,{slots:o}){const a=r((()=>{const r=new e.Converter({extensions:t.extensions||void 0});return null!==t.flavor&&r.setFlavor(t.flavor),Object.entries(t.options).forEach((([e,t])=>{r.setOption(e,t)})),r})),u=r((()=>{var e;if(null!==t.markdown)return t.markdown;const r=null===(e=o.default)||void 0===e?void 0:e.call(o)[0];return(null==r?void 0:r.type)===l?r.children:""})),i=r((()=>a.value.makeHtml(u.value)));return()=>t.vueTemplate?n({setup:()=>t.vueTemplateData,template:`<${t.tag}>${i.value}`}):n(t.tag,{innerHTML:i.value})}}),a={install(t,{flavor:r=null,options:l={}}={}){null!==r&&e.setFlavor(r),Object.entries(l).forEach((([t,r])=>{e.setOption(t,r)})),t.component("VueShowdown",o)}};export{o as VueShowdown,a as VueShowdownPlugin,a as default}; diff --git a/dist/vue-showdown.js b/dist/vue-showdown.js index 5118261..fbdcc90 100644 --- a/dist/vue-showdown.js +++ b/dist/vue-showdown.js @@ -1,17 +1,17 @@ /*! * vue-showdown - Use showdown as a vue component * - * @version v3.1.0 + * @version v3.2.0 * @link https://vue-showdown.js.org * @license MIT - * @copyright 2018-2021 meteorlxy + * @copyright 2018-2022 meteorlxy */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('showdown'), require('vue')) : typeof define === 'function' && define.amd ? define(['exports', 'showdown', 'vue'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.VueShowdown = {}, global.showdown, global.Vue)); -}(this, (function (exports, showdown, vue) { 'use strict'; +})(this, (function (exports, showdown, vue) { 'use strict'; function _interopNamespace(e) { if (e && e.__esModule) return e; @@ -22,14 +22,12 @@ var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, - get: function () { - return e[k]; - } + get: function () { return e[k]; } }); } }); } - n['default'] = e; + n["default"] = e; return Object.freeze(n); } @@ -146,7 +144,7 @@ return props.markdown; } // from default slot - const slot = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)[0]; + const slot = (_a = slots['default']) === null || _a === void 0 ? void 0 : _a.call(slots)[0]; if ((slot === null || slot === void 0 ? void 0 : slot.type) === vue.Text) { return slot.children; } @@ -207,4 +205,4 @@ Object.defineProperty(exports, '__esModule', { value: true }); -}))); +})); diff --git a/dist/vue-showdown.min.js b/dist/vue-showdown.min.js index e9cf668..7ee3bb8 100644 --- a/dist/vue-showdown.min.js +++ b/dist/vue-showdown.min.js @@ -1,9 +1,9 @@ /*! * vue-showdown - Use showdown as a vue component * - * @version v3.1.0 + * @version v3.2.0 * @link https://vue-showdown.js.org * @license MIT - * @copyright 2018-2021 meteorlxy + * @copyright 2018-2022 meteorlxy */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("showdown"),require("vue")):"function"==typeof define&&define.amd?define(["exports","showdown","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VueShowdown={},e.showdown,e.Vue)}(this,(function(e,t,n){"use strict";function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=o(t);const r=n.defineComponent({name:"VueShowdown",props:{markdown:{type:String,required:!1,default:null},tag:{type:String,required:!1,default:"div"},flavor:{type:String,required:!1,default:null},options:{type:Object,required:!1,default:()=>({})},extensions:{type:Array,required:!1,default:null},vueTemplate:{type:Boolean,required:!1,default:!1},vueTemplateData:{type:Object,required:!1,default:()=>({})}},setup(e,{slots:t}){const o=n.computed((()=>{const t=new u.Converter({extensions:e.extensions||void 0});return null!==e.flavor&&t.setFlavor(e.flavor),Object.entries(e.options).forEach((([e,n])=>{t.setOption(e,n)})),t})),r=n.computed((()=>{var o;if(null!==e.markdown)return e.markdown;const u=null===(o=t.default)||void 0===o?void 0:o.call(t)[0];return(null==u?void 0:u.type)===n.Text?u.children:""})),l=n.computed((()=>o.value.makeHtml(r.value)));return()=>e.vueTemplate?n.h({setup:()=>e.vueTemplateData,template:`<${e.tag}>${l.value}`}):n.h(e.tag,{innerHTML:l.value})}}),l={install(e,{flavor:t=null,options:n={}}={}){null!==t&&u.setFlavor(t),Object.entries(n).forEach((([e,t])=>{u.setOption(e,t)})),e.component("VueShowdown",r)}};"undefined"!=typeof window&&(window.VueShowdownPlugin=l,window.VueShowdown=r),e.showdown=u,e.VueShowdown=r,e.VueShowdownPlugin=l,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/package-lock.json b/package-lock.json index 94b7e72..29981e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vue-showdown", - "version": "3.1.0", + "version": "3.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vue-showdown", - "version": "3.1.0", + "version": "3.2.0", "license": "MIT", "dependencies": { "@types/showdown": "^1.9.4", diff --git a/package.json b/package.json index 9f5833b..cf34273 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-showdown", - "version": "3.1.0", + "version": "3.2.0", "description": "Use showdown as a vue component", "keywords": [ "vue",