@uiw/react-markdown-editor
Version:
A markdown editor with preview, implemented with React.js and TypeScript.
46 lines (42 loc) • 1.78 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.strike = void 0;
var _state = require("@codemirror/state");
var _jsxRuntime = require("react/jsx-runtime");
var strike = {
name: 'strike',
keyCommand: 'strike',
button: {
'aria-label': 'Add strike text'
},
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
width: "12",
height: "12",
viewBox: "0 0 512 512",
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
fill: "currentColor",
d: "M496 288H16c-8.837 0-16-7.163-16-16v-32c0-8.837 7.163-16 16-16h480c8.837 0 16 7.163 16 16v32c0 8.837-7.163 16-16 16zm-214.666 16c27.258 12.937 46.524 28.683 46.524 56.243 0 33.108-28.977 53.676-75.621 53.676-32.325 0-76.874-12.08-76.874-44.271V368c0-8.837-7.164-16-16-16H113.75c-8.836 0-16 7.163-16 16v19.204c0 66.845 77.717 101.82 154.487 101.82 88.578 0 162.013-45.438 162.013-134.424 0-19.815-3.618-36.417-10.143-50.6H281.334zm-30.952-96c-32.422-13.505-56.836-28.946-56.836-59.683 0-33.92 30.901-47.406 64.962-47.406 42.647 0 64.962 16.593 64.962 32.985V136c0 8.837 7.164 16 16 16h45.613c8.836 0 16-7.163 16-16v-30.318c0-52.438-71.725-79.875-142.575-79.875-85.203 0-150.726 40.972-150.726 125.646 0 22.71 4.665 41.176 12.777 56.547h129.823z"
})
}),
execute: function execute(_ref) {
var state = _ref.state,
view = _ref.view;
if (!state || !view) return;
view.dispatch(view.state.changeByRange(function (range) {
return {
changes: [{
from: range.from,
insert: '~~'
}, {
from: range.to,
insert: '~~'
}],
range: _state.EditorSelection.range(range.from + 2, range.to + 2)
};
}));
}
};
exports.strike = strike;
//# sourceMappingURL=strike.js.map