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

121
node_modules/jodit/esm/core/component/component.d.ts generated vendored Normal file
View File

@@ -0,0 +1,121 @@
/*!
* 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:core/component/README.md]]
* @packageDocumentation
* @module component
*/
import type { ComponentStatus, IAsync, IComponent, IDictionary, Nullable } from "../../types/index";
/**
* The base class of all Jodit UI components. Provides work with a life cycle.
*/
export declare abstract class Component implements IComponent {
static STATUSES: {
readonly beforeInit: "beforeInit";
readonly ready: "ready";
readonly beforeDestruct: "beforeDestruct";
readonly destructed: "destructed";
};
private __componentName;
async: IAsync;
get componentName(): string;
readonly uid: string;
/**
* Calc BEM element class name
* @param elementName - element name in the bem classification
*/
getFullElName(elementName: string): string;
getFullElName(elementName: string, mod: string): string;
getFullElName(elementName: string, mod: string, modValue: boolean | string): string;
/**
* The document in which jodit was created
*/
get ownerDocument(): Document;
/**
* Shortcut for `this.ownerDocument`
*/
get od(): Document;
/**
* The window in which jodit was created
*/
ownerWindow: Window;
get ow(): Window;
/**
* Safe get any field
* @example
* ```js
* private a = {
* b: {
* c: {
* e: {
* g: {
* color: 'red'
* }
* }
* }
* }
* }
*
* this.get('a.b.c.e.g.color'); // Safe access to color
* // instead using optionsl chaining
* this?.a?.b?.c?.e?.g?.color
* ```
*
* @param chain - the path to be traversed in the obj object
* @param obj - the object in which the value is searched
*/
get<T>(chain: string, obj?: IDictionary): Nullable<T>;
/**
* Component is ready for work
*/
get isReady(): boolean;
/**
* Component was destructed
*/
get isDestructed(): boolean;
/**
* The component is currently undergoing destructuring or has already been destroyed.
* Those. you should not the app froze new events on him now or do anything else with him.
*/
get isInDestruct(): boolean;
/**
* Bind destructor to some View
*/
bindDestruct(component: IComponent): this;
abstract className(): string;
protected constructor();
/**
* Destruct component method
*/
destruct(): void;
private __componentStatus;
/**
* Current component status
*/
get componentStatus(): ComponentStatus;
/**
* Setter for current component status
*/
set componentStatus(componentStatus: ComponentStatus);
/**
* Set component status
* @param componentStatus - component status
* @see ComponentStatus
*/
setStatus(componentStatus: ComponentStatus): void;
/**
* Set status recursively on all parents
*/
private setStatusComponent;
/**
* Adds a handler for changing the component's status
*
* @param status - the status at which the callback is triggered
* @param callback - a function that will be called when the status is `status`
*/
hookStatus(status: ComponentStatus, callback: (component: this) => void): void;
static isInstanceOf<T extends Component>(c: unknown | Component, constructorFunc: Function): c is T;
}

190
node_modules/jodit/esm/core/component/component.js generated vendored Normal file
View File

@@ -0,0 +1,190 @@
/*!
* 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 { Async } from "../async/index.js";
import { STATUSES } from "./statuses.js";
import { uniqueUid } from "../global.js";
import { get, getClassName, isFunction, isVoid, kebabCase } from "../helpers/index.js";
const StatusListHandlers = new Map();
/**
* The base class of all Jodit UI components. Provides work with a life cycle.
*/
export class Component {
get componentName() {
if (!this.__componentName) {
this.__componentName =
'jodit-' +
kebabCase((isFunction(this.className) ? this.className() : '') ||
getClassName(this));
}
return this.__componentName;
}
getFullElName(elementName, mod, modValue) {
const result = [this.componentName];
if (elementName) {
elementName = elementName.replace(/[^a-z0-9-]/gi, '-');
result.push(`__${elementName}`);
}
if (mod) {
result.push('_', mod);
result.push('_', isVoid(modValue) ? 'true' : modValue.toString());
}
return result.join('');
}
/**
* The document in which jodit was created
*/
get ownerDocument() {
return this.ow.document;
}
/**
* Shortcut for `this.ownerDocument`
*/
get od() {
return this.ownerDocument;
}
get ow() {
return this.ownerWindow;
}
/**
* Safe get any field
* @example
* ```js
* private a = {
* b: {
* c: {
* e: {
* g: {
* color: 'red'
* }
* }
* }
* }
* }
*
* this.get('a.b.c.e.g.color'); // Safe access to color
* // instead using optionsl chaining
* this?.a?.b?.c?.e?.g?.color
* ```
*
* @param chain - the path to be traversed in the obj object
* @param obj - the object in which the value is searched
*/
get(chain, obj) {
return get(chain, obj || this);
}
/**
* Component is ready for work
*/
get isReady() {
return this.componentStatus === STATUSES.ready;
}
/**
* Component was destructed
*/
get isDestructed() {
return this.componentStatus === STATUSES.destructed;
}
/**
* The component is currently undergoing destructuring or has already been destroyed.
* Those. you should not the app froze new events on him now or do anything else with him.
*/
get isInDestruct() {
return (STATUSES.beforeDestruct === this.componentStatus ||
STATUSES.destructed === this.componentStatus);
}
/**
* Bind destructor to some View
*/
bindDestruct(component) {
component.hookStatus(STATUSES.beforeDestruct, () => !this.isInDestruct && this.destruct());
return this;
}
constructor() {
this.async = new Async();
/**
* The window in which jodit was created
*/
this.ownerWindow = window;
this.__componentStatus = STATUSES.beforeInit;
this.uid = 'jodit-uid-' + uniqueUid();
}
/**
* Destruct component method
*/
destruct() {
this.setStatus(STATUSES.destructed);
if (this.async) {
this.async.destruct();
// @ts-ignore
this.async = undefined;
}
if (StatusListHandlers.get(this)) {
StatusListHandlers.delete(this);
}
// @ts-ignore
this.ownerWindow = undefined;
}
/**
* Current component status
*/
get componentStatus() {
return this.__componentStatus;
}
/**
* Setter for current component status
*/
set componentStatus(componentStatus) {
this.setStatus(componentStatus);
}
/**
* Set component status
* @param componentStatus - component status
* @see ComponentStatus
*/
setStatus(componentStatus) {
return this.setStatusComponent(componentStatus, this);
}
/**
* Set status recursively on all parents
*/
setStatusComponent(componentStatus, component) {
if (componentStatus === this.__componentStatus) {
return;
}
if (component === this) {
this.__componentStatus = componentStatus;
}
const proto = Object.getPrototypeOf(this);
if (proto && isFunction(proto.setStatusComponent)) {
proto.setStatusComponent(componentStatus, component);
}
const statuses = StatusListHandlers.get(this), list = statuses === null || statuses === void 0 ? void 0 : statuses[componentStatus];
if (list && list.length) {
list.forEach(cb => cb(component));
}
}
/**
* Adds a handler for changing the component's status
*
* @param status - the status at which the callback is triggered
* @param callback - a function that will be called when the status is `status`
*/
hookStatus(status, callback) {
let list = StatusListHandlers.get(this);
if (!list) {
list = {};
StatusListHandlers.set(this, list);
}
if (!list[status]) {
list[status] = [];
}
list[status].push(callback);
}
static isInstanceOf(c, constructorFunc) {
return c instanceof constructorFunc;
}
}
Component.STATUSES = STATUSES;

11
node_modules/jodit/esm/core/component/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/*!
* 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 component
*/
export * from "./component";
export * from "./statuses";
export * from "./view-component";

11
node_modules/jodit/esm/core/component/index.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/*!
* 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 component
*/
export * from "./component.js";
export * from "./statuses.js";
export * from "./view-component.js";

14
node_modules/jodit/esm/core/component/statuses.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
/*!
* 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 component
*/
export declare const STATUSES: {
readonly beforeInit: "beforeInit";
readonly ready: "ready";
readonly beforeDestruct: "beforeDestruct";
readonly destructed: "destructed";
};

14
node_modules/jodit/esm/core/component/statuses.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
/*!
* 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 component
*/
export const STATUSES = {
beforeInit: 'beforeInit',
ready: 'ready',
beforeDestruct: 'beforeDestruct',
destructed: 'destructed'
};

View File

@@ -0,0 +1,29 @@
/*!
* 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 component
*/
import type { IViewBased, IViewComponent } from "../../types/index";
import { Component } from "./component";
export declare abstract class ViewComponent<T extends IViewBased = IViewBased> extends Component implements IViewComponent<T> {
/**
* Parent View element
*/
jodit: T;
/**
* Shortcut for `this.jodit`
*/
get j(): T;
get defaultTimeout(): number;
i18n(text: string, ...params: Array<string | number>): string;
/**
* Attach component to View
*/
setParentView(jodit: T): this;
constructor(jodit: T);
/** @override */
destruct(): any;
}

View File

@@ -0,0 +1,37 @@
/*!
* 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 { Component } from "./component.js";
export class ViewComponent extends Component {
/**
* Shortcut for `this.jodit`
*/
get j() {
return this.jodit;
}
get defaultTimeout() {
return this.j.defaultTimeout;
}
i18n(text, ...params) {
return this.j.i18n(text, ...params);
}
/**
* Attach component to View
*/
setParentView(jodit) {
this.jodit = jodit;
jodit.components.add(this);
return this;
}
constructor(jodit) {
super();
this.setParentView(jodit);
}
/** @override */
destruct() {
this.j.components.delete(this);
return super.destruct();
}
}