Commit 9dec341b authored by tyyin lan's avatar tyyin lan

feat: 编辑器

parent 8172e088
node_modules
build
dist
src/components/markdown-render/style
public
...@@ -2,3 +2,5 @@ node_modules ...@@ -2,3 +2,5 @@ node_modules
build build
dist dist
src/components/markdown-render/style src/components/markdown-render/style
public
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
name="viewport" name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/> />
<link rel="stylesheet" href="//at.alicdn.com/t/c/font_4711453_3ywre5b9kt4.css" /> <link rel="stylesheet" href="//at.alicdn.com/t/c/font_4711453_kteyuqickp.css" />
<title>Model Link</title> <title>Model Link</title>
<script src="/tinymce/tinymce.min.js" type="module" referrerpolicy="origin"></script>
</head> </head>
<body> <body>
......
...@@ -2,7 +2,7 @@ export default { ...@@ -2,7 +2,7 @@ export default {
'*.md': ['prettier --write'], '*.md': ['prettier --write'],
'package.json': ['prettier --write'], 'package.json': ['prettier --write'],
'!(package).json': ['prettier --write--parser json'], '!(package).json': ['prettier --write--parser json'],
'*.{css,scss,postcss,less}': ['stylelint --fix', 'prettier --write'], '*.{css,scss,postcss,less}': ['stylelint --fix --allow-empty-input', 'prettier --write'],
'*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'], '*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'],
'*.vue': ['eslint --fix', 'stylelint --fix', 'prettier --write', 'echo "统一格式化完成🌸"'], '*.vue': ['eslint --fix', 'stylelint --fix --allow-empty-input', 'prettier --write', 'echo "统一格式化完成🌸"'],
} }
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
"stylelint-config-standard": "^36.0.1", "stylelint-config-standard": "^36.0.1",
"stylelint-config-standard-scss": "^13.1.0", "stylelint-config-standard-scss": "^13.1.0",
"stylelint-order": "^6.0.4", "stylelint-order": "^6.0.4",
"tinymce": "^7.7.1",
"typescript": "^5.6.2", "typescript": "^5.6.2",
"typescript-eslint": "^7.18.0", "typescript-eslint": "^7.18.0",
"unocss": "^0.61.9", "unocss": "^0.61.9",
......
...@@ -216,6 +216,9 @@ importers: ...@@ -216,6 +216,9 @@ importers:
stylelint-order: stylelint-order:
specifier: ^6.0.4 specifier: ^6.0.4
version: 6.0.4(stylelint@16.9.0(typescript@5.6.2)) version: 6.0.4(stylelint@16.9.0(typescript@5.6.2))
tinymce:
specifier: ^7.7.1
version: 7.7.1
typescript: typescript:
specifier: ^5.6.2 specifier: ^5.6.2
version: 5.6.2 version: 5.6.2
...@@ -3121,6 +3124,9 @@ packages: ...@@ -3121,6 +3124,9 @@ packages:
tinyexec@0.3.0: tinyexec@0.3.0:
resolution: {integrity: sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==} resolution: {integrity: sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==}
tinymce@7.7.1:
resolution: {integrity: sha512-rMetqSgZtYbj4YPOX+gYgmlhy/sIjVlI/qlrSOul/Mpn9e0aIIG/fR0qvQSVYvxFv6OzRTge++NQyTbzLJK1NA==}
to-fast-properties@2.0.0: to-fast-properties@2.0.0:
resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
engines: {node: '>=4'} engines: {node: '>=4'}
...@@ -6420,6 +6426,8 @@ snapshots: ...@@ -6420,6 +6426,8 @@ snapshots:
tinyexec@0.3.0: {} tinyexec@0.3.0: {}
tinymce@7.7.1: {}
to-fast-properties@2.0.0: {} to-fast-properties@2.0.0: {}
to-regex-range@5.0.1: to-regex-range@5.0.1:
......
tinymce.PluginManager.add('mfConfirmationBox', (editor) => {
editor.on('init', () => {
const win = editor.getWin()
class MfConfirmationBox extends win.HTMLElement {
static observedAttributes = ['data-init-text', 'data-is-response-end', 'data-document-title']
constructor() {
super()
this.initConnect = false
const shadowRoot = this.attachShadow({ mode: 'open' })
const tpEl = document.createElement('template')
tpEl.insertAdjacentHTML('beforeend', `
<div contenteditable="false" class="confirmation-box">
<div class="header">
<span>生成内容预览</span>
</div>
<h3 class="document-title">标题:</h3>
<div id="content">
<slot></slot>
</div>
<div class="footer">
<div class="left">内容由AI生成,请注意甄别真实性</div>
<div class="right btn-wrapper">
<button name="btn" class="cancel-btn">取消</button>
<button class="confirm-btn">应用</button>
</div>
</div>
</div>
`)
const btnWrapEl = tpEl.children[0].lastElementChild.lastElementChild
/* 取消 按钮 */
btnWrapEl.children[0].onclick = () => {
editor.execCommand('onBtnClick', 'cancel')
editor.dom.remove(this, false)
}
/* 应用 按钮 */
btnWrapEl.children[1].onclick = () => {
editor.execCommand('onBtnClick', 'apply')
const divEl = document.createElement('div')
const contentEl = shadowRoot.getElementById('content')
divEl.append(...contentEl.childNodes)
editor.dom.replace(divEl, this, false)
}
const styleEl = document.createElement('style')
styleEl.textContent = `
.confirmation-box {
border-radius: 10px;
box-shadow: 0 5px 10px 0 rgba(184, 184, 184, 0.50);
padding: 12px;
box-sizing: border-box;
width: 100%;
user-select: none;
}
.confirmation-box .header {
color: #999;
font-size: 12px;
margin-bottom: 14px;
}
.confirmation-box .footer {
margin-top: 10px;
padding-top: 18px;
display: flex;
justify-content: space-between;
border-top: solid 1px #EEE;
}
.confirmation-box .footer .btn-wrapper {
display: none;
}
.confirmation-box .footer .left {
color: #999;
font-size: 12px;
display: flex;
align-items: center;
}
.confirmation-box .footer .right .cancel-btn,
.confirmation-box .footer .right .confirm-btn {
border-radius: 30px;
padding: 6px 20px;
border: 1px solid transparent;
font-size: 12px;
cursor: pointer;
}
.confirmation-box .footer .right .cancel-btn {
background-color: #eff7ff;
color: #0085ff;
border-color: #0085ff;
}
.confirmation-box .footer .right .confirm-btn {
background-color: #0085ff;
color: #fff;
}
`
tpEl.insertAdjacentElement('afterbegin', styleEl)
shadowRoot.append(...tpEl.children)
}
connectedCallback() {
if (!this.initConnect) {
const contentEl = this.shadowRoot.getElementById('content')
const contentString = editor.dom.getAttrib(this, 'data-init-text') || ''
contentEl.innerHTML = decodeURIComponent(contentString)
editor.dom.setAttrib(this, 'data-init-text', '')
this.initConnect = true
}
}
attributeChangedCallback(name, oldValue, newValue) {
// console.log(`====( 属性 ${name}:${oldValue} --》 ${newValue} )====`)
// if (name === 'data-text' && this.initConnect) {
// const contentEl = this.shadowRoot.getElementById('content')
// const contentString = editor.dom.getAttrib(this, 'data-text') || ''
// contentEl.innerHTML = decodeURIComponent(contentString)
// }
if (name === 'data-is-response-end') {
const btnWrapperEl = this.shadowRoot.querySelector('.confirmation-box .btn-wrapper')
if (newValue === 'true') {
btnWrapperEl && (btnWrapperEl.style.display = 'block')
} else {
if (btnWrapperEl && btnWrapperEl.style.display !== 'none') {
btnWrapperEl.style.display = 'none'
}
}
}
if (name === 'data-document-title' && newValue) {
const titleEl = this.shadowRoot.querySelector('.confirmation-box .document-title')
titleEl.innerHTML = `标题:${newValue}`
}
}
}
win.customElements.define('mf-confirmation-box', MfConfirmationBox)
// editor.on('keydown', (e) => {
// if (e.code === 'PageDown') {
// editor.insertContent(`<mf-confirmation-box id="fXDZDqAKHA" data-is-response-end="true" data-init-text="${encodeURIComponent('<div>这是应用内容</div>')}"></mf-confirmation-box><br />`)
// // editor.execCommand('mceSetContent', false, '<mf-confirmation-box size="100">你好</mf-confirmation-box>')
// }
// if (e.code === 'PageUp') {
// const el = editor.dom.get('fXDZDqAKHA')
// console.log(el.shadowRoot)
// // editor.dom.setAttrib(el, 'data-text', `${decodeURIComponent(editor.dom.getAttrib(el, 'data-text') || '')}${Date.now()}`)
// }
// })
})
return {
getMetadata: () => ({
name: 'content confirmation box',
url: 'https://marketingai-sit.gsstcloud.com',
}),
}
})
tinymce.PluginManager.add('mfThemeWritingApply', (editor) => {
editor.on('init', () => {
const win = editor.getWin()
class MfThemeWritingApply extends win.HTMLElement {
static observedAttributes = ['data-init-text', 'data-is-response-end', 'data-is-show-renew-btn', 'data-document-title']
constructor() {
super()
this.initConnect = false
const shadowRoot = this.attachShadow({ mode: 'open' })
const tpEl = document.createElement('template')
tpEl.insertAdjacentHTML('beforeend', `
<div contenteditable="false" class="container-wrapper theme-writing-apply-container">
<div class="header">
<span>生成内容预览</span>
</div>
<h3 class="document-title">标题:</h3>
<div id="content"></div>
<div class="footer">
<div class="left">内容由AI生成,请注意甄别真实性</div>
<div class="right btn-wrapper">
<button class="btn insert-btn">插入下方</button>
<button class="btn">全文替换</button>
<button class="btn renew-btn">重新生成</button>
<button class="btn cancel-btn">取消</button>
</div>
</div>
</div>
`)
const btnWrapEl = tpEl.children[0].lastElementChild.lastElementChild
/* 插入下方 按钮 */
btnWrapEl.children[0].onclick = () => {
editor.execCommand('onBtnClick', 'insertBelow')
const divEl = document.createElement('div')
const contentEl = this.shadowRoot.getElementById('content')
divEl.append(...contentEl.childNodes)
editor.dom.replace(divEl, this, false)
}
/* 全文替换 按钮 */
btnWrapEl.children[1].onclick = () => {
editor.execCommand('onBtnClick', 'fullTextReplacement')
const divEl = document.createElement('div')
const contentEl = this.shadowRoot.getElementById('content')
divEl.append(...contentEl.childNodes)
editor.resetContent('')
editor.insertContent(`<div>${divEl.innerHTML}</div>`)
}
/* 重新生成 按钮 */
btnWrapEl.children[2].onclick = () => {
editor.execCommand('onBtnClick', 'contentRegenerate')
editor.execCommand('creationContentRegenerate')
editor.dom.remove(this, false)
}
/* 取消 按钮 */
btnWrapEl.children[3].onclick = () => {
editor.execCommand('onBtnClick', 'cancel')
editor.dom.remove(this, false)
}
const styleEl = document.createElement('style')
styleEl.textContent = `
.container-wrapper {
border-radius: 10px;
box-shadow: 0 5px 10px 0 rgba(184, 184, 184, 0.50);
padding: 12px;
box-sizing: border-box;
width: 100%;
user-select: none;
}
.container-wrapper .header {
color: #999;
font-size: 12px;
margin-bottom: 14px;
}
.container-wrapper .footer {
margin-top: 10px;
padding-top: 18px;
display: flex;
justify-content: space-between;
border-top: solid 1px #EEE;
}
.container-wrapper .footer .btn-wrapper {
display: none;
}
.container-wrapper .footer .left {
color: #999;
font-size: 12px;
display: flex;
align-items: center;
}
.container-wrapper .footer .btn {
border-radius: 30px;
padding: 6px 20px;
border: 1px solid #0085ff;
font-size: 12px;
cursor: pointer;
background-color: #eff7ff;
color: #0085ff;
}
.container-wrapper .footer .right .insert-btn {
background-color: #0085ff;
color: #fff;
}
.container-wrapper .footer .right .renew-btn {
display: none;
}
.container-wrapper .footer .right .cancel-btn {
background-color: #fff;
color: unset;
border-color: #cacaca;
}
`
tpEl.insertAdjacentElement('afterbegin', styleEl)
this.shadowRoot.append(...tpEl.children)
}
connectedCallback() {
if (!this.initConnect) {
const contentEl = this.shadowRoot.getElementById('content')
const contentString = editor.dom.getAttrib(this, 'data-init-text') || ''
contentEl.innerHTML = decodeURIComponent(contentString)
editor.dom.setAttrib(this, 'data-init-text', '')
this.initConnect = true
}
// const isResponseEnd = editor.dom.getAttrib(this, 'data-is-response-end')
// if (isResponseEnd === 'true') {
// const btnWrapperEl = this.shadowRoot.querySelector('.btn-wrapper')
// btnWrapperEl && (btnWrapperEl.style.display = 'block')
// }
}
attributeChangedCallback(name, oldValue, newValue) {
// console.log(`====( 属性 ${name}:${oldValue} --》 ${newValue} )====`)
if (name === 'data-is-response-end') {
const btnWrapperEl = this.shadowRoot.querySelector('.theme-writing-apply-container .btn-wrapper')
if (newValue === 'true') {
btnWrapperEl && (btnWrapperEl.style.display = 'block')
} else {
if (btnWrapperEl && btnWrapperEl.style.display !== 'none') {
btnWrapperEl.style.display = 'none'
}
}
}
if (name === 'data-is-show-renew-btn' && newValue === 'true') {
const renewBtnEl = this.shadowRoot.querySelector('.theme-writing-apply-container .btn-wrapper .renew-btn')
renewBtnEl && (renewBtnEl.style.display = 'inline-block')
}
if (name === 'data-document-title' && newValue) {
const titleEl = this.shadowRoot.querySelector('.theme-writing-apply-container .document-title')
titleEl.innerHTML = `标题:${newValue}`
}
}
}
win.customElements.define('mf-theme-writing-apply', MfThemeWritingApply)
// editor.on('keydown', (e) => {
// if (e.code === 'PageDown') {
// editor.execCommand('InsertHTML', false, `<mf-theme-writing-apply data-is-response-end="true" data-is-show-renew-btn="true"></mf-theme-writing-apply>`)
// editor.selection.collapse()
// }
// // if (e.code === 'PageUp') {
// // const el = editor.dom.get('fXDZDqAKHA')
// // console.log(el.shadowRoot)
// // // editor.dom.setAttrib(el, 'data-text', `${decodeURIComponent(editor.dom.getAttrib(el, 'data-text') || '')}${Date.now()}`)
// // }
// })
})
return {
getMetadata: () => ({
name: 'theme writing apply',
url: 'https://marketingai-sit.gsstcloud.com',
}),
}
})
{
"name": "tinymce",
"description": "Web based JavaScript HTML WYSIWYG editor control.",
"license": "GPL-2.0-or-later",
"keywords": [
"wysiwyg",
"tinymce",
"richtext",
"javascript",
"html",
"text",
"rich editor",
"rich text editor",
"rte",
"rich text",
"contenteditable",
"editing"
],
"homepage": "https://www.tiny.cloud/",
"ignore": [
"README.md",
"composer.json",
"package.json",
".npmignore",
"CHANGELOG.md"
]
}
\ No newline at end of file
{
"name": "tinymce/tinymce",
"version": "7.1.2",
"description": "Web based JavaScript HTML WYSIWYG editor control.",
"license": [
"GPL-2.0-or-later"
],
"keywords": [
"wysiwyg",
"tinymce",
"richtext",
"javascript",
"html",
"text",
"rich editor",
"rich text editor",
"rte",
"rich text",
"contenteditable",
"editing"
],
"homepage": "https://www.tiny.cloud/",
"type": "component",
"extra": {
"component": {
"scripts": [
"tinymce.js",
"plugins/*/plugin.js",
"themes/*/theme.js",
"models/*/model.js",
"icons/*/icons.js"
],
"files": [
"tinymce.min.js",
"plugins/*/plugin.min.js",
"themes/*/theme.min.js",
"models/*/model.min.js",
"skins/**",
"icons/*/icons.min.js"
]
}
},
"archive": {
"exclude": [
"README.md",
"bower.js",
"package.json",
".npmignore",
"CHANGELOG.md"
]
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
// Exports the "default" icons for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/icons/default')
// ES2015:
// import 'tinymce/icons/default'
require('./icons.js');
\ No newline at end of file
This diff is collapsed.
// Exports the "dom" model for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/models/dom')
// ES2015:
// import 'tinymce/models/dom'
require('./model.js');
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
{
"name": "tinymce",
"version": "7.1.2",
"repository": {
"type": "git",
"url": "https://github.com/tinymce/tinymce.git",
"directory": "modules/tinymce"
},
"description": "Web based JavaScript HTML WYSIWYG editor control.",
"author": "Ephox Corporation DBA Tiny Technologies, Inc",
"main": "tinymce.js",
"types": "tinymce.d.ts",
"license": "GPL-2.0-or-later",
"keywords": [
"wysiwyg",
"tinymce",
"richtext",
"javascript",
"html",
"text",
"rich editor",
"rich text editor",
"rte",
"rich text",
"contenteditable",
"editing"
],
"homepage": "https://www.tiny.cloud/",
"bugs": {
"url": "https://github.com/tinymce/tinymce/issues"
}
}
\ No newline at end of file
// Exports the "accordion" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/accordion')
// ES2015:
// import 'tinymce/plugins/accordion'
require('./plugin.js');
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
// Exports the "advlist" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/advlist')
// ES2015:
// import 'tinymce/plugins/advlist'
require('./plugin.js');
\ No newline at end of file
/**
* TinyMCE version 7.1.2 (TBD)
*/
(function () {
'use strict';
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
const applyListFormat = (editor, listName, styleValue) => {
const cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList';
editor.execCommand(cmd, false, styleValue === false ? null : { 'list-style-type': styleValue });
};
const register$2 = editor => {
editor.addCommand('ApplyUnorderedListStyle', (ui, value) => {
applyListFormat(editor, 'UL', value['list-style-type']);
});
editor.addCommand('ApplyOrderedListStyle', (ui, value) => {
applyListFormat(editor, 'OL', value['list-style-type']);
});
};
const option = name => editor => editor.options.get(name);
const register$1 = editor => {
const registerOption = editor.options.register;
registerOption('advlist_number_styles', {
processor: 'string[]',
default: 'default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman'.split(',')
});
registerOption('advlist_bullet_styles', {
processor: 'string[]',
default: 'default,circle,square'.split(',')
});
};
const getNumberStyles = option('advlist_number_styles');
const getBulletStyles = option('advlist_bullet_styles');
const isNullable = a => a === null || a === undefined;
const isNonNullable = a => !isNullable(a);
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
class Optional {
constructor(tag, value) {
this.tag = tag;
this.value = value;
}
static some(value) {
return new Optional(true, value);
}
static none() {
return Optional.singletonNone;
}
fold(onNone, onSome) {
if (this.tag) {
return onSome(this.value);
} else {
return onNone();
}
}
isSome() {
return this.tag;
}
isNone() {
return !this.tag;
}
map(mapper) {
if (this.tag) {
return Optional.some(mapper(this.value));
} else {
return Optional.none();
}
}
bind(binder) {
if (this.tag) {
return binder(this.value);
} else {
return Optional.none();
}
}
exists(predicate) {
return this.tag && predicate(this.value);
}
forall(predicate) {
return !this.tag || predicate(this.value);
}
filter(predicate) {
if (!this.tag || predicate(this.value)) {
return this;
} else {
return Optional.none();
}
}
getOr(replacement) {
return this.tag ? this.value : replacement;
}
or(replacement) {
return this.tag ? this : replacement;
}
getOrThunk(thunk) {
return this.tag ? this.value : thunk();
}
orThunk(thunk) {
return this.tag ? this : thunk();
}
getOrDie(message) {
if (!this.tag) {
throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
} else {
return this.value;
}
}
static from(value) {
return isNonNullable(value) ? Optional.some(value) : Optional.none();
}
getOrNull() {
return this.tag ? this.value : null;
}
getOrUndefined() {
return this.value;
}
each(worker) {
if (this.tag) {
worker(this.value);
}
}
toArray() {
return this.tag ? [this.value] : [];
}
toString() {
return this.tag ? `some(${ this.value })` : 'none()';
}
}
Optional.singletonNone = new Optional(false);
const findUntil = (xs, pred, until) => {
for (let i = 0, len = xs.length; i < len; i++) {
const x = xs[i];
if (pred(x, i)) {
return Optional.some(x);
} else if (until(x, i)) {
break;
}
}
return Optional.none();
};
const isCustomList = list => /\btox\-/.test(list.className);
const isChildOfBody = (editor, elm) => {
return editor.dom.isChildOf(elm, editor.getBody());
};
const matchNodeNames = regex => node => isNonNullable(node) && regex.test(node.nodeName);
const isListNode = matchNodeNames(/^(OL|UL|DL)$/);
const isTableCellNode = matchNodeNames(/^(TH|TD)$/);
const inList = (editor, parents, nodeName) => findUntil(parents, parent => isListNode(parent) && !isCustomList(parent), isTableCellNode).exists(list => list.nodeName === nodeName && isChildOfBody(editor, list));
const getSelectedStyleType = editor => {
const listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
const style = editor.dom.getStyle(listElm, 'listStyleType');
return Optional.from(style);
};
const isWithinNonEditable = (editor, element) => element !== null && !editor.dom.isEditable(element);
const isWithinNonEditableList = (editor, element) => {
const parentList = editor.dom.getParent(element, 'ol,ul,dl');
return isWithinNonEditable(editor, parentList) && editor.selection.isEditable();
};
const setNodeChangeHandler = (editor, nodeChangeHandler) => {
const initialNode = editor.selection.getNode();
nodeChangeHandler({
parents: editor.dom.getParents(initialNode),
element: initialNode
});
editor.on('NodeChange', nodeChangeHandler);
return () => editor.off('NodeChange', nodeChangeHandler);
};
const styleValueToText = styleValue => {
return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, chr => {
return chr.toUpperCase();
});
};
const normalizeStyleValue = styleValue => isNullable(styleValue) || styleValue === 'default' ? '' : styleValue;
const makeSetupHandler = (editor, nodeName) => api => {
const updateButtonState = (editor, parents) => {
const element = editor.selection.getStart(true);
api.setActive(inList(editor, parents, nodeName));
api.setEnabled(!isWithinNonEditableList(editor, element) && editor.selection.isEditable());
};
const nodeChangeHandler = e => updateButtonState(editor, e.parents);
return setNodeChangeHandler(editor, nodeChangeHandler);
};
const addSplitButton = (editor, id, tooltip, cmd, nodeName, styles) => {
editor.ui.registry.addSplitButton(id, {
tooltip,
icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list',
presets: 'listpreview',
columns: 3,
fetch: callback => {
const items = global.map(styles, styleValue => {
const iconStyle = nodeName === 'OL' ? 'num' : 'bull';
const iconName = styleValue === 'disc' || styleValue === 'decimal' ? 'default' : styleValue;
const itemValue = normalizeStyleValue(styleValue);
const displayText = styleValueToText(styleValue);
return {
type: 'choiceitem',
value: itemValue,
icon: 'list-' + iconStyle + '-' + iconName,
text: displayText
};
});
callback(items);
},
onAction: () => editor.execCommand(cmd),
onItemAction: (_splitButtonApi, value) => {
applyListFormat(editor, nodeName, value);
},
select: value => {
const listStyleType = getSelectedStyleType(editor);
return listStyleType.map(listStyle => value === listStyle).getOr(false);
},
onSetup: makeSetupHandler(editor, nodeName)
});
};
const addButton = (editor, id, tooltip, cmd, nodeName, styleValue) => {
editor.ui.registry.addToggleButton(id, {
active: false,
tooltip,
icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list',
onSetup: makeSetupHandler(editor, nodeName),
onAction: () => editor.queryCommandState(cmd) || styleValue === '' ? editor.execCommand(cmd) : applyListFormat(editor, nodeName, styleValue)
});
};
const addControl = (editor, id, tooltip, cmd, nodeName, styles) => {
if (styles.length > 1) {
addSplitButton(editor, id, tooltip, cmd, nodeName, styles);
} else {
addButton(editor, id, tooltip, cmd, nodeName, normalizeStyleValue(styles[0]));
}
};
const register = editor => {
addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', 'OL', getNumberStyles(editor));
addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', getBulletStyles(editor));
};
var Plugin = () => {
global$1.add('advlist', editor => {
if (editor.hasPlugin('lists')) {
register$1(editor);
register(editor);
register$2(editor);
} else {
console.error('Please use the Lists plugin together with the List Styles plugin.');
}
});
};
Plugin();
})();
/**
* TinyMCE version 7.1.2 (TBD)
*/
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(t,e,s)=>{const r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===s?null:{"list-style-type":s})},s=t=>e=>e.options.get(t),r=s("advlist_number_styles"),n=s("advlist_bullet_styles"),i=t=>null==t,l=t=>!i(t);var o=tinymce.util.Tools.resolve("tinymce.util.Tools");class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return l(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=t=>e=>l(e)&&t.test(e.nodeName),d=u(/^(OL|UL|DL)$/),g=u(/^(TH|TD)$/),c=t=>i(t)||"default"===t?"":t,h=(t,e)=>s=>((t,e)=>{const s=t.selection.getNode();return e({parents:t.dom.getParents(s),element:s}),t.on("NodeChange",e),()=>t.off("NodeChange",e)})(t,(r=>((t,r)=>{const n=t.selection.getStart(!0);s.setActive(((t,e,s)=>((t,e,s)=>{for(let e=0,n=t.length;e<n;e++){const n=t[e];if(d(r=n)&&!/\btox\-/.test(r.className))return a.some(n);if(s(n,e))break}var r;return a.none()})(e,0,g).exists((e=>e.nodeName===s&&((t,e)=>t.dom.isChildOf(e,t.getBody()))(t,e))))(t,r,e)),s.setEnabled(!((t,e)=>{const s=t.dom.getParent(e,"ol,ul,dl");return((t,e)=>null!==e&&!t.dom.isEditable(e))(t,s)&&t.selection.isEditable()})(t,n)&&t.selection.isEditable())})(t,r.parents))),m=(t,s,r,n,i,l)=>{l.length>1?((t,s,r,n,i,l)=>{t.ui.registry.addSplitButton(s,{tooltip:r,icon:"OL"===i?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:t=>{t(o.map(l,(t=>{const e="OL"===i?"num":"bull",s="disc"===t||"decimal"===t?"default":t,r=c(t),n=(t=>t.replace(/\-/g," ").replace(/\b\w/g,(t=>t.toUpperCase())))(t);return{type:"choiceitem",value:r,icon:"list-"+e+"-"+s,text:n}})))},onAction:()=>t.execCommand(n),onItemAction:(s,r)=>{e(t,i,r)},select:e=>{const s=(t=>{const e=t.dom.getParent(t.selection.getNode(),"ol,ul"),s=t.dom.getStyle(e,"listStyleType");return a.from(s)})(t);return s.map((t=>e===t)).getOr(!1)},onSetup:h(t,i)})})(t,s,r,n,i,l):((t,s,r,n,i,l)=>{t.ui.registry.addToggleButton(s,{active:!1,tooltip:r,icon:"OL"===i?"ordered-list":"unordered-list",onSetup:h(t,i),onAction:()=>t.queryCommandState(n)||""===l?t.execCommand(n):e(t,i,l)})})(t,s,r,n,i,c(l[0]))};t.add("advlist",(t=>{t.hasPlugin("lists")?((t=>{const e=t.options.register;e("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),e("advlist_bullet_styles",{processor:"string[]",default:"default,circle,square".split(",")})})(t),(t=>{m(t,"numlist","Numbered list","InsertOrderedList","OL",r(t)),m(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))})(t),(t=>{t.addCommand("ApplyUnorderedListStyle",((s,r)=>{e(t,"UL",r["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",((s,r)=>{e(t,"OL",r["list-style-type"])}))})(t)):console.error("Please use the Lists plugin together with the List Styles plugin.")}))}();
\ No newline at end of file
// Exports the "anchor" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/anchor')
// ES2015:
// import 'tinymce/plugins/anchor'
require('./plugin.js');
\ No newline at end of file
/**
* TinyMCE version 7.1.2 (TBD)
*/
(function () {
'use strict';
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
const option = name => editor => editor.options.get(name);
const register$2 = editor => {
const registerOption = editor.options.register;
registerOption('allow_html_in_named_anchor', {
processor: 'boolean',
default: false
});
};
const allowHtmlInNamedAnchor = option('allow_html_in_named_anchor');
const namedAnchorSelector = 'a:not([href])';
const isEmptyString = str => !str;
const getIdFromAnchor = elm => {
const id = elm.getAttribute('id') || elm.getAttribute('name');
return id || '';
};
const isAnchor = elm => elm.nodeName.toLowerCase() === 'a';
const isNamedAnchor = elm => isAnchor(elm) && !elm.getAttribute('href') && getIdFromAnchor(elm) !== '';
const isEmptyNamedAnchor = elm => isNamedAnchor(elm) && !elm.firstChild;
const removeEmptyNamedAnchorsInSelection = editor => {
const dom = editor.dom;
global$1(dom).walk(editor.selection.getRng(), nodes => {
global.each(nodes, node => {
if (isEmptyNamedAnchor(node)) {
dom.remove(node, false);
}
});
});
};
const isValidId = id => /^[A-Za-z][A-Za-z0-9\-:._]*$/.test(id);
const getNamedAnchor = editor => editor.dom.getParent(editor.selection.getStart(), namedAnchorSelector);
const getId = editor => {
const anchor = getNamedAnchor(editor);
if (anchor) {
return getIdFromAnchor(anchor);
} else {
return '';
}
};
const createAnchor = (editor, id) => {
editor.undoManager.transact(() => {
if (!allowHtmlInNamedAnchor(editor)) {
editor.selection.collapse(true);
}
if (editor.selection.isCollapsed()) {
editor.insertContent(editor.dom.createHTML('a', { id }));
} else {
removeEmptyNamedAnchorsInSelection(editor);
editor.formatter.remove('namedAnchor', undefined, undefined, true);
editor.formatter.apply('namedAnchor', { value: id });
editor.addVisual();
}
});
};
const updateAnchor = (editor, id, anchorElement) => {
anchorElement.removeAttribute('name');
anchorElement.id = id;
editor.addVisual();
editor.undoManager.add();
};
const insert = (editor, id) => {
const anchor = getNamedAnchor(editor);
if (anchor) {
updateAnchor(editor, id, anchor);
} else {
createAnchor(editor, id);
}
editor.focus();
};
const insertAnchor = (editor, newId) => {
if (!isValidId(newId)) {
editor.windowManager.alert('ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.');
return false;
} else {
insert(editor, newId);
return true;
}
};
const open = editor => {
const currentId = getId(editor);
editor.windowManager.open({
title: 'Anchor',
size: 'normal',
body: {
type: 'panel',
items: [{
name: 'id',
type: 'input',
label: 'ID',
placeholder: 'example'
}]
},
buttons: [
{
type: 'cancel',
name: 'cancel',
text: 'Cancel'
},
{
type: 'submit',
name: 'save',
text: 'Save',
primary: true
}
],
initialData: { id: currentId },
onSubmit: api => {
if (insertAnchor(editor, api.getData().id)) {
api.close();
}
}
});
};
const register$1 = editor => {
editor.addCommand('mceAnchor', () => {
open(editor);
});
};
const isNamedAnchorNode = node => isEmptyString(node.attr('href')) && !isEmptyString(node.attr('id') || node.attr('name'));
const isEmptyNamedAnchorNode = node => isNamedAnchorNode(node) && !node.firstChild;
const setContentEditable = state => nodes => {
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if (isEmptyNamedAnchorNode(node)) {
node.attr('contenteditable', state);
}
}
};
const setup = editor => {
editor.on('PreInit', () => {
editor.parser.addNodeFilter('a', setContentEditable('false'));
editor.serializer.addNodeFilter('a', setContentEditable(null));
});
};
const registerFormats = editor => {
editor.formatter.register('namedAnchor', {
inline: 'a',
selector: namedAnchorSelector,
remove: 'all',
split: true,
deep: true,
attributes: { id: '%value' },
onmatch: (node, _fmt, _itemName) => {
return isNamedAnchor(node);
}
});
};
const onSetupEditable = editor => api => {
const nodeChanged = () => {
api.setEnabled(editor.selection.isEditable());
};
editor.on('NodeChange', nodeChanged);
nodeChanged();
return () => {
editor.off('NodeChange', nodeChanged);
};
};
const register = editor => {
const onAction = () => editor.execCommand('mceAnchor');
editor.ui.registry.addToggleButton('anchor', {
icon: 'bookmark',
tooltip: 'Anchor',
onAction,
onSetup: buttonApi => {
const unbindSelectorChanged = editor.selection.selectorChangedWithUnbind('a:not([href])', buttonApi.setActive).unbind;
const unbindEditableChanged = onSetupEditable(editor)(buttonApi);
return () => {
unbindSelectorChanged();
unbindEditableChanged();
};
}
});
editor.ui.registry.addMenuItem('anchor', {
icon: 'bookmark',
text: 'Anchor...',
onAction,
onSetup: onSetupEditable(editor)
});
};
var Plugin = () => {
global$2.add('anchor', editor => {
register$2(editor);
setup(editor);
register$1(editor);
register(editor);
editor.on('PreInit', () => {
registerFormats(editor);
});
});
};
Plugin();
})();
/**
* TinyMCE version 7.1.2 (TBD)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=("allow_html_in_named_anchor",e=>e.options.get("allow_html_in_named_anchor"));const a="a:not([href])",r=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),d=(e,a)=>{const r=s(e);r?((e,t,o)=>{o.removeAttribute("name"),o.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact((()=>{n(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const n=e.dom;t(n).walk(e.selection.getRng(),(e=>{o.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&n.remove(e,!1)}))}))})(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())}))})(e,a),e.focus()},c=e=>(e=>r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let o=0;o<t.length;o++){const n=t[o];c(n)&&n.attr("contenteditable",e)}},u=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",m("false")),e.serializer.addNodeFilter("a",m(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{(e=>{const t=(e=>{const t=s(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(d(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})})(e)}))})(e),(e=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>{const o=e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind,n=u(e)(t);return()=>{o(),n()}}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t,onSetup:u(e)})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,o)=>l(e)})})(e)}))}))}();
\ No newline at end of file
// Exports the "autolink" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/autolink')
// ES2015:
// import 'tinymce/plugins/autolink'
require('./plugin.js');
\ No newline at end of file
/**
* TinyMCE version 7.1.2 (TBD)
*/
(function () {
'use strict';
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
const link = () => /(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g;
const option = name => editor => editor.options.get(name);
const register = editor => {
const registerOption = editor.options.register;
registerOption('autolink_pattern', {
processor: 'regexp',
default: new RegExp('^' + link().source + '$', 'i')
});
registerOption('link_default_target', { processor: 'string' });
registerOption('link_default_protocol', {
processor: 'string',
default: 'https'
});
};
const getAutoLinkPattern = option('autolink_pattern');
const getDefaultLinkTarget = option('link_default_target');
const getDefaultLinkProtocol = option('link_default_protocol');
const allowUnsafeLinkTarget = option('allow_unsafe_link_target');
const hasProto = (v, constructor, predicate) => {
var _a;
if (predicate(v, constructor.prototype)) {
return true;
} else {
return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
}
};
const typeOf = x => {
const t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && Array.isArray(x)) {
return 'array';
} else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
return 'string';
} else {
return t;
}
};
const isType = type => value => typeOf(value) === type;
const eq = t => a => t === a;
const isString = isType('string');
const isUndefined = eq(undefined);
const isNullable = a => a === null || a === undefined;
const isNonNullable = a => !isNullable(a);
const not = f => t => !f(t);
const hasOwnProperty = Object.hasOwnProperty;
const has = (obj, key) => hasOwnProperty.call(obj, key);
const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
const contains = (str, substr, start = 0, end) => {
const idx = str.indexOf(substr, start);
if (idx !== -1) {
return isUndefined(end) ? true : idx + substr.length <= end;
} else {
return false;
}
};
const startsWith = (str, prefix) => {
return checkRange(str, prefix, 0);
};
const zeroWidth = '\uFEFF';
const isZwsp = char => char === zeroWidth;
const removeZwsp = s => s.replace(/\uFEFF/g, '');
var global = tinymce.util.Tools.resolve('tinymce.dom.TextSeeker');
const isTextNode = node => node.nodeType === 3;
const isElement = node => node.nodeType === 1;
const isBracketOrSpace = char => /^[(\[{ \u00a0]$/.test(char);
const hasProtocol = url => /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
const isPunctuation = char => /[?!,.;:]/.test(char);
const findChar = (text, index, predicate) => {
for (let i = index - 1; i >= 0; i--) {
const char = text.charAt(i);
if (!isZwsp(char) && predicate(char)) {
return i;
}
}
return -1;
};
const freefallRtl = (container, offset) => {
let tempNode = container;
let tempOffset = offset;
while (isElement(tempNode) && tempNode.childNodes[tempOffset]) {
tempNode = tempNode.childNodes[tempOffset];
tempOffset = isTextNode(tempNode) ? tempNode.data.length : tempNode.childNodes.length;
}
return {
container: tempNode,
offset: tempOffset
};
};
const parseCurrentLine = (editor, offset) => {
var _a;
const voidElements = editor.schema.getVoidElements();
const autoLinkPattern = getAutoLinkPattern(editor);
const {dom, selection} = editor;
if (dom.getParent(selection.getNode(), 'a[href]') !== null) {
return null;
}
const rng = selection.getRng();
const textSeeker = global(dom, node => {
return dom.isBlock(node) || has(voidElements, node.nodeName.toLowerCase()) || dom.getContentEditable(node) === 'false';
});
const {
container: endContainer,
offset: endOffset
} = freefallRtl(rng.endContainer, rng.endOffset);
const root = (_a = dom.getParent(endContainer, dom.isBlock)) !== null && _a !== void 0 ? _a : dom.getRoot();
const endSpot = textSeeker.backwards(endContainer, endOffset + offset, (node, offset) => {
const text = node.data;
const idx = findChar(text, offset, not(isBracketOrSpace));
return idx === -1 || isPunctuation(text[idx]) ? idx : idx + 1;
}, root);
if (!endSpot) {
return null;
}
let lastTextNode = endSpot.container;
const startSpot = textSeeker.backwards(endSpot.container, endSpot.offset, (node, offset) => {
lastTextNode = node;
const idx = findChar(node.data, offset, isBracketOrSpace);
return idx === -1 ? idx : idx + 1;
}, root);
const newRng = dom.createRng();
if (!startSpot) {
newRng.setStart(lastTextNode, 0);
} else {
newRng.setStart(startSpot.container, startSpot.offset);
}
newRng.setEnd(endSpot.container, endSpot.offset);
const rngText = removeZwsp(newRng.toString());
const matches = rngText.match(autoLinkPattern);
if (matches) {
let url = matches[0];
if (startsWith(url, 'www.')) {
const protocol = getDefaultLinkProtocol(editor);
url = protocol + '://' + url;
} else if (contains(url, '@') && !hasProtocol(url)) {
url = 'mailto:' + url;
}
return {
rng: newRng,
url
};
} else {
return null;
}
};
const convertToLink = (editor, result) => {
const {dom, selection} = editor;
const {rng, url} = result;
const bookmark = selection.getBookmark();
selection.setRng(rng);
const command = 'createlink';
const args = {
command,
ui: false,
value: url
};
const beforeExecEvent = editor.dispatch('BeforeExecCommand', args);
if (!beforeExecEvent.isDefaultPrevented()) {
editor.getDoc().execCommand(command, false, url);
editor.dispatch('ExecCommand', args);
const defaultLinkTarget = getDefaultLinkTarget(editor);
if (isString(defaultLinkTarget)) {
const anchor = selection.getNode();
dom.setAttrib(anchor, 'target', defaultLinkTarget);
if (defaultLinkTarget === '_blank' && !allowUnsafeLinkTarget(editor)) {
dom.setAttrib(anchor, 'rel', 'noopener');
}
}
}
selection.moveToBookmark(bookmark);
editor.nodeChanged();
};
const handleSpacebar = editor => {
const result = parseCurrentLine(editor, -1);
if (isNonNullable(result)) {
convertToLink(editor, result);
}
};
const handleBracket = handleSpacebar;
const handleEnter = editor => {
const result = parseCurrentLine(editor, 0);
if (isNonNullable(result)) {
convertToLink(editor, result);
}
};
const setup = editor => {
editor.on('keydown', e => {
if (e.keyCode === 13 && !e.isDefaultPrevented()) {
handleEnter(editor);
}
});
editor.on('keyup', e => {
if (e.keyCode === 32) {
handleSpacebar(editor);
} else if (e.keyCode === 48 && e.shiftKey || e.keyCode === 221) {
handleBracket(editor);
}
});
};
var Plugin = () => {
global$1.add('autolink', editor => {
register(editor);
setup(editor);
});
};
Plugin();
})();
/**
* TinyMCE version 7.1.2 (TBD)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),n=t("autolink_pattern"),o=t("link_default_target"),r=t("link_default_protocol"),a=t("allow_unsafe_link_target"),s=("string",e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||(null===(a=o.constructor)||void 0===a?void 0:a.name)===r.name)?"string":t;var n,o,r,a})(e));const l=(void 0,e=>undefined===e);const i=e=>!(e=>null==e)(e),c=Object.hasOwnProperty,d=e=>"\ufeff"===e;var u=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker");const f=e=>/^[(\[{ \u00a0]$/.test(e),g=(e,t,n)=>{for(let o=t-1;o>=0;o--){const t=e.charAt(o);if(!d(t)&&n(t))return o}return-1},m=(e,t)=>{var o;const a=e.schema.getVoidElements(),s=n(e),{dom:i,selection:d}=e;if(null!==i.getParent(d.getNode(),"a[href]"))return null;const m=d.getRng(),k=u(i,(e=>{return i.isBlock(e)||(t=a,n=e.nodeName.toLowerCase(),c.call(t,n))||"false"===i.getContentEditable(e);var t,n})),{container:p,offset:y}=((e,t)=>{let n=e,o=t;for(;1===n.nodeType&&n.childNodes[o];)n=n.childNodes[o],o=3===n.nodeType?n.data.length:n.childNodes.length;return{container:n,offset:o}})(m.endContainer,m.endOffset),w=null!==(o=i.getParent(p,i.isBlock))&&void 0!==o?o:i.getRoot(),h=k.backwards(p,y+t,((e,t)=>{const n=e.data,o=g(n,t,(r=f,e=>!r(e)));var r,a;return-1===o||(a=n[o],/[?!,.;:]/.test(a))?o:o+1}),w);if(!h)return null;let v=h.container;const _=k.backwards(h.container,h.offset,((e,t)=>{v=e;const n=g(e.data,t,f);return-1===n?n:n+1}),w),A=i.createRng();_?A.setStart(_.container,_.offset):A.setStart(v,0),A.setEnd(h.container,h.offset);const C=A.toString().replace(/\uFEFF/g,"").match(s);if(C){let t=C[0];return $="www.",(b=t).length>=4&&b.substr(0,4)===$?t=r(e)+"://"+t:((e,t,n=0,o)=>{const r=e.indexOf(t,n);return-1!==r&&(!!l(o)||r+t.length<=o)})(t,"@")&&!(e=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e))(t)&&(t="mailto:"+t),{rng:A,url:t}}var b,$;return null},k=(e,t)=>{const{dom:n,selection:r}=e,{rng:l,url:i}=t,c=r.getBookmark();r.setRng(l);const d="createlink",u={command:d,ui:!1,value:i};if(!e.dispatch("BeforeExecCommand",u).isDefaultPrevented()){e.getDoc().execCommand(d,!1,i),e.dispatch("ExecCommand",u);const t=o(e);if(s(t)){const o=r.getNode();n.setAttrib(o,"target",t),"_blank"!==t||a(e)||n.setAttrib(o,"rel","noopener")}}r.moveToBookmark(c),e.nodeChanged()},p=e=>{const t=m(e,-1);i(t)&&k(e,t)},y=p;e.add("autolink",(e=>{(e=>{const t=e.options.register;t("autolink_pattern",{processor:"regexp",default:new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i")}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"})})(e),(e=>{e.on("keydown",(t=>{13!==t.keyCode||t.isDefaultPrevented()||(e=>{const t=m(e,0);i(t)&&k(e,t)})(e)})),e.on("keyup",(t=>{32===t.keyCode?p(e):(48===t.keyCode&&t.shiftKey||221===t.keyCode)&&y(e)}))})(e)}))}();
\ No newline at end of file
// Exports the "autoresize" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/autoresize')
// ES2015:
// import 'tinymce/plugins/autoresize'
require('./plugin.js');
\ No newline at end of file
/**
* TinyMCE version 7.1.2 (TBD)
*/
(function () {
'use strict';
const Cell = initial => {
let value = initial;
const get = () => {
return value;
};
const set = v => {
value = v;
};
return {
get,
set
};
};
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
const constant = value => {
return () => {
return value;
};
};
var global = tinymce.util.Tools.resolve('tinymce.Env');
const fireResizeEditor = editor => editor.dispatch('ResizeEditor');
const option = name => editor => editor.options.get(name);
const register$1 = editor => {
const registerOption = editor.options.register;
registerOption('autoresize_overflow_padding', {
processor: 'number',
default: 1
});
registerOption('autoresize_bottom_margin', {
processor: 'number',
default: 50
});
};
const getMinHeight = option('min_height');
const getMaxHeight = option('max_height');
const getAutoResizeOverflowPadding = option('autoresize_overflow_padding');
const getAutoResizeBottomMargin = option('autoresize_bottom_margin');
const isFullscreen = editor => editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
const toggleScrolling = (editor, state) => {
const body = editor.getBody();
if (body) {
body.style.overflowY = state ? '' : 'hidden';
if (!state) {
body.scrollTop = 0;
}
}
};
const parseCssValueToInt = (dom, elm, name, computed) => {
var _a;
const value = parseInt((_a = dom.getStyle(elm, name, computed)) !== null && _a !== void 0 ? _a : '', 10);
return isNaN(value) ? 0 : value;
};
const shouldScrollIntoView = trigger => {
if ((trigger === null || trigger === void 0 ? void 0 : trigger.type.toLowerCase()) === 'setcontent') {
const setContentEvent = trigger;
return setContentEvent.selection === true || setContentEvent.paste === true;
} else {
return false;
}
};
const resize = (editor, oldSize, trigger, getExtraMarginBottom) => {
var _a;
const dom = editor.dom;
const doc = editor.getDoc();
if (!doc) {
return;
}
if (isFullscreen(editor)) {
toggleScrolling(editor, true);
return;
}
const docEle = doc.documentElement;
const resizeBottomMargin = getExtraMarginBottom ? getExtraMarginBottom() : getAutoResizeOverflowPadding(editor);
const minHeight = (_a = getMinHeight(editor)) !== null && _a !== void 0 ? _a : editor.getElement().offsetHeight;
let resizeHeight = minHeight;
const marginTop = parseCssValueToInt(dom, docEle, 'margin-top', true);
const marginBottom = parseCssValueToInt(dom, docEle, 'margin-bottom', true);
let contentHeight = docEle.offsetHeight + marginTop + marginBottom + resizeBottomMargin;
if (contentHeight < 0) {
contentHeight = 0;
}
const containerHeight = editor.getContainer().offsetHeight;
const contentAreaHeight = editor.getContentAreaContainer().offsetHeight;
const chromeHeight = containerHeight - contentAreaHeight;
if (contentHeight + chromeHeight > minHeight) {
resizeHeight = contentHeight + chromeHeight;
}
const maxHeight = getMaxHeight(editor);
if (maxHeight && resizeHeight > maxHeight) {
resizeHeight = maxHeight;
toggleScrolling(editor, true);
} else {
toggleScrolling(editor, false);
}
if (resizeHeight !== oldSize.get()) {
const deltaSize = resizeHeight - oldSize.get();
dom.setStyle(editor.getContainer(), 'height', resizeHeight + 'px');
oldSize.set(resizeHeight);
fireResizeEditor(editor);
if (global.browser.isSafari() && (global.os.isMacOS() || global.os.isiOS())) {
const win = editor.getWin();
win.scrollTo(win.pageXOffset, win.pageYOffset);
}
if (editor.hasFocus() && shouldScrollIntoView(trigger)) {
editor.selection.scrollIntoView();
}
if ((global.browser.isSafari() || global.browser.isChromium()) && deltaSize < 0) {
resize(editor, oldSize, trigger, getExtraMarginBottom);
}
}
};
const setup = (editor, oldSize) => {
let getExtraMarginBottom = () => getAutoResizeBottomMargin(editor);
let resizeCounter;
let sizeAfterFirstResize;
editor.on('init', e => {
resizeCounter = 0;
const overflowPadding = getAutoResizeOverflowPadding(editor);
const dom = editor.dom;
dom.setStyles(editor.getDoc().documentElement, { height: 'auto' });
if (global.browser.isEdge() || global.browser.isIE()) {
dom.setStyles(editor.getBody(), {
'paddingLeft': overflowPadding,
'paddingRight': overflowPadding,
'min-height': 0
});
} else {
dom.setStyles(editor.getBody(), {
paddingLeft: overflowPadding,
paddingRight: overflowPadding
});
}
resize(editor, oldSize, e, getExtraMarginBottom);
resizeCounter += 1;
});
editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', e => {
if (resizeCounter === 1) {
sizeAfterFirstResize = editor.getContainer().offsetHeight;
resize(editor, oldSize, e, getExtraMarginBottom);
resizeCounter += 1;
} else if (resizeCounter === 2) {
const isLooping = sizeAfterFirstResize < editor.getContainer().offsetHeight;
if (isLooping) {
const dom = editor.dom;
const doc = editor.getDoc();
dom.setStyles(doc.documentElement, { 'min-height': 0 });
dom.setStyles(editor.getBody(), { 'min-height': 'inherit' });
}
getExtraMarginBottom = isLooping ? constant(0) : getExtraMarginBottom;
resizeCounter += 1;
} else {
resize(editor, oldSize, e, getExtraMarginBottom);
}
});
};
const register = (editor, oldSize) => {
editor.addCommand('mceAutoResize', () => {
resize(editor, oldSize);
});
};
var Plugin = () => {
global$1.add('autoresize', editor => {
register$1(editor);
if (!editor.options.isSet('resize')) {
editor.options.set('resize', false);
}
if (!editor.inline) {
const oldSize = Cell(0);
register(editor, oldSize);
setup(editor, oldSize);
}
});
};
Plugin();
})();
/**
* TinyMCE version 7.1.2 (TBD)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");const o=e=>t=>t.options.get(e),s=o("min_height"),i=o("max_height"),n=o("autoresize_overflow_padding"),r=o("autoresize_bottom_margin"),l=(e,t)=>{const o=e.getBody();o&&(o.style.overflowY=t?"":"hidden",t||(o.scrollTop=0))},g=(e,t,o,s)=>{var i;const n=parseInt(null!==(i=e.getStyle(t,o,s))&&void 0!==i?i:"",10);return isNaN(n)?0:n},a=(e,o,r,c)=>{var d;const f=e.dom,u=e.getDoc();if(!u)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void l(e,!0);const m=u.documentElement,h=c?c():n(e),p=null!==(d=s(e))&&void 0!==d?d:e.getElement().offsetHeight;let y=p;const S=g(f,m,"margin-top",!0),v=g(f,m,"margin-bottom",!0);let C=m.offsetHeight+S+v+h;C<0&&(C=0);const b=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+b>p&&(y=C+b);const w=i(e);if(w&&y>w?(y=w,l(e,!0)):l(e,!1),y!==o.get()){const s=y-o.get();if(f.setStyle(e.getContainer(),"height",y+"px"),o.set(y),(e=>{e.dispatch("ResizeEditor")})(e),t.browser.isSafari()&&(t.os.isMacOS()||t.os.isiOS())){const t=e.getWin();t.scrollTo(t.pageXOffset,t.pageYOffset)}e.hasFocus()&&(e=>{if("setcontent"===(null==e?void 0:e.type.toLowerCase())){const t=e;return!0===t.selection||!0===t.paste}return!1})(r)&&e.selection.scrollIntoView(),(t.browser.isSafari()||t.browser.isChromium())&&s<0&&a(e,o,r,c)}};e.add("autoresize",(e=>{if((e=>{const t=e.options.register;t("autoresize_overflow_padding",{processor:"number",default:1}),t("autoresize_bottom_margin",{processor:"number",default:50})})(e),e.options.isSet("resize")||e.options.set("resize",!1),!e.inline){const o=(e=>{let t=0;return{get:()=>t,set:e=>{t=e}}})();((e,t)=>{e.addCommand("mceAutoResize",(()=>{a(e,t)}))})(e,o),((e,o)=>{let s,i,l=()=>r(e);e.on("init",(i=>{s=0;const r=n(e),g=e.dom;g.setStyles(e.getDoc().documentElement,{height:"auto"}),t.browser.isEdge()||t.browser.isIE()?g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r,"min-height":0}):g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r}),a(e,o,i,l),s+=1})),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(t=>{if(1===s)i=e.getContainer().offsetHeight,a(e,o,t,l),s+=1;else if(2===s){const t=i<e.getContainer().offsetHeight;if(t){const t=e.dom,o=e.getDoc();t.setStyles(o.documentElement,{"min-height":0}),t.setStyles(e.getBody(),{"min-height":"inherit"})}l=t?(0,()=>0):l,s+=1}else a(e,o,t,l)}))})(e,o)}}))}();
\ No newline at end of file
// Exports the "autosave" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/autosave')
// ES2015:
// import 'tinymce/plugins/autosave'
require('./plugin.js');
\ No newline at end of file
/**
* TinyMCE version 7.1.2 (TBD)
*/
(function () {
'use strict';
var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
const hasProto = (v, constructor, predicate) => {
var _a;
if (predicate(v, constructor.prototype)) {
return true;
} else {
return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
}
};
const typeOf = x => {
const t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && Array.isArray(x)) {
return 'array';
} else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
return 'string';
} else {
return t;
}
};
const isType = type => value => typeOf(value) === type;
const eq = t => a => t === a;
const isString = isType('string');
const isUndefined = eq(undefined);
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.LocalStorage');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
const fireRestoreDraft = editor => editor.dispatch('RestoreDraft');
const fireStoreDraft = editor => editor.dispatch('StoreDraft');
const fireRemoveDraft = editor => editor.dispatch('RemoveDraft');
const parse = timeString => {
const multiples = {
s: 1000,
m: 60000
};
const parsedTime = /^(\d+)([ms]?)$/.exec(timeString);
return (parsedTime && parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(timeString, 10);
};
const option = name => editor => editor.options.get(name);
const register$1 = editor => {
const registerOption = editor.options.register;
const timeProcessor = value => {
const valid = isString(value);
if (valid) {
return {
value: parse(value),
valid
};
} else {
return {
valid: false,
message: 'Must be a string.'
};
}
};
registerOption('autosave_ask_before_unload', {
processor: 'boolean',
default: true
});
registerOption('autosave_prefix', {
processor: 'string',
default: 'tinymce-autosave-{path}{query}{hash}-{id}-'
});
registerOption('autosave_restore_when_empty', {
processor: 'boolean',
default: false
});
registerOption('autosave_interval', {
processor: timeProcessor,
default: '30s'
});
registerOption('autosave_retention', {
processor: timeProcessor,
default: '20m'
});
};
const shouldAskBeforeUnload = option('autosave_ask_before_unload');
const shouldRestoreWhenEmpty = option('autosave_restore_when_empty');
const getAutoSaveInterval = option('autosave_interval');
const getAutoSaveRetention = option('autosave_retention');
const getAutoSavePrefix = editor => {
const location = document.location;
return editor.options.get('autosave_prefix').replace(/{path}/g, location.pathname).replace(/{query}/g, location.search).replace(/{hash}/g, location.hash).replace(/{id}/g, editor.id);
};
const isEmpty = (editor, html) => {
if (isUndefined(html)) {
return editor.dom.isEmpty(editor.getBody());
} else {
const trimmedHtml = global$1.trim(html);
if (trimmedHtml === '') {
return true;
} else {
const fragment = new DOMParser().parseFromString(trimmedHtml, 'text/html');
return editor.dom.isEmpty(fragment);
}
}
};
const hasDraft = editor => {
var _a;
const time = parseInt((_a = global$2.getItem(getAutoSavePrefix(editor) + 'time')) !== null && _a !== void 0 ? _a : '0', 10) || 0;
if (new Date().getTime() - time > getAutoSaveRetention(editor)) {
removeDraft(editor, false);
return false;
}
return true;
};
const removeDraft = (editor, fire) => {
const prefix = getAutoSavePrefix(editor);
global$2.removeItem(prefix + 'draft');
global$2.removeItem(prefix + 'time');
if (fire !== false) {
fireRemoveDraft(editor);
}
};
const storeDraft = editor => {
const prefix = getAutoSavePrefix(editor);
if (!isEmpty(editor) && editor.isDirty()) {
global$2.setItem(prefix + 'draft', editor.getContent({
format: 'raw',
no_events: true
}));
global$2.setItem(prefix + 'time', new Date().getTime().toString());
fireStoreDraft(editor);
}
};
const restoreDraft = editor => {
var _a;
const prefix = getAutoSavePrefix(editor);
if (hasDraft(editor)) {
editor.setContent((_a = global$2.getItem(prefix + 'draft')) !== null && _a !== void 0 ? _a : '', { format: 'raw' });
fireRestoreDraft(editor);
}
};
const startStoreDraft = editor => {
const interval = getAutoSaveInterval(editor);
global$3.setEditorInterval(editor, () => {
storeDraft(editor);
}, interval);
};
const restoreLastDraft = editor => {
editor.undoManager.transact(() => {
restoreDraft(editor);
removeDraft(editor);
});
editor.focus();
};
const get = editor => ({
hasDraft: () => hasDraft(editor),
storeDraft: () => storeDraft(editor),
restoreDraft: () => restoreDraft(editor),
removeDraft: fire => removeDraft(editor, fire),
isEmpty: html => isEmpty(editor, html)
});
var global = tinymce.util.Tools.resolve('tinymce.EditorManager');
const setup = editor => {
editor.editorManager.on('BeforeUnload', e => {
let msg;
global$1.each(global.get(), editor => {
if (editor.plugins.autosave) {
editor.plugins.autosave.storeDraft();
}
if (!msg && editor.isDirty() && shouldAskBeforeUnload(editor)) {
msg = editor.translate('You have unsaved changes are you sure you want to navigate away?');
}
});
if (msg) {
e.preventDefault();
e.returnValue = msg;
}
});
};
const makeSetupHandler = editor => api => {
api.setEnabled(hasDraft(editor));
const editorEventCallback = () => api.setEnabled(hasDraft(editor));
editor.on('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
return () => editor.off('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
};
const register = editor => {
startStoreDraft(editor);
const onAction = () => {
restoreLastDraft(editor);
};
editor.ui.registry.addButton('restoredraft', {
tooltip: 'Restore last draft',
icon: 'restore-draft',
onAction,
onSetup: makeSetupHandler(editor)
});
editor.ui.registry.addMenuItem('restoredraft', {
text: 'Restore last draft',
icon: 'restore-draft',
onAction,
onSetup: makeSetupHandler(editor)
});
};
var Plugin = () => {
global$4.add('autosave', editor => {
register$1(editor);
setup(editor);
register(editor);
editor.on('init', () => {
if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) {
restoreDraft(editor);
}
});
return get(editor);
});
};
Plugin();
})();
/**
* TinyMCE version 7.1.2 (TBD)
*/
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=("string",t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(r=o=t,(a=String).prototype.isPrototypeOf(r)||(null===(s=o.constructor)||void 0===s?void 0:s.name)===a.name)?"string":e;var r,o,a,s})(t));const r=(void 0,t=>undefined===t);var o=tinymce.util.Tools.resolve("tinymce.util.Delay"),a=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),s=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=t=>{const e=/^(\d+)([ms]?)$/.exec(t);return(e&&e[2]?{s:1e3,m:6e4}[e[2]]:1)*parseInt(t,10)},i=t=>e=>e.options.get(t),u=i("autosave_ask_before_unload"),l=i("autosave_restore_when_empty"),c=i("autosave_interval"),d=i("autosave_retention"),m=t=>{const e=document.location;return t.options.get("autosave_prefix").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},v=(t,e)=>{if(r(e))return t.dom.isEmpty(t.getBody());{const r=s.trim(e);if(""===r)return!0;{const e=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(e)}}},f=t=>{var e;const r=parseInt(null!==(e=a.getItem(m(t)+"time"))&&void 0!==e?e:"0",10)||0;return!((new Date).getTime()-r>d(t)&&(p(t,!1),1))},p=(t,e)=>{const r=m(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&(t=>{t.dispatch("RemoveDraft")})(t)},g=t=>{const e=m(t);!v(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),(t=>{t.dispatch("StoreDraft")})(t))},y=t=>{var e;const r=m(t);f(t)&&(t.setContent(null!==(e=a.getItem(r+"draft"))&&void 0!==e?e:"",{format:"raw"}),(t=>{t.dispatch("RestoreDraft")})(t))};var D=tinymce.util.Tools.resolve("tinymce.EditorManager");const h=t=>e=>{e.setEnabled(f(t));const r=()=>e.setEnabled(f(t));return t.on("StoreDraft RestoreDraft RemoveDraft",r),()=>t.off("StoreDraft RestoreDraft RemoveDraft",r)};t.add("autosave",(t=>((t=>{const r=t.options.register,o=t=>{const r=e(t);return r?{value:n(t),valid:r}:{valid:!1,message:"Must be a string."}};r("autosave_ask_before_unload",{processor:"boolean",default:!0}),r("autosave_prefix",{processor:"string",default:"tinymce-autosave-{path}{query}{hash}-{id}-"}),r("autosave_restore_when_empty",{processor:"boolean",default:!1}),r("autosave_interval",{processor:o,default:"30s"}),r("autosave_retention",{processor:o,default:"20m"})})(t),(t=>{t.editorManager.on("BeforeUnload",(t=>{let e;s.each(D.get(),(t=>{t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&u(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))})),e&&(t.preventDefault(),t.returnValue=e)}))})(t),(t=>{(t=>{const e=c(t);o.setEditorInterval(t,(()=>{g(t)}),e)})(t);const e=()=>{(t=>{t.undoManager.transact((()=>{y(t),p(t)})),t.focus()})(t)};t.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)}),t.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)})})(t),t.on("init",(()=>{l(t)&&t.dom.isEmpty(t.getBody())&&y(t)})),(t=>({hasDraft:()=>f(t),storeDraft:()=>g(t),restoreDraft:()=>y(t),removeDraft:e=>p(t,e),isEmpty:e=>v(t,e)}))(t))))}();
\ No newline at end of file
// Exports the "charmap" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/charmap')
// ES2015:
// import 'tinymce/plugins/charmap'
require('./plugin.js');
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
// Exports the "code" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/code')
// ES2015:
// import 'tinymce/plugins/code'
require('./plugin.js');
\ No newline at end of file
/**
* TinyMCE version 7.1.2 (TBD)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
const setContent = (editor, html) => {
editor.focus();
editor.undoManager.transact(() => {
editor.setContent(html);
});
editor.selection.setCursorLocation();
editor.nodeChanged();
};
const getContent = editor => {
return editor.getContent({ source_view: true });
};
const open = editor => {
const editorContent = getContent(editor);
editor.windowManager.open({
title: 'Source Code',
size: 'large',
body: {
type: 'panel',
items: [{
type: 'textarea',
name: 'code'
}]
},
buttons: [
{
type: 'cancel',
name: 'cancel',
text: 'Cancel'
},
{
type: 'submit',
name: 'save',
text: 'Save',
primary: true
}
],
initialData: { code: editorContent },
onSubmit: api => {
setContent(editor, api.getData().code);
api.close();
}
});
};
const register$1 = editor => {
editor.addCommand('mceCodeEditor', () => {
open(editor);
});
};
const register = editor => {
const onAction = () => editor.execCommand('mceCodeEditor');
editor.ui.registry.addButton('code', {
icon: 'sourcecode',
tooltip: 'Source code',
onAction
});
editor.ui.registry.addMenuItem('code', {
icon: 'sourcecode',
text: 'Source code',
onAction
});
};
var Plugin = () => {
global.add('code', editor => {
register$1(editor);
register(editor);
return {};
});
};
Plugin();
})();
/**
* TinyMCE version 7.1.2 (TBD)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",(e=>((e=>{e.addCommand("mceCodeEditor",(()=>{(e=>{const o=(e=>e.getContent({source_view:!0}))(e);e.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:o},onSubmit:o=>{((e,o)=>{e.focus(),e.undoManager.transact((()=>{e.setContent(o)})),e.selection.setCursorLocation(),e.nodeChanged()})(e,o.getData().code),o.close()}})})(e)}))})(e),(e=>{const o=()=>e.execCommand("mceCodeEditor");e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:o}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:o})})(e),{})))}();
\ No newline at end of file
// Exports the "codesample" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/codesample')
// ES2015:
// import 'tinymce/plugins/codesample'
require('./plugin.js');
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
// Exports the "directionality" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/directionality')
// ES2015:
// import 'tinymce/plugins/directionality'
require('./plugin.js');
\ No newline at end of file
This diff is collapsed.
/**
* TinyMCE version 7.1.2 (TBD)
*/
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>typeof e===t,o=t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(o=r=t,(n=String).prototype.isPrototypeOf(o)||(null===(i=r.constructor)||void 0===i?void 0:i.name)===n.name)?"string":e;var o,r,n,i})(t),r=e("boolean"),n=t=>!(t=>null==t)(t),i=e("function"),s=e("number"),l=(!1,()=>false);class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return n(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=(t,e)=>{for(let o=0,r=t.length;o<r;o++)e(t[o],o)},c=t=>{if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},d=c,h=(t,e)=>{const o=t.dom;if(1!==o.nodeType)return!1;{const t=o;if(void 0!==t.matches)return t.matches(e);if(void 0!==t.msMatchesSelector)return t.msMatchesSelector(e);if(void 0!==t.webkitMatchesSelector)return t.webkitMatchesSelector(e);if(void 0!==t.mozMatchesSelector)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}};"undefined"!=typeof window?window:Function("return this;")();const m=t=>e=>(t=>t.dom.nodeType)(e)===t,g=m(1),f=m(3),v=m(9),y=m(11),p=(t,e)=>{t.dom.removeAttribute(e)},w=i(Element.prototype.attachShadow)&&i(Node.prototype.getRootNode)?t=>d(t.dom.getRootNode()):t=>v(t)?t:d(t.dom.ownerDocument),b=t=>d(t.dom.host),N=t=>{const e=f(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;const o=e.ownerDocument;return(t=>{const e=w(t);return y(o=e)&&n(o.dom.host)?a.some(e):a.none();var o})(d(e)).fold((()=>o.body.contains(e)),(r=N,i=b,t=>r(i(t))));var r,i},S=t=>"rtl"===((t,e)=>{const o=t.dom,r=window.getComputedStyle(o).getPropertyValue(e);return""!==r||N(t)?r:((t,e)=>(t=>void 0!==t.style&&i(t.style.getPropertyValue))(t)?t.style.getPropertyValue(e):"")(o,e)})(t,"direction")?"rtl":"ltr",A=(t,e)=>((t,o)=>((t,e)=>{const o=[];for(let r=0,n=t.length;r<n;r++){const n=t[r];e(n,r)&&o.push(n)}return o})(((t,e)=>{const o=t.length,r=new Array(o);for(let n=0;n<o;n++){const o=t[n];r[n]=e(o,n)}return r})(t.dom.childNodes,d),(t=>h(t,e))))(t),E=("li",t=>g(t)&&"li"===t.dom.nodeName.toLowerCase());const T=(t,e,n)=>{u(e,(e=>{const c=d(e),m=E(c),f=((t,e)=>{return(e?(o=t,r="ol,ul",((t,e,o)=>{let n=t.dom;const s=i(o)?o:l;for(;n.parentNode;){n=n.parentNode;const t=d(n);if(h(t,r))return a.some(t);if(s(t))break}return a.none()})(o,0,n)):a.some(t)).getOr(t);var o,r,n})(c,m);var v;(v=f,(t=>a.from(t.dom.parentNode).map(d))(v).filter(g)).each((e=>{if(t.setStyle(f.dom,"direction",null),S(e)===n?p(f,"dir"):((t,e,n)=>{((t,e,n)=>{if(!(o(n)||r(n)||s(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")})(t.dom,e,n)})(f,"dir",n),S(f)!==n&&t.setStyle(f.dom,"direction",n),m){const e=A(f,"li[dir],li[style]");u(e,(e=>{p(e,"dir"),t.setStyle(e.dom,"direction",null)}))}}))}))},C=(t,e)=>{t.selection.isEditable()&&(T(t.dom,t.selection.getSelectedBlocks(),e),t.nodeChanged())},D=(t,e)=>o=>{const r=r=>{const n=d(r.element);o.setActive(S(n)===e),o.setEnabled(t.selection.isEditable())};return t.on("NodeChange",r),o.setEnabled(t.selection.isEditable()),()=>t.off("NodeChange",r)};t.add("directionality",(t=>{(t=>{t.addCommand("mceDirectionLTR",(()=>{C(t,"ltr")})),t.addCommand("mceDirectionRTL",(()=>{C(t,"rtl")}))})(t),(t=>{t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:()=>t.execCommand("mceDirectionLTR"),onSetup:D(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:()=>t.execCommand("mceDirectionRTL"),onSetup:D(t,"rtl")})})(t)}))}();
\ No newline at end of file
// Exports the "emoticons" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/emoticons')
// ES2015:
// import 'tinymce/plugins/emoticons'
require('./plugin.js');
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* TinyMCE version 7.1.2 (TBD)
*/
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>t===e,o=e(null),n=e(void 0),s=()=>{},r=()=>!1;class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return null==t?a.none():a.some(t)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const i=(t,e)=>{const o=t.length,n=new Array(o);for(let s=0;s<o;s++){const o=t[s];n[s]=e(o,s)}return n},l=t=>{let e=t;return{get:()=>e,set:t=>{e=t}}},c=Object.keys,u=Object.hasOwnProperty,g=(t,e)=>{const o=c(t);for(let n=0,s=o.length;n<s;n++){const s=o[n];e(t[s],s)}},d=(t,e)=>u.call(t,e),m=(h=(t,e)=>e,(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const e={};for(let o=0;o<t.length;o++){const n=t[o];for(const t in n)d(n,t)&&(e[t]=h(e[t],n[t]))}return e});var h;const p=()=>{const t=(t=>{const e=l(a.none()),o=()=>e.get().each(t);return{clear:()=>{o(),e.set(a.none())},isSet:()=>e.get().isSome(),get:()=>e.get(),set:t=>{o(),e.set(a.some(t))}}})(s);return{...t,on:e=>t.get().each(e)}},y=(t,e,o=0,s)=>{const r=t.indexOf(e,o);return-1!==r&&(!!n(s)||r+e.length<=s)};var v=tinymce.util.Tools.resolve("tinymce.Resource");const f=t=>e=>e.options.get(t),b=f("emoticons_database"),w=f("emoticons_database_url"),j=f("emoticons_database_id"),C=f("emoticons_append"),_=f("emoticons_images_url"),A="All",k={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"},O=(t,e)=>d(t,e)?t[e]:e,x=t=>{const e=C(t);return o=t=>({keywords:[],category:"user",...t}),((t,e)=>{const o={};return g(t,((t,n)=>{const s=e(t,n);o[s.k]=s.v})),o})(e,((t,e)=>({k:e,v:o(t)})));var o},E=(t,e)=>y(t.title.toLowerCase(),e)||((t,o)=>{for(let o=0,s=t.length;o<s;o++)if(n=t[o],y(n.toLowerCase(),e))return!0;var n;return!1})(t.keywords),L=(t,e,o)=>{const n=[],s=e.toLowerCase(),a=o.fold((()=>r),(t=>e=>e>=t));for(let o=0;o<t.length&&(0!==e.length&&!E(t[o],s)||(n.push({value:t[o].char,text:t[o].title,icon:t[o].char}),!a(n.length)));o++);return n},S="pattern",N=(t,e)=>{const n={pattern:"",results:L(e.listAll(),"",a.some(300))},s=l(A),r=((t,e)=>{let n=null;const s=()=>{o(n)||(clearTimeout(n),n=null)};return{cancel:s,throttle:(...e)=>{s(),n=setTimeout((()=>{n=null,t.apply(null,e)}),200)}}})((t=>{(t=>{const o=t.getData(),n=s.get(),r=e.listCategory(n),i=L(r,o[S],n===A?a.some(300):a.none());t.setData({results:i})})(t)})),c={label:"Search",type:"input",name:S},u={type:"collection",name:"results"},g=()=>({title:"Emojis",size:"normal",body:{type:"tabpanel",tabs:i(e.listCategories(),(t=>({title:t,name:t,items:[c,u]})))},initialData:n,onTabChange:(t,e)=>{s.set(e.newTabName),r.throttle(t)},onChange:r.throttle,onAction:(e,o)=>{"results"===o.name&&(((t,e)=>{t.insertContent(e)})(t,o.value),e.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}),d=t.windowManager.open(g());d.focus(S),e.hasLoaded()||(d.block("Loading emojis..."),e.waitForLoad().then((()=>{d.redial(g()),r.throttle(d),d.focus(S),d.unblock()})).catch((t=>{d.redial({title:"Emojis",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"Could not load emojis"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),d.focus(S),d.unblock()})))},T=t=>e=>{const o=()=>{e.setEnabled(t.selection.isEditable())};return t.on("NodeChange",o),o(),()=>{t.off("NodeChange",o)}};t.add("emoticons",((t,e)=>{((t,e)=>{const o=t.options.register;o("emoticons_database",{processor:"string",default:"emojis"}),o("emoticons_database_url",{processor:"string",default:`${e}/js/${b(t)}${t.suffix}.js`}),o("emoticons_database_id",{processor:"string",default:"tinymce.plugins.emoticons"}),o("emoticons_append",{processor:"object",default:{}}),o("emoticons_images_url",{processor:"string",default:"https://cdnjs.cloudflare.com/ajax/libs/twemoji/15.1.0/72x72/"})})(t,e);const o=((t,e,o)=>{const n=p(),s=p(),r=_(t),i=t=>{return o="<img",(e=t.char).length>=4&&e.substr(0,4)===o?t.char.replace(/src="([^"]+)"/,((t,e)=>`src="${r}${e}"`)):t.char;var e,o};t.on("init",(()=>{v.load(o,e).then((e=>{const o=x(t);(t=>{const e={},o=[];g(t,((t,n)=>{const s={title:n,keywords:t.keywords,char:i(t),category:O(k,t.category)},r=void 0!==e[s.category]?e[s.category]:[];e[s.category]=r.concat([s]),o.push(s)})),n.set(e),s.set(o)})(m(e,o))}),(t=>{console.log(`Failed to load emojis: ${t}`),n.set({}),s.set([])}))}));const l=()=>s.get().getOr([]),u=()=>n.isSet()&&s.isSet();return{listCategories:()=>[A].concat(c(n.get().getOr({}))),hasLoaded:u,waitForLoad:()=>u()?Promise.resolve(!0):new Promise(((t,o)=>{let n=15;const s=setInterval((()=>{u()?(clearInterval(s),t(!0)):(n--,n<0&&(console.log("Could not load emojis from url: "+e),clearInterval(s),o(!1)))}),100)})),listAll:l,listCategory:t=>t===A?l():n.get().bind((e=>a.from(e[t]))).getOr([])}})(t,w(t),j(t));return((t,e)=>{t.addCommand("mceEmoticons",(()=>N(t,e)))})(t,o),(t=>{const e=()=>t.execCommand("mceEmoticons");t.ui.registry.addButton("emoticons",{tooltip:"Emojis",icon:"emoji",onAction:e,onSetup:T(t)}),t.ui.registry.addMenuItem("emoticons",{text:"Emojis...",icon:"emoji",onAction:e,onSetup:T(t)})})(t),((t,e)=>{t.ui.registry.addAutocompleter("emoticons",{trigger:":",columns:"auto",minChars:2,fetch:(t,o)=>e.waitForLoad().then((()=>{const n=e.listAll();return L(n,t,a.some(o))})),onAction:(e,o,n)=>{t.selection.setRng(o),t.insertContent(n),e.hide()}})})(t,o),(t=>{t.on("PreInit",(()=>{t.parser.addAttributeFilter("data-emoticon",(t=>{((t,e)=>{for(let e=0,n=t.length;e<n;e++)(o=t[e]).attr("data-mce-resize","false"),o.attr("data-mce-placeholder","1");var o})(t)}))}))})(t),{getAllEmojis:()=>o.waitForLoad().then((()=>o.listAll()))}}))}();
\ No newline at end of file
// Exports the "fullscreen" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/fullscreen')
// ES2015:
// import 'tinymce/plugins/fullscreen'
require('./plugin.js');
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
// Exports the "help" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/help')
// ES2015:
// import 'tinymce/plugins/help'
require('./plugin.js');
\ No newline at end of file
tinymce.Resource.add('tinymce.html-i18n.help-keynav.ar',
'<h1>بدء التنقل بواسطة لوحة المفاتيح</h1>\n' +
'\n' +
'<dl>\n' +
' <dt>التركيز على شريط القوائم</dt>\n' +
' <dd>نظاما التشغيل Windows أو Linux: Alt + F9</dd>\n' +
' <dd>نظام التشغيل macOS: &#x2325;F9</dd>\n' +
' <dt>التركيز على شريط الأدوات</dt>\n' +
' <dd>نظاما التشغيل Windows أو Linux: Alt + F10</dd>\n' +
' <dd>نظام التشغيل macOS: &#x2325;F10</dd>\n' +
' <dt>التركيز على التذييل</dt>\n' +
' <dd>نظاما التشغيل Windows أو Linux: Alt + F11</dd>\n' +
' <dd>نظام التشغيل macOS: &#x2325;F11</dd>\n' +
' <dt>تركيز الإشعارات</dt>\n' +
' <dd>نظاما التشغيل Windows أو Linux: Alt + F12</dd>\n' +
' <dd>نظام التشغيل macOS: &#x2325;F12</dd>\n' +
' <dt>التركيز على شريط أدوات السياق</dt>\n' +
' <dd>أنظمة التشغيل Windows أو Linux أو macOS: Ctrl+F9</dd>\n' +
'</dl>\n' +
'\n' +
'<p>سيبدأ التنقل عند عنصر واجهة المستخدم الأول، والذي سيتم تمييزه أو تسطيره في حالة العنصر الأول في\n' +
' مسار عنصر التذييل.</p>\n' +
'\n' +
'<h1>التنقل بين أقسام واجهة المستخدم</h1>\n' +
'\n' +
'<p>للانتقال من أحد أقسام واجهة المستخدم إلى القسم التالي، اضغط على <strong>Tab</strong>.</p>\n' +
'\n' +
'<p>للانتقال من أحد أقسام واجهة المستخدم إلى القسم السابق، اضغط على <strong>Shift+Tab</strong>.</p>\n' +
'\n' +
'<p>ترتيب علامات <strong>Tab</strong> لأقسام واجهة المستخدم هذه هو:</p>\n' +
'\n' +
'<ol>\n' +
' <li>شريط القوائم</li>\n' +
' <li>كل مجموعة شريط الأدوات</li>\n' +
' <li>الشريط الجانبي</li>\n' +
' <li>مسار العنصر في التذييل</li>\n' +
' <li>زر تبديل عدد الكلمات في التذييل</li>\n' +
' <li>رابط إدراج العلامة التجارية في التذييل</li>\n' +
' <li>مؤشر تغيير حجم المحرر في التذييل</li>\n' +
'</ol>\n' +
'\n' +
'<p>إذا لم يكن قسم واجهة المستخدم موجودًا، فسيتم تخطيه.</p>\n' +
'\n' +
'<p>إذا كان التذييل يحتوي على التركيز على ‏‫التنقل بواسطة لوحة المفاتيح، ولا يوجد شريط جانبي مرئي، فإن الضغط على <strong>Shift+Tab</strong>\n' +
' ينقل التركيز إلى مجموعة شريط الأدوات الأولى، وليس الأخيرة.</p>\n' +
'\n' +
'<h1>التنقل بين أقسام واجهة المستخدم</h1>\n' +
'\n' +
'<p>للانتقال من أحد عناصر واجهة المستخدم إلى العنصر التالي، اضغط على مفتاح <strong>السهم</strong> المناسب.</p>\n' +
'\n' +
'<p>مفتاحا السهمين <strong>اليسار‎</strong> و<strong>اليمين‎</strong></p>\n' +
'\n' +
'<ul>\n' +
' <li>التنقل بين القوائم في شريط القوائم.</li>\n' +
' <li>فتح قائمة فرعية في القائمة.</li>\n' +
' <li>التنقل بين الأزرار في مجموعة شريط الأدوات.</li>\n' +
' <li>التنقل بين العناصر في مسار عنصر التذييل.</li>\n' +
'</ul>\n' +
'\n' +
'<p>مفتاحا السهمين <strong>لأسفل‎</strong> و<strong>لأعلى‎</strong></p>\n' +
'\n' +
'<ul>\n' +
' <li>التنقل بين عناصر القائمة في القائمة.</li>\n' +
' <li>التنقل بين العناصر في قائمة شريط الأدوات المنبثقة.</li>\n' +
'</ul>\n' +
'\n' +
'<p>دورة مفاتيح <strong>الأسهم‎</strong> داخل قسم واجهة المستخدم التي تم التركيز عليها.</p>\n' +
'\n' +
'<p>لإغلاق قائمة مفتوحة أو قائمة فرعية مفتوحة أو قائمة منبثقة مفتوحة، اضغط على مفتاح <strong>Esc</strong>.</p>\n' +
'\n' +
'<p>إذا كان التركيز الحالي على "الجزء العلوي" من قسم معين لواجهة المستخدم، فإن الضغط على مفتاح <strong>Esc</strong> يؤدي أيضًا إلى الخروج\n' +
' من التنقل بواسطة لوحة المفاتيح بالكامل.</p>\n' +
'\n' +
'<h1>تنفيذ عنصر قائمة أو زر شريط أدوات</h1>\n' +
'\n' +
'<p>عندما يتم تمييز عنصر القائمة المطلوب أو زر شريط الأدوات، اضغط على زر <strong>Return</strong>، أو <strong>Enter</strong>،\n' +
' أو <strong>مفتاح المسافة</strong> لتنفيذ العنصر.</p>\n' +
'\n' +
'<h1>التنقل في مربعات الحوار غير المبوبة</h1>\n' +
'\n' +
'<p>في مربعات الحوار غير المبوبة، يتم التركيز على المكون التفاعلي الأول عند فتح مربع الحوار.</p>\n' +
'\n' +
'<p>التنقل بين مكونات الحوار التفاعلي بالضغط على زر <strong>Tab</strong> أو <strong>Shift+Tab</strong>.</p>\n' +
'\n' +
'<h1>التنقل في مربعات الحوار المبوبة</h1>\n' +
'\n' +
'<p>في مربعات الحوار المبوبة، يتم التركيز على الزر الأول في قائمة علامات التبويب عند فتح مربع الحوار.</p>\n' +
'\n' +
'<p>التنقل بين المكونات التفاعلية لعلامة التبويب لمربع الحوار هذه بالضغط على زر <strong>Tab</strong> أو\n' +
' <strong>Shift+Tab</strong>.</p>\n' +
'\n' +
'<p>التبديل إلى علامة تبويب أخرى لمربع الحوار من خلال التركيز على قائمة علامة التبويب ثم الضغط على زر <strong>السهم</strong> المناسب\n' +
' مفتاح للتنقل بين علامات التبويب المتاحة.</p>\n');
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment