inital commit

This commit is contained in:
2026-01-01 15:25:19 +05:30
commit f0ae49465a
36361 changed files with 4894111 additions and 0 deletions

33
node_modules/jodit/esm/plugins/mobile/config.d.ts generated vendored Normal file
View File

@@ -0,0 +1,33 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* @module plugins/mobile
*/
import type { ButtonsOption } from "../../types/index";
declare module 'jodit/config' {
interface Config {
/**
* Mobile timeout for CLICK emulation
*/
mobileTapTimeout: number;
/**
* After resizing, the set of buttons will change to accommodate different sizes.
*/
toolbarAdaptive: boolean;
/**
* The list of buttons that appear in the editor's toolbar for medium-sized spaces (≥ options.sizeMD).
*/
buttonsMD: ButtonsOption;
/**
* The list of buttons that appear in the editor's toolbar for small-sized spaces (≥ options.sizeSM).
*/
buttonsSM: ButtonsOption;
/**
* The list of buttons that appear in the editor's toolbar for extra-small spaces (less than options.sizeSM).
*/
buttonsXS: ButtonsOption;
}
}

142
node_modules/jodit/esm/plugins/mobile/config.js generated vendored Normal file
View File

@@ -0,0 +1,142 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
import * as consts from "../../core/constants.js";
import { splitArray } from "../../core/helpers/index.js";
import { Config } from "../../config.js";
import { ToolbarCollection } from "../../modules/toolbar/collection/collection.js";
import { makeCollection } from "../../modules/toolbar/factory.js";
Config.prototype.mobileTapTimeout = 300;
Config.prototype.toolbarAdaptive = true;
Config.prototype.buttonsMD = [
{
group: 'font-style',
buttons: []
},
{
group: 'list',
buttons: []
},
{
group: 'font',
buttons: []
},
'---',
{
group: 'media',
buttons: []
},
'\n',
{
group: 'state',
buttons: []
},
{
group: 'insert',
buttons: []
},
{
group: 'indent',
buttons: []
},
{
group: 'color',
buttons: []
},
'---',
{
group: 'history',
buttons: []
},
{
group: 'other',
buttons: []
},
'|',
'dots'
];
Config.prototype.buttonsSM = [
{
group: 'font-style',
buttons: []
},
{
group: 'list',
buttons: []
},
'---',
{
group: 'font',
buttons: []
},
'\n',
{
group: 'state',
buttons: []
},
{
group: 'indent',
buttons: []
},
{
group: 'color',
buttons: []
},
'---',
{
group: 'history',
buttons: []
},
'|',
'dots'
];
Config.prototype.buttonsXS = [
{
group: 'font-style',
buttons: []
},
{
group: 'list',
buttons: []
},
'---',
{
group: 'font',
buttons: []
},
{
group: 'color',
buttons: []
},
'---',
'dots'
];
Config.prototype.controls.dots = {
mode: consts.MODE_SOURCE + consts.MODE_WYSIWYG,
popup: (editor, current, close, button) => {
let store = button.control.data;
if (store === undefined) {
store = {
toolbar: makeCollection(editor),
rebuild: () => {
var _a, _b;
if (button) {
const buttons = editor.e.fire('getDiffButtons.mobile', button.closest(ToolbarCollection));
if (buttons && store) {
store.toolbar.build(splitArray(buttons));
const w = ((_b = (_a = editor.toolbar) === null || _a === void 0 ? void 0 : _a.firstButton) === null || _b === void 0 ? void 0 : _b.container.offsetWidth) || 36;
store.toolbar.container.style.width =
(w + 4) * 3 + 'px';
}
}
}
};
button.control.data = store;
}
store.rebuild();
return store.toolbar;
},
tooltip: 'Show all'
};

16
node_modules/jodit/esm/plugins/mobile/mobile.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* [[include:plugins/mobile/README.md]]
* @packageDocumentation
* @module plugins/mobile
*/
import type { IJodit } from "../../types/index";
import "./config";
/**
* Rebuild toolbar in depends on editor's width
*/
export declare function mobile(editor: IJodit): void;

69
node_modules/jodit/esm/plugins/mobile/mobile.js generated vendored Normal file
View File

@@ -0,0 +1,69 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
import { pluginSystem } from "../../core/global.js";
import { splitArray, toArray } from "../../core/helpers/index.js";
import { flatButtonsSet } from "../../core/ui/helpers/buttons.js";
import "./config.js";
/**
* Rebuild toolbar in depends on editor's width
*/
export function mobile(editor) {
let timeout = 0, store = splitArray(editor.o.buttons);
if (editor.o.mobileTapTimeout) {
// Emulate double tap
editor.e.on('touchend', (e) => {
if (e.changedTouches && e.changedTouches.length) {
const now = new Date().getTime(), diff = now - timeout;
if (diff > editor.o.mobileTapTimeout) {
timeout = now;
if (diff < editor.o.mobileTapTimeout * 1.5) {
editor.s.insertCursorAtPoint(e.clientX, e.clientY);
}
}
}
});
}
editor.e.on('getDiffButtons.mobile', (toolbar) => {
if (toolbar === editor.toolbar) {
const buttons = flatButtonsSet(splitArray(editor.o.buttons), editor), flatStore = flatButtonsSet(store, editor);
return toArray(buttons).reduce((acc, item) => {
if (!flatStore.has(item)) {
acc.push(item);
}
return acc;
}, []);
}
});
if (editor.o.toolbarAdaptive) {
editor.e
.on('resize afterInit recalcAdaptive changePlace afterAddPlace', () => {
var _a, _b;
if (!editor.o.toolbar) {
return;
}
const width = ((_a = editor.container.parentElement) !== null && _a !== void 0 ? _a : editor.container).offsetWidth;
const newStore = (() => {
if (editor.isFullSize || width >= editor.o.sizeLG) {
return splitArray(editor.o.buttons);
}
if (width >= editor.o.sizeMD) {
return splitArray(editor.o.buttonsMD);
}
if (width >= editor.o.sizeSM) {
return splitArray(editor.o.buttonsSM);
}
return splitArray(editor.o.buttonsXS);
})();
if (newStore.toString() !== store.toString()) {
store = newStore;
editor.e.fire('closeAllPopups');
(_b = editor.toolbar) === null || _b === void 0 ? void 0 : _b.setRemoveButtons(editor.o.removeButtons).build(store.concat(editor.o.extraButtons));
}
})
.on(editor.ow, 'load resize', () => editor.e.fire('recalcAdaptive'));
}
}
pluginSystem.add('mobile', mobile);