@editora/performance
Advanced tools
| "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class o{constructor(e={}){this.batch=[],this.batchTimeout=null,this.config={maxBatchSize:10,maxBatchTime:16,enabled:!0,...e}}add(e){if(!this.config.enabled){this.flush([e]);return}this.batch.push(e),this.batch.length>=this.config.maxBatchSize?this.flushBatch():this.batch.length===1&&this.scheduleFlush()}flushBatch(){this.batch.length>0&&(this.flush([...this.batch]),this.batch=[],this.clearTimeout())}setOnFlush(e){this.onFlush=e}getBatchSize(){return this.batch.length}isEnabled(){return this.config.enabled}setEnabled(e){this.config.enabled=e,e||this.flushBatch()}flush(e){if(this.onFlush){const t=e[0]?.beforeState||{};this.onFlush(e,t)}}scheduleFlush(){this.clearTimeout(),this.batchTimeout=window.setTimeout(()=>{this.flushBatch()},this.config.maxBatchTime)}clearTimeout(){this.batchTimeout&&(window.clearTimeout(this.batchTimeout),this.batchTimeout=null)}destroy(){this.clearTimeout(),this.flushBatch()}}function l(r){return new o(r)}class c{constructor(e=250){this.timeoutId=null,this.delay=e}execute(e,...t){this.timeoutId!==null&&clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{e(...t)},this.delay)}cancel(){this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}}function u(r){return new c(r)}class h{constructor(e={}){this.cleanupInterval=null,this.eventListeners=new Map,this.timeouts=new Set,this.intervals=new Set,this.config={maxMemoryMB:100,cleanupIntervalMs:3e4,autoCleanup:!0,...e},this.config.autoCleanup&&this.startAutoCleanup()}registerEventListener(e,t,n,i){const s=`${t}_${Math.random()}`;e.addEventListener(t,n,i),this.eventListeners.set(s,n)}registerTimeout(e){this.timeouts.add(e)}registerInterval(e){this.intervals.add(e)}unregisterTimeout(e){this.timeouts.delete(e)}unregisterInterval(e){this.intervals.delete(e)}forceGC(){window.gc&&window.gc()}getMemoryUsage(){const e=performance.memory;return e?{used:Math.round(e.usedJSHeapSize/1024/1024),total:Math.round(e.totalJSHeapSize/1024/1024),limit:Math.round(e.jsHeapSizeLimit/1024/1024)}:null}isMemoryHigh(){const e=this.getMemoryUsage();return e?e.used>this.config.maxMemoryMB:!1}cleanup(){for(const e of this.timeouts)clearTimeout(e);this.timeouts.clear();for(const e of this.intervals)clearInterval(e);this.intervals.clear(),this.forceGC()}startAutoCleanup(){this.cleanupInterval=window.setInterval(()=>{this.isMemoryHigh()&&this.cleanup()},this.config.cleanupIntervalMs)}stopAutoCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}destroy(){this.stopAutoCleanup(),this.cleanup(),this.eventListeners.clear()}}function d(r){return new h(r)}class m{constructor(e={}){this.metrics=[],this.isMonitoring=!1,this.sampleInterval=null,this.currentOperation=null,this.config={enabled:!0,sampleInterval:5e3,maxSamples:100,logWarnings:!0,...e},this.config.enabled&&this.startMonitoring()}startMonitoring(){this.isMonitoring||(this.isMonitoring=!0,this.sampleInterval=window.setInterval(()=>{this.collectMetrics()},this.config.sampleInterval))}stopMonitoring(){this.isMonitoring&&(this.isMonitoring=!1,this.sampleInterval&&(clearInterval(this.sampleInterval),this.sampleInterval=null))}startOperation(e){if(!this.config.enabled)return;const t=performance.memory;this.currentOperation={type:e,startTime:performance.now(),memoryStart:t?t.usedJSHeapSize:0}}endOperation(){if(!this.config.enabled||!this.currentOperation)return null;const e=performance.now(),t=performance.memory,n=t?t.usedJSHeapSize:0,i={domTime:0,renderTime:e-this.currentOperation.startTime,transactionTime:e-this.currentOperation.startTime,memoryUsage:Math.round((n-this.currentOperation.memoryStart)/1024/1024),timestamp:Date.now()};switch(this.currentOperation.type){case"transaction":i.transactionTime=e-this.currentOperation.startTime;break;case"render":i.renderTime=e-this.currentOperation.startTime;break;case"dom":i.domTime=e-this.currentOperation.startTime;break}return this.addMetrics(i),this.currentOperation=null,this.config.logWarnings&&this.checkPerformanceWarnings(i),i}getMetrics(){return[...this.metrics]}getAverageMetrics(e=6e4){const t=Date.now()-e,n=this.metrics.filter(s=>s.timestamp>t);if(n.length===0)return{};const i=n.reduce((s,a)=>({domTime:s.domTime+a.domTime,renderTime:s.renderTime+a.renderTime,transactionTime:s.transactionTime+a.transactionTime,memoryUsage:s.memoryUsage+a.memoryUsage}),{domTime:0,renderTime:0,transactionTime:0,memoryUsage:0});return{domTime:Math.round(i.domTime/n.length),renderTime:Math.round(i.renderTime/n.length),transactionTime:Math.round(i.transactionTime/n.length),memoryUsage:Math.round(i.memoryUsage/n.length)}}clearMetrics(){this.metrics=[]}collectMetrics(){const e=performance.memory;if(!e)return;const t={domTime:0,renderTime:0,transactionTime:0,memoryUsage:Math.round(e.usedJSHeapSize/1024/1024),timestamp:Date.now()};this.addMetrics(t)}addMetrics(e){this.metrics.push(e),this.metrics.length>this.config.maxSamples&&(this.metrics=this.metrics.slice(-this.config.maxSamples))}checkPerformanceWarnings(e){const t=[];e.renderTime>16&&t.push(`Slow render: ${e.renderTime}ms`),e.transactionTime>100&&t.push(`Slow transaction: ${e.transactionTime}ms`),e.memoryUsage>50&&t.push(`High memory usage: ${e.memoryUsage}MB`),t.length>0&&console.warn("Performance warning:",t.join(", "))}destroy(){this.stopMonitoring(),this.clearMetrics()}}function f(r){return new m(r)}exports.Debouncer=c;exports.MemoryManager=h;exports.PerformanceMonitor=m;exports.TransactionBatcher=o;exports.createDebouncer=u;exports.createMemoryManager=d;exports.createPerformanceMonitor=f;exports.createTransactionBatcher=l; |
| class o { | ||
| constructor(e = {}) { | ||
| this.batch = [], this.batchTimeout = null, this.config = { | ||
| maxBatchSize: 10, | ||
| maxBatchTime: 16, | ||
| // ~60fps | ||
| enabled: !0, | ||
| ...e | ||
| }; | ||
| } | ||
| /** | ||
| * Add a transaction to the batch. | ||
| */ | ||
| add(e) { | ||
| if (!this.config.enabled) { | ||
| this.flush([e]); | ||
| return; | ||
| } | ||
| this.batch.push(e), this.batch.length >= this.config.maxBatchSize ? this.flushBatch() : this.batch.length === 1 && this.scheduleFlush(); | ||
| } | ||
| /** | ||
| * Flush all pending transactions. | ||
| */ | ||
| flushBatch() { | ||
| this.batch.length > 0 && (this.flush([...this.batch]), this.batch = [], this.clearTimeout()); | ||
| } | ||
| /** | ||
| * Set flush callback. | ||
| */ | ||
| setOnFlush(e) { | ||
| this.onFlush = e; | ||
| } | ||
| /** | ||
| * Get current batch size. | ||
| */ | ||
| getBatchSize() { | ||
| return this.batch.length; | ||
| } | ||
| /** | ||
| * Check if batching is enabled. | ||
| */ | ||
| isEnabled() { | ||
| return this.config.enabled; | ||
| } | ||
| /** | ||
| * Enable or disable batching. | ||
| */ | ||
| setEnabled(e) { | ||
| this.config.enabled = e, e || this.flushBatch(); | ||
| } | ||
| /** | ||
| * Force immediate flush of all transactions. | ||
| */ | ||
| flush(e) { | ||
| if (this.onFlush) { | ||
| const t = e[0]?.beforeState || {}; | ||
| this.onFlush(e, t); | ||
| } | ||
| } | ||
| /** | ||
| * Schedule automatic flush. | ||
| */ | ||
| scheduleFlush() { | ||
| this.clearTimeout(), this.batchTimeout = window.setTimeout(() => { | ||
| this.flushBatch(); | ||
| }, this.config.maxBatchTime); | ||
| } | ||
| /** | ||
| * Clear pending timeout. | ||
| */ | ||
| clearTimeout() { | ||
| this.batchTimeout && (window.clearTimeout(this.batchTimeout), this.batchTimeout = null); | ||
| } | ||
| /** | ||
| * Clean up resources. | ||
| */ | ||
| destroy() { | ||
| this.clearTimeout(), this.flushBatch(); | ||
| } | ||
| } | ||
| function l(r) { | ||
| return new o(r); | ||
| } | ||
| class h { | ||
| constructor(e = 250) { | ||
| this.timeoutId = null, this.delay = e; | ||
| } | ||
| /** | ||
| * Execute the debounced function. | ||
| */ | ||
| execute(e, ...t) { | ||
| this.timeoutId !== null && clearTimeout(this.timeoutId), this.timeoutId = window.setTimeout(() => { | ||
| e(...t); | ||
| }, this.delay); | ||
| } | ||
| /** | ||
| * Cancel pending execution. | ||
| */ | ||
| cancel() { | ||
| this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null); | ||
| } | ||
| } | ||
| function u(r) { | ||
| return new h(r); | ||
| } | ||
| class m { | ||
| constructor(e = {}) { | ||
| this.cleanupInterval = null, this.eventListeners = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Set(), this.intervals = /* @__PURE__ */ new Set(), this.config = { | ||
| maxMemoryMB: 100, | ||
| cleanupIntervalMs: 3e4, | ||
| // 30 seconds | ||
| autoCleanup: !0, | ||
| ...e | ||
| }, this.config.autoCleanup && this.startAutoCleanup(); | ||
| } | ||
| /** | ||
| * Register an event listener for cleanup. | ||
| */ | ||
| registerEventListener(e, t, n, i) { | ||
| const s = `${t}_${Math.random()}`; | ||
| e.addEventListener(t, n, i), this.eventListeners.set(s, n); | ||
| } | ||
| /** | ||
| * Register a timeout for cleanup. | ||
| */ | ||
| registerTimeout(e) { | ||
| this.timeouts.add(e); | ||
| } | ||
| /** | ||
| * Register an interval for cleanup. | ||
| */ | ||
| registerInterval(e) { | ||
| this.intervals.add(e); | ||
| } | ||
| /** | ||
| * Unregister a timeout. | ||
| */ | ||
| unregisterTimeout(e) { | ||
| this.timeouts.delete(e); | ||
| } | ||
| /** | ||
| * Unregister an interval. | ||
| */ | ||
| unregisterInterval(e) { | ||
| this.intervals.delete(e); | ||
| } | ||
| /** | ||
| * Force garbage collection if available. | ||
| */ | ||
| forceGC() { | ||
| window.gc && window.gc(); | ||
| } | ||
| /** | ||
| * Get current memory usage if available. | ||
| */ | ||
| getMemoryUsage() { | ||
| const e = performance.memory; | ||
| return e ? { | ||
| used: Math.round(e.usedJSHeapSize / 1024 / 1024), | ||
| total: Math.round(e.totalJSHeapSize / 1024 / 1024), | ||
| limit: Math.round(e.jsHeapSizeLimit / 1024 / 1024) | ||
| } : null; | ||
| } | ||
| /** | ||
| * Check if memory usage is high. | ||
| */ | ||
| isMemoryHigh() { | ||
| const e = this.getMemoryUsage(); | ||
| return e ? e.used > this.config.maxMemoryMB : !1; | ||
| } | ||
| /** | ||
| * Perform cleanup operations. | ||
| */ | ||
| cleanup() { | ||
| for (const e of this.timeouts) | ||
| clearTimeout(e); | ||
| this.timeouts.clear(); | ||
| for (const e of this.intervals) | ||
| clearInterval(e); | ||
| this.intervals.clear(), this.forceGC(); | ||
| } | ||
| /** | ||
| * Start automatic cleanup. | ||
| */ | ||
| startAutoCleanup() { | ||
| this.cleanupInterval = window.setInterval(() => { | ||
| this.isMemoryHigh() && this.cleanup(); | ||
| }, this.config.cleanupIntervalMs); | ||
| } | ||
| /** | ||
| * Stop automatic cleanup. | ||
| */ | ||
| stopAutoCleanup() { | ||
| this.cleanupInterval && (clearInterval(this.cleanupInterval), this.cleanupInterval = null); | ||
| } | ||
| /** | ||
| * Destroy the memory manager and perform final cleanup. | ||
| */ | ||
| destroy() { | ||
| this.stopAutoCleanup(), this.cleanup(), this.eventListeners.clear(); | ||
| } | ||
| } | ||
| function d(r) { | ||
| return new m(r); | ||
| } | ||
| class c { | ||
| constructor(e = {}) { | ||
| this.metrics = [], this.isMonitoring = !1, this.sampleInterval = null, this.currentOperation = null, this.config = { | ||
| enabled: !0, | ||
| sampleInterval: 5e3, | ||
| // 5 seconds | ||
| maxSamples: 100, | ||
| logWarnings: !0, | ||
| ...e | ||
| }, this.config.enabled && this.startMonitoring(); | ||
| } | ||
| /** | ||
| * Start monitoring performance. | ||
| */ | ||
| startMonitoring() { | ||
| this.isMonitoring || (this.isMonitoring = !0, this.sampleInterval = window.setInterval(() => { | ||
| this.collectMetrics(); | ||
| }, this.config.sampleInterval)); | ||
| } | ||
| /** | ||
| * Stop monitoring performance. | ||
| */ | ||
| stopMonitoring() { | ||
| this.isMonitoring && (this.isMonitoring = !1, this.sampleInterval && (clearInterval(this.sampleInterval), this.sampleInterval = null)); | ||
| } | ||
| /** | ||
| * Start tracking an operation. | ||
| */ | ||
| startOperation(e) { | ||
| if (!this.config.enabled) return; | ||
| const t = performance.memory; | ||
| this.currentOperation = { | ||
| type: e, | ||
| startTime: performance.now(), | ||
| memoryStart: t ? t.usedJSHeapSize : 0 | ||
| }; | ||
| } | ||
| /** | ||
| * End tracking an operation and record metrics. | ||
| */ | ||
| endOperation() { | ||
| if (!this.config.enabled || !this.currentOperation) return null; | ||
| const e = performance.now(), t = performance.memory, n = t ? t.usedJSHeapSize : 0, i = { | ||
| domTime: 0, | ||
| // Would be calculated based on operation type | ||
| renderTime: e - this.currentOperation.startTime, | ||
| transactionTime: e - this.currentOperation.startTime, | ||
| memoryUsage: Math.round((n - this.currentOperation.memoryStart) / 1024 / 1024), | ||
| timestamp: Date.now() | ||
| }; | ||
| switch (this.currentOperation.type) { | ||
| case "transaction": | ||
| i.transactionTime = e - this.currentOperation.startTime; | ||
| break; | ||
| case "render": | ||
| i.renderTime = e - this.currentOperation.startTime; | ||
| break; | ||
| case "dom": | ||
| i.domTime = e - this.currentOperation.startTime; | ||
| break; | ||
| } | ||
| return this.addMetrics(i), this.currentOperation = null, this.config.logWarnings && this.checkPerformanceWarnings(i), i; | ||
| } | ||
| /** | ||
| * Get current performance metrics. | ||
| */ | ||
| getMetrics() { | ||
| return [...this.metrics]; | ||
| } | ||
| /** | ||
| * Get average metrics over a time period. | ||
| */ | ||
| getAverageMetrics(e = 6e4) { | ||
| const t = Date.now() - e, n = this.metrics.filter((s) => s.timestamp > t); | ||
| if (n.length === 0) return {}; | ||
| const i = n.reduce( | ||
| (s, a) => ({ | ||
| domTime: s.domTime + a.domTime, | ||
| renderTime: s.renderTime + a.renderTime, | ||
| transactionTime: s.transactionTime + a.transactionTime, | ||
| memoryUsage: s.memoryUsage + a.memoryUsage | ||
| }), | ||
| { domTime: 0, renderTime: 0, transactionTime: 0, memoryUsage: 0 } | ||
| ); | ||
| return { | ||
| domTime: Math.round(i.domTime / n.length), | ||
| renderTime: Math.round(i.renderTime / n.length), | ||
| transactionTime: Math.round(i.transactionTime / n.length), | ||
| memoryUsage: Math.round(i.memoryUsage / n.length) | ||
| }; | ||
| } | ||
| /** | ||
| * Clear all metrics. | ||
| */ | ||
| clearMetrics() { | ||
| this.metrics = []; | ||
| } | ||
| /** | ||
| * Collect current performance metrics. | ||
| */ | ||
| collectMetrics() { | ||
| const e = performance.memory; | ||
| if (!e) return; | ||
| const t = { | ||
| domTime: 0, | ||
| renderTime: 0, | ||
| transactionTime: 0, | ||
| memoryUsage: Math.round(e.usedJSHeapSize / 1024 / 1024), | ||
| timestamp: Date.now() | ||
| }; | ||
| this.addMetrics(t); | ||
| } | ||
| /** | ||
| * Add metrics to the collection. | ||
| */ | ||
| addMetrics(e) { | ||
| this.metrics.push(e), this.metrics.length > this.config.maxSamples && (this.metrics = this.metrics.slice(-this.config.maxSamples)); | ||
| } | ||
| /** | ||
| * Check for performance warnings. | ||
| */ | ||
| checkPerformanceWarnings(e) { | ||
| const t = []; | ||
| e.renderTime > 16 && t.push(`Slow render: ${e.renderTime}ms`), e.transactionTime > 100 && t.push(`Slow transaction: ${e.transactionTime}ms`), e.memoryUsage > 50 && t.push(`High memory usage: ${e.memoryUsage}MB`), t.length > 0 && console.warn("Performance warning:", t.join(", ")); | ||
| } | ||
| /** | ||
| * Destroy the monitor and clean up resources. | ||
| */ | ||
| destroy() { | ||
| this.stopMonitoring(), this.clearMetrics(); | ||
| } | ||
| } | ||
| function f(r) { | ||
| return new c(r); | ||
| } | ||
| export { | ||
| h as Debouncer, | ||
| m as MemoryManager, | ||
| c as PerformanceMonitor, | ||
| o as TransactionBatcher, | ||
| u as createDebouncer, | ||
| d as createMemoryManager, | ||
| f as createPerformanceMonitor, | ||
| l as createTransactionBatcher | ||
| }; |
+110
| import type { EditorState } from "@editora/core"; | ||
| export interface Transaction { | ||
| beforeState?: EditorState; | ||
| [key: string]: unknown; | ||
| } | ||
| export interface TransactionBatchConfig { | ||
| maxBatchSize?: number; | ||
| maxBatchTime?: number; | ||
| enabled?: boolean; | ||
| } | ||
| export class TransactionBatcher { | ||
| constructor(config?: TransactionBatchConfig); | ||
| add(transaction: Transaction): void; | ||
| flushBatch(): void; | ||
| setOnFlush(callback: (transactions: Transaction[], state: EditorState) => void): void; | ||
| getBatchSize(): number; | ||
| isEnabled(): boolean; | ||
| setEnabled(enabled: boolean): void; | ||
| destroy(): void; | ||
| } | ||
| export function createTransactionBatcher(config?: TransactionBatchConfig): TransactionBatcher; | ||
| export interface DebounceConfig { | ||
| delay?: number; | ||
| leading?: boolean; | ||
| maxWait?: number; | ||
| } | ||
| export class Debouncer { | ||
| constructor(delay?: number); | ||
| execute<T extends unknown[]>(func: (...args: T) => unknown, ...args: T): void; | ||
| cancel(): void; | ||
| } | ||
| export function createDebouncer(delay?: number): Debouncer; | ||
| export function debounce<T extends unknown[]>( | ||
| func: (...args: T) => unknown, | ||
| delay?: number, | ||
| ): (...args: T) => void; | ||
| export interface MemoryConfig { | ||
| maxMemoryMB?: number; | ||
| cleanupIntervalMs?: number; | ||
| autoCleanup?: boolean; | ||
| } | ||
| export class MemoryManager { | ||
| constructor(config?: MemoryConfig); | ||
| registerEventListener( | ||
| element: EventTarget, | ||
| type: string, | ||
| listener: EventListener, | ||
| options?: boolean | AddEventListenerOptions, | ||
| ): void; | ||
| registerTimeout(timeoutId: number): void; | ||
| registerInterval(intervalId: number): void; | ||
| unregisterTimeout(timeoutId: number): void; | ||
| unregisterInterval(intervalId: number): void; | ||
| forceGC(): void; | ||
| getMemoryUsage(): { used: number; total: number; limit: number } | null; | ||
| isMemoryHigh(): boolean; | ||
| cleanup(): void; | ||
| stopAutoCleanup(): void; | ||
| destroy(): void; | ||
| } | ||
| export function createMemoryManager(config?: MemoryConfig): MemoryManager; | ||
| export function getGlobalMemoryManager(): MemoryManager; | ||
| export interface PerformanceMetrics { | ||
| domTime: number; | ||
| renderTime: number; | ||
| transactionTime: number; | ||
| memoryUsage: number; | ||
| timestamp: number; | ||
| } | ||
| export interface PerformanceConfig { | ||
| enabled?: boolean; | ||
| sampleInterval?: number; | ||
| maxSamples?: number; | ||
| logWarnings?: boolean; | ||
| } | ||
| export class PerformanceMonitor { | ||
| constructor(config?: PerformanceConfig); | ||
| startMonitoring(): void; | ||
| stopMonitoring(): void; | ||
| startOperation(type: string): void; | ||
| endOperation(): PerformanceMetrics | null; | ||
| getMetrics(): PerformanceMetrics[]; | ||
| getAverageMetrics(durationMs?: number): Partial<PerformanceMetrics>; | ||
| clearMetrics(): void; | ||
| destroy(): void; | ||
| } | ||
| export function createPerformanceMonitor(config?: PerformanceConfig): PerformanceMonitor; | ||
| export function getGlobalPerformanceMonitor(): PerformanceMonitor; | ||
| export class LazyLoader { | ||
| load<T>(moduleId: string, loader: () => Promise<T>): Promise<T>; | ||
| unload(moduleId: string): void; | ||
| clear(): void; | ||
| } | ||
| export const lazyLoader: LazyLoader; |
+36
| # @editora/performance | ||
| Performance utilities for Editora editors. | ||
| ## Install | ||
| ```bash | ||
| npm install @editora/performance @editora/core | ||
| ``` | ||
| ## Exports | ||
| - `TransactionBatcher` / `createTransactionBatcher` | ||
| - `Debouncer` / `createDebouncer` / `debounce` | ||
| - `MemoryManager` / `createMemoryManager` / `getGlobalMemoryManager` | ||
| - `PerformanceMonitor` / `createPerformanceMonitor` / `getGlobalPerformanceMonitor` | ||
| - `LazyLoader` / `lazyLoader` | ||
| ## Usage | ||
| ```ts | ||
| import { createDebouncer, createPerformanceMonitor } from "@editora/performance"; | ||
| const debouncer = createDebouncer(120); | ||
| const monitor = createPerformanceMonitor({ enabled: true, sampleInterval: 5000 }); | ||
| debouncer.execute(() => { | ||
| monitor.startOperation("render"); | ||
| // render/update work... | ||
| monitor.endOperation(); | ||
| }); | ||
| ``` | ||
| ## License | ||
| MIT |
+22
-4
| { | ||
| "name": "@editora/performance", | ||
| "version": "1.0.2", | ||
| "version": "1.0.5", | ||
| "description": "Performance optimization utilities for Editora Rich Text Editor", | ||
| "homepage": "https://editora-free.netlify.app/", | ||
| "bugs": { | ||
| "url": "https://github.com/ajaykr089/Editora/issues" | ||
| }, | ||
| "authors": [ | ||
@@ -10,5 +14,14 @@ "Ajay Kumar <ajaykr089@gmail.com>" | ||
| "module": "dist/index.esm.js", | ||
| "types": "dist/index.d.ts", | ||
| "types": "index.d.ts", | ||
| "exports": { | ||
| ".": { | ||
| "types": "./index.d.ts", | ||
| "import": "./dist/index.esm.js", | ||
| "require": "./dist/index.cjs.js" | ||
| } | ||
| }, | ||
| "files": [ | ||
| "dist", | ||
| "index.d.ts", | ||
| "README.md", | ||
| "src" | ||
@@ -26,3 +39,3 @@ ], | ||
| "dependencies": { | ||
| "@editora/core": "^1.0.2" | ||
| "@editora/core": "^1.0.5" | ||
| }, | ||
@@ -49,5 +62,10 @@ "keywords": [ | ||
| "devDependencies": { | ||
| "@editora/core": "^1.0.5", | ||
| "typescript": "^5.0.0", | ||
| "vite": "^7.3.1" | ||
| }, | ||
| "gitHead": "b4a92679b7a31308632c48abd5e536476d58b0c7" | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "gitHead": "694494db58b809f0dcf24501696284faa1ab68a5" | ||
| } |
@@ -1,3 +0,8 @@ | ||
| import { Transaction, EditorState } from '@editora/core'; | ||
| import type { EditorState } from '@editora/core'; | ||
| export interface Transaction { | ||
| beforeState?: EditorState; | ||
| [key: string]: unknown; | ||
| } | ||
| /** | ||
@@ -141,2 +146,2 @@ * Configuration for transaction batching. | ||
| return new TransactionBatcher(config); | ||
| } | ||
| } |
-21
| MIT License | ||
| Copyright (c) 2026 Ajay Kumar | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
36988
92.84%11
37.5%1077
77.72%0
-100%0
-100%37
Infinity%3
200%Updated