Skip to content

Commit

Permalink
Removed relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
xdan committed Jan 19, 2022
1 parent f9e2626 commit e71e679
Show file tree
Hide file tree
Showing 186 changed files with 636 additions and 599 deletions.
5 changes: 4 additions & 1 deletion build-system/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ module.exports = (env, argv, dir = process.cwd(), onlyTS = false) => {
},

resolve: {
extensions: ['.js', '.ts', '.d.ts', '.json', '.less', '.svg']
extensions: ['.js', '.ts', '.d.ts', '.json', '.less', '.svg'],
alias: {
jodit: path.resolve(__dirname, '../src/')
}
},

optimization: {
Expand Down
3 changes: 3 additions & 0 deletions build-system/minimizer/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ module.exports = ({ ESNext, isTest, banner }) =>

pure_getters: true,
unsafe_comps: true,

pure_funcs: ['assert'],

passes: 7
},

Expand Down
2 changes: 1 addition & 1 deletion src/core/async/async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
IAsyncParams,
ITimeout,
RejectablePromise
} from '../../types';
} from 'jodit/types';
import {
setTimeout,
clearTimeout,
Expand Down
2 changes: 1 addition & 1 deletion src/core/component/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
IComponent,
IDictionary,
Nullable
} from '../../types';
} from 'jodit/types';

import { kebabCase, get, getClassName, isFunction, isVoid } from '../helpers';
import { uniqueUid } from '../global';
Expand Down
2 changes: 1 addition & 1 deletion src/core/component/view-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module component
*/

import type { IViewBased, IViewComponent } from '../../types';
import type { IViewBased, IViewComponent } from 'jodit/types';
import { Component } from './component';

export abstract class ViewComponent<T extends IViewBased = IViewBased>
Expand Down
2 changes: 1 addition & 1 deletion src/core/create/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type {
ICreate,
CanUndef,
NodeFunction
} from '../../types';
} from 'jodit/types';

import {
isPlainObject,
Expand Down
2 changes: 1 addition & 1 deletion src/core/decorators/cache/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import { error } from '../../helpers';
import type { IDictionary } from '../../../types';
import type { IDictionary } from 'jodit/types';

export interface CachePropertyDescriptor<T, R> extends PropertyDescriptor {
get?: (this: T) => R;
Expand Down
2 changes: 1 addition & 1 deletion src/core/decorators/component/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @module decorators/component
*/

import { isFunction } from '../../helpers';
import { isFunction } from 'jodit/core/helpers';

interface ComponentCompatible {
className?: () => string;
Expand Down
6 changes: 3 additions & 3 deletions src/core/decorators/debounce/debounce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ import type {
IViewComponent,
IAsyncParams,
DecoratorHandler
} from '../../../types';
} from 'jodit/types';
import {
isFunction,
isNumber,
isPlainObject,
isViewObject
} from '../../helpers/checker';
} from 'jodit/core/helpers/checker';
import { Component, STATUSES } from '../../component';
import { error } from '../../helpers/utils/error';
import { error } from 'jodit/core/helpers/utils/error';

export function debounce<V = IViewComponent | IViewBased>(
timeout?: number | ((ctx: V) => number | IAsyncParams) | IAsyncParams,
Expand Down
8 changes: 4 additions & 4 deletions src/core/decorators/hook/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import type {
IDictionary,
IViewBased,
IViewComponent
} from '../../../types';
import type { Component } from '../../component';
import { isFunction } from '../../helpers/checker';
import { error } from '../../helpers/utils/error';
} from 'jodit/types';
import type { Component } from 'jodit/core/component';
import { isFunction } from 'jodit/core/helpers/checker';
import { error } from 'jodit/core/helpers/utils/error';

/**
* Call on some component status
Expand Down
2 changes: 1 addition & 1 deletion src/core/decorators/idle/idle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
IDictionary,
IViewBased,
IViewComponent
} from '../../../types';
} from 'jodit/types';
import { Component, STATUSES } from '../../component';
import { error, isFunction, isViewObject } from '../../helpers';

Expand Down
2 changes: 1 addition & 1 deletion src/core/decorators/persistent/persistent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @module decorators/persistent
*/

import type { IComponent, IDictionary, IViewComponent } from '../../../types';
import type { IComponent, IDictionary, IViewComponent } from 'jodit/types';
import { STATUSES } from '../../component';
import { isViewObject } from '../../helpers';

Expand Down
2 changes: 1 addition & 1 deletion src/core/decorators/wait/wait.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @module decorators/wait
*/

import type { IViewBased, IViewComponent } from '../../../types';
import type { IViewBased, IViewComponent } from 'jodit/types';
import { error, isFunction, isViewObject } from '../../helpers';
import { STATUSES } from '../../component';

Expand Down
8 changes: 4 additions & 4 deletions src/core/decorators/watch/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import type {
IComponent,
IDictionary,
IViewComponent
} from '../../../types';
import { isFunction, isPlainObject, isViewObject } from '../../helpers/checker';
} from 'jodit/types';
import { isFunction, isPlainObject, isViewObject } from 'jodit/core/helpers/checker';
import { ObservableObject } from '../../event-emitter';
import { STATUSES } from '../../component';
import { splitArray } from '../../helpers/array/split-array';
import { error } from '../../helpers/utils/error';
import { splitArray } from 'jodit/core/helpers/array/split-array';
import { error } from 'jodit/core/helpers/utils/error';

export function getPropertyDescriptor(
obj: unknown,
Expand Down
2 changes: 1 addition & 1 deletion src/core/dom/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
NodeCondition,
Nullable,
IDictionary
} from '../../types';
} from 'jodit/types';
import * as consts from '../constants';
import {
$$,
Expand Down
2 changes: 1 addition & 1 deletion src/core/event-emitter/event-emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
CallbackFunction,
EventHandlerBlock,
IEventEmitter
} from '../../types';
} from 'jodit/types';
import { defaultNameSpace, EventHandlersStore } from './store';
import { isString } from '../helpers/checker/is-string';
import { isFunction } from '../helpers/checker/is-function';
Expand Down
2 changes: 1 addition & 1 deletion src/core/event-emitter/observe-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
CanUndef,
IDictionary,
IObservable
} from '../../types';
} from 'jodit/types';
import { isPlainObject, isFastEqual, isArray } from '../helpers';
import { nonenumerable } from '../decorators';

Expand Down
2 changes: 1 addition & 1 deletion src/core/event-emitter/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
CallbackFunction,
EventHandlerBlock,
IDictionary
} from '../../types';
} from 'jodit/types';

export const defaultNameSpace = 'JoditEventDefaultNamespace';

Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/checker/is-imp-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/checker
*/

import type { IContainer, IDestructible, IInitable } from '../../../types';
import type { IContainer, IDestructible, IInitable } from 'jodit/types';
import { isFunction } from './is-function';
import { Dom } from '../../dom';
import { isVoid } from './is-void';
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/checker/is-jodit-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/checker
*/

import type { IJodit, IViewBased } from '../../../types';
import type { IJodit, IViewBased } from 'jodit/types';
import { isFunction } from './is-function';
import { modules } from '../../global';

Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/checker/is-plain-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/checker
*/

import type { IDictionary } from '../../../types';
import type { IDictionary } from 'jodit/types';
import { isWindow } from './is-window';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/normalize/normalize-key-aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/normalize
*/

import type { IDictionary } from '../../../types';
import type { IDictionary } from 'jodit/types';
import { trim } from '../string';
import { KEY_ALIASES } from '../../constants';

Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/size/get-scroll-parent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/size
*/

import type { Nullable } from '../../../types';
import type { Nullable } from 'jodit/types';
import { css } from '../utils';
import { Dom } from '../../dom';

Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/size/object-size.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

import { isArray, isPlainObject, isString } from '../checker';
import type { CanUndef } from '../../../types';
import type { CanUndef } from 'jodit/types';

export function size(
subject: CanUndef<object | string | Array<unknown>>
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/size/offset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @returns returns an object containing the properties top and left.
*/

import type { IBound, IHasScroll, IJodit, IViewBased } from '../../../types';
import type { IBound, IHasScroll, IJodit, IViewBased } from 'jodit/types';

export const offset = (
elm: HTMLElement | Range,
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/size/position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/size
*/

import type { IBound, IViewBased } from '../../../types';
import type { IBound, IViewBased } from 'jodit/types';
import { isJoditObject } from '../checker';

export function position(elm: HTMLElement): IBound;
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/string/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/string
*/

import type { IDictionary, ILanguageOptions } from '../../../types';
import type { IDictionary, ILanguageOptions } from 'jodit/types';
import { Config } from '../../../config';
import { defaultLanguage as defineLanguage } from '../utils';
import { ucfirst, isString, error } from '../';
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/string/stringify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/string
*/

import type { CanUndef } from '../../../types';
import type { CanUndef } from 'jodit/types';

/**
* Safe stringify circular object
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/utils/append-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/utils
*/

import type { IViewBased } from '../../../types';
import type { IViewBased } from 'jodit/types';
import { completeUrl } from './complete-url';
import { isFunction, isString } from '../checker';

Expand Down
21 changes: 21 additions & 0 deletions src/core/helpers/utils/assert.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/

class AssertionError extends Error {
constructor(message: string) {
super(message);
this.name = 'AssertionError';
}
}

/** Asserts that condition is truthy (or evaluates to true). */
function assert(condition: boolean, message: string): asserts condition {
if (!condition) {
throw new AssertionError(`Assertion failed: ${message}`);
}
}

export { assert };
2 changes: 1 addition & 1 deletion src/core/helpers/utils/build-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/utils
*/

import type { IDictionary } from '../../../types';
import type { IDictionary } from 'jodit/types';
import { isPlainObject } from '../checker';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/utils/config-proto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/utils
*/

import type { IDictionary } from '../../../types';
import type { IDictionary } from 'jodit/types';
import { isAtom } from './extend';
import { isArray, isPlainObject, isString, isVoid } from '../checker';
import { Config } from '../../../config';
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/utils/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/utils
*/

import type { IStyle, StyleValue } from '../../../types';
import type { IStyle, StyleValue } from 'jodit/types';
import { isPlainObject, isNumeric, isVoid, isBoolean } from '../checker/';
import { normalizeCssValue } from '../normalize/';
import { camelCase, kebabCase } from '../string/';
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/utils/data-bind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/utils
*/

import type { IEventEmitter, IViewComponent, Nullable } from '../../../types';
import type { IEventEmitter, IViewComponent, Nullable } from 'jodit/types';
import { ViewComponent } from '../../component';
import { isViewObject } from '../checker';

Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/utils/get-class-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/utils
*/

import type { IDictionary } from '../../../types';
import type { IDictionary } from 'jodit/types';
import { isFunction } from '../checker/is-function';

export const keepNames = new Map<Function, string>();
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/utils/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/utils
*/

import type { IDictionary, Nullable } from '../../../types';
import type { IDictionary, Nullable } from 'jodit/types';
import { isString } from '../checker/is-string';
import { isVoid } from '../checker/is-void';

Expand Down
1 change: 1 addition & 0 deletions src/core/helpers/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @module helpers/utils
*/

export * from './assert';
export * from './mark-deprecated';
export * from './utils';
export * from './get';
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/utils/parse-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/utils
*/

import type { IDictionary } from '../../../types';
import type { IDictionary } from 'jodit/types';

/**
* Parse query string
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/utils/set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/utils
*/

import type { IDictionary } from '../../../types';
import type { IDictionary } from 'jodit/types';
import { isString } from '../checker/is-string';
import { isNumeric } from '../checker/is-numeric';
import { isArray } from '../checker/is-array';
Expand Down
2 changes: 1 addition & 1 deletion src/core/helpers/utils/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module helpers/utils
*/

import type { CanUndef } from '../../../types';
import type { CanUndef } from 'jodit/types';

export class LimitedStack<T> {
private stack: T[] = [];
Expand Down
Loading

0 comments on commit e71e679

Please sign in to comment.