From da34bb26263ef41b43351c3f230768d9e1728430 Mon Sep 17 00:00:00 2001 From: William Troup Date: Tue, 23 Jul 2024 19:54:31 +0100 Subject: [PATCH 1/7] Updated to v1.0.1. --- README.md | 6 +++--- README_NUGET.md | 6 +++--- dist/observe.esm.js | 2 +- dist/observe.esm.js.map | 2 +- dist/observe.js | 2 +- dist/observe.js.map | 2 +- dist/observe.min.js | 2 +- docs/CHANGE_LOG.md | 6 ++++++ observe.js.nuspec | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/_old/observe.js | 4 ++-- src/observe.ts | 4 ++-- src/ts/api.ts | 2 +- src/ts/constant.ts | 2 +- src/ts/data.ts | 2 +- src/ts/enum.ts | 2 +- src/ts/is.ts | 2 +- src/ts/type.ts | 2 +- 19 files changed, 31 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index def900d..f9277ed 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ Observe.js [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Observe.js%2C%20a%20free%20JavaScript%observe%builder&url=https://github.com/williamtroup/Observe.js&hashtags=javascript,html,observe) -[![npm](https://img.shields.io/badge/npmjs-v1.0.0-blue)](https://www.npmjs.com/package/jobserve.js) -[![nuget](https://img.shields.io/badge/nuget-v1.0.0-purple)](https://www.nuget.org/packages/jObserve.js/) +[![npm](https://img.shields.io/badge/npmjs-v1.0.1-blue)](https://www.npmjs.com/package/jobserve.js) +[![nuget](https://img.shields.io/badge/nuget-v1.0.1-purple)](https://www.nuget.org/packages/jObserve.js/) [![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Observe.js/blob/main/LICENSE.txt) [![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Observe.js/discussions) [![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://www.william-troup.com/) >

A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.

->

v1.0.0

+>

v1.0.1



diff --git a/README_NUGET.md b/README_NUGET.md index 2b5685f..b686156 100644 --- a/README_NUGET.md +++ b/README_NUGET.md @@ -1,8 +1,8 @@ -# Observe.js v1.0.0 +# Observe.js v1.0.1 [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Observe.js%2C%20a%20free%20JavaScript%observe%builder&url=https://github.com/williamtroup/Observe.js&hashtags=javascript,html,observe) -[![npm](https://img.shields.io/badge/npmjs-v1.0.0-blue)](https://www.npmjs.com/package/jobserve.js) -[![nuget](https://img.shields.io/badge/nuget-v1.0.0-purple)](https://www.nuget.org/packages/jObserve.js/) +[![npm](https://img.shields.io/badge/npmjs-v1.0.1-blue)](https://www.npmjs.com/package/jobserve.js) +[![nuget](https://img.shields.io/badge/nuget-v1.0.1-purple)](https://www.nuget.org/packages/jObserve.js/) [![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Observe.js/blob/main/LICENSE.txt) [![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Observe.js/discussions) [![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://www.william-troup.com/) diff --git a/dist/observe.esm.js b/dist/observe.esm.js index a015d3b..aa06650 100644 --- a/dist/observe.esm.js +++ b/dist/observe.esm.js @@ -545,7 +545,7 @@ var require_observe = __commonJS({ return _public; }, getVersion: function() { - return "1.0.0"; + return "1.0.1"; } }; (() => { diff --git a/dist/observe.esm.js.map b/dist/observe.esm.js.map index ecd886c..c8761c3 100644 --- a/dist/observe.esm.js.map +++ b/dist/observe.esm.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/ts/constant.ts","../src/ts/enum.ts","../src/ts/is.ts","../src/ts/data.ts","../src/observe.ts"],"names":["Constant","Is","Data","String","result"],"mappings":";;;;;;;;;AAAA,IAaiB;AAbjB;AAAA;AAAA;AAaO,MAAUA,cAAV;AACI,MAAMA,UAAA,4BAA4B;AA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["/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file constant.ts\n * @version v1.0.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const OBSERVE_JS_ATTRIBUTE_NAME = \"data-observe-js\";\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file enum.ts\n * @version v1.0.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport const enum Char {\n empty = \"\",\n space = \"space\",\n dash = \"-\",\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file is.ts\n * @version v1.0.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Char } from \"./enum\"\n\n\nexport namespace Is {\n export function defined( value: any ) : boolean {\n return value !== null && value !== undefined && value.toString() !== Char.empty;\n }\n\n export function definedObject( object: any ) : boolean {\n return defined( object ) && typeof object === \"object\";\n }\n\n export function definedBoolean( object: any ) : boolean {\n return defined( object ) && typeof object === \"boolean\";\n }\n\n export function definedString( object: any ) : boolean {\n return defined( object ) && typeof object === \"string\";\n }\n\n export function definedFunction( object: any ) : boolean {\n return defined( object ) && typeof object === \"function\";\n }\n\n export function definedNumber( object: any ) : boolean {\n return defined( object ) && typeof object === \"number\";\n }\n\n export function definedArray( object: any ) : boolean {\n return definedObject( object ) && object instanceof Array;\n }\n\n export function definedDate( object: any ) : boolean {\n return definedObject( object ) && object instanceof Date;\n }\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file data.ts\n * @version v1.0.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Char } from \"./enum\";\nimport { Is } from \"./is\";\n\n\nexport namespace Data {\n export namespace String {\n export function newGuid() : string {\n const result: string[] = [];\n \n for ( let charIndex: number = 0; charIndex < 32; charIndex++ ) {\n if ( charIndex === 8 || charIndex === 12 || charIndex === 16 || charIndex === 20 ) {\n result.push( Char.dash );\n }\n \n const character: string = Math.floor( Math.random() * 16 ).toString( 16 );\n result.push( character );\n }\n \n return result.join( Char.empty );\n }\n }\n\n export function getDefaultAnyString( value: any, defaultValue: string ) : string {\n return typeof value === \"string\" ? value : defaultValue;\n }\n\n export function getDefaultString( value: any, defaultValue: string ) : string {\n return Is.definedString( value ) ? value : defaultValue;\n }\n\n export function getDefaultBoolean( value: any, defaultValue: boolean ) : boolean {\n return Is.definedBoolean( value ) ? value : defaultValue;\n }\n\n export function getDefaultNumber( value: any, defaultValue: number ) : number {\n return Is.definedNumber( value ) ? value : defaultValue;\n }\n\n export function getDefaultFunction( value: any, defaultValue: object ) : any {\n return Is.definedFunction( value ) ? value : defaultValue;\n }\n\n export function getDefaultArray( value: any, defaultValue: any[] ) : any[] {\n return Is.definedArray( value ) ? value : defaultValue;\n }\n\n export function getDefaultObject( value: any, defaultValue: object ) : any {\n return Is.definedObject( value ) ? value : defaultValue;\n }\n\n export function getDefaultDate( value: any, defaultValue: Date ) : Date {\n return Is.definedDate( value ) ? value : defaultValue;\n }\n\n export function getDefaultStringOrArray( value: any, defaultValue: string[] ) : string[] {\n let result: string[] = defaultValue;\n\n if ( Is.definedString( value ) ) {\n const values: string[] = value.toString().split( Char.space );\n\n if ( values.length === 0 ) {\n value = defaultValue;\n } else {\n result = values;\n }\n\n } else {\n result = getDefaultArray( value, defaultValue );\n }\n\n return result;\n }\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file observe.ts\n * @version v1.0.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport {\n type WatchOptionEvents,\n type WatchOptions,\n type Configuration,\n type ObserveWatch, \n type ConfigurationText } from \"./ts/type\";\n \nimport { Constant } from \"./ts/constant\";\nimport { Data } from \"./ts/data\";\nimport { Char } from \"./ts/enum\";\nimport { Is } from \"./ts/is\";\nimport { type PublicApi } from \"./ts/api\";\n\n\ntype StringToJson = {\n parsed: boolean;\n object: any;\n};\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Watches\n const _watches: Record = {} as Record;\n let _watches_Cancel: boolean = false;\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Observable DOM Object Creation / Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function collectDOMObjects() : void {\n const tagTypes: string[] = _configuration.domElementTypes as string[];\n const tagTypesLength: number = tagTypes.length;\n\n for ( let tagTypeIndex: number = 0; tagTypeIndex < tagTypesLength; tagTypeIndex++ ) {\n const domElements: HTMLCollectionOf = document.getElementsByTagName( tagTypes[ tagTypeIndex ] );\n const elements: HTMLElement[] = [].slice.call( domElements );\n const elementsLength: number = elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < elementsLength; elementIndex++ ) {\n if ( !collectDOMObject( elements[ elementIndex ] ) ) {\n break;\n }\n }\n }\n }\n\n function collectDOMObject( element: HTMLElement ) : boolean {\n let result: boolean = true;\n\n if ( Is.defined( element ) && element.hasAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME ) ) {\n const bindingOptionsData: string = element.getAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME )!;\n\n if ( Is.definedString( bindingOptionsData ) ) {\n const watchOptionsJson: StringToJson = getObjectFromString( bindingOptionsData );\n\n if ( watchOptionsJson.parsed && Is.definedObject( watchOptionsJson.object ) ) {\n const watchOptions: WatchOptions = getWatchOptions( watchOptionsJson.object );\n\n if ( !Is.definedString( element.id ) ) {\n element.id = Data.String.newGuid();\n }\n\n if ( watchOptions.removeAttribute ) {\n element.removeAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME );\n }\n\n createWatch( element, watchOptions, element.id );\n\n } else {\n logError( _configuration.text!.attributeNotValidErrorText!.replace( \"{{attribute_name}}\", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );\n result = false;\n }\n\n } else {\n logError( _configuration.text!.attributeNotSetErrorText!.replace( \"{{attribute_name}}\", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );\n result = false;\n }\n }\n\n return result;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Watch Object Creation / Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function createWatch( object: any, options: any, domElementId: string = null! ) : string {\n let storageId: string = null!;\n\n if ( Is.definedObject( object ) ) {\n storageId = Data.String.newGuid();\n\n const watchOptions: WatchOptions = getWatchOptions( options );\n const watch: ObserveWatch = {} as ObserveWatch;\n let startWatchObject: any = null;\n\n watch.options = watchOptions;\n watch.totalChanges = 0;\n\n if ( Is.definedString( domElementId ) ) {\n const domElement: HTMLElement = document.getElementById( domElementId )!;\n\n if ( Is.defined( domElement ) ) {\n watch.domElementId = domElementId;\n watch.cachedObject = domElement.outerHTML;\n watch.originalObject = domElement.outerHTML;\n\n startWatchObject = domElement.outerHTML;\n }\n\n } else {\n watch.cachedObject = JSON.stringify( object );\n watch.originalObject = object;\n\n startWatchObject = object;\n }\n\n if ( Is.defined( watch.cachedObject ) ) {\n fireCustomTriggerEvent( watch.options.events!.onStart!, startWatchObject );\n\n watch.timer = setInterval( function() {\n watchTimer( watchOptions, storageId );\n }, watchOptions.timeout );\n \n _watches[ storageId ] = watch;\n }\n }\n\n return storageId;\n }\n\n function watchTimer( watchOptions: WatchOptions, storageId: string ) : void {\n const currentDateTime: Date = new Date();\n\n if ( !Is.definedDate( watchOptions.starts ) || currentDateTime >= watchOptions.starts! ) {\n watchObjectForChanges( storageId );\n\n if ( Is.definedDate( watchOptions.expires ) && currentDateTime >= watchOptions.expires! ) {\n cancelWatchObject( storageId );\n }\n }\n }\n\n function watchObjectForChanges( storageId: string ) : void {\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watch: ObserveWatch = _watches[ storageId ];\n const isDomElement: boolean = Is.definedString( watch.domElementId );\n let domElement: HTMLElement = null!;\n\n if ( isDomElement ) {\n domElement = document.getElementById( watch.domElementId )!;\n\n if ( Is.defined( domElement ) ) {\n watch.originalObject = domElement.outerHTML;\n } else {\n watch.originalObject = Char.empty;\n\n fireCustomTriggerEvent( watch.options.events!.onRemove!, watch.domElementId );\n }\n }\n\n const cachedObject: any = watch.cachedObject;\n const originalObject: any = watch.originalObject;\n const originalObjectJson: any = !isDomElement ? JSON.stringify( originalObject ) : originalObject;\n\n if ( cachedObject !== originalObjectJson ) {\n if ( watch.options.reset ) {\n if ( isDomElement ) {\n domElement.outerHTML = watch.cachedObject;\n } else {\n watch.originalObject = getObjectFromString( cachedObject ).object;\n }\n\n } else {\n watch.cachedObject = originalObjectJson;\n }\n\n if ( isDomElement ) {\n fireCustomTriggerEvent( watch.options.events!.onChange!, cachedObject, originalObjectJson );\n } else {\n\n const oldValue: any = getObjectFromString( cachedObject ).object;\n const newValue: any = getObjectFromString( originalObjectJson ).object;\n\n if ( !Is.definedArray( oldValue ) && !Is.definedArray( newValue ) ) {\n compareWatchObject( oldValue, newValue, watch );\n\n if ( Is.definedFunction( watch.options.events!.onPropertyChange ) ) {\n compareWatchObjectProperties( oldValue, newValue, watch );\n }\n \n } else {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldValue, newValue );\n }\n }\n\n watch.totalChanges++;\n\n if ( watch.options.pauseTimeoutOnChange! > 0 ) {\n pauseWatchObject( storageId, watch.options.pauseTimeoutOnChange! );\n }\n\n if ( watch.options.cancelOnChange ) {\n cancelWatchObject( storageId );\n }\n\n if ( watch.options.maximumChangesBeforeCanceling! > 0 && watch.totalChanges >= watch.options.maximumChangesBeforeCanceling! ) {\n cancelWatchObject( storageId );\n }\n }\n }\n }\n\n function compareWatchObject( oldObject: any, newObject: any, watch: ObserveWatch ) : void {\n if ( Is.definedArray( watch.options.propertyNames ) ) {\n const propertyNamesLength: number = watch.options.propertyNames!.length;\n\n for ( let propertyNameIndex: number = 0; propertyNameIndex < propertyNamesLength; propertyNameIndex++ ) {\n const propertyName: string = watch.options.propertyNames![ propertyNameIndex ];\n\n if ( oldObject[ propertyName ] !== newObject[ propertyName ] ) {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject );\n break;\n }\n }\n\n } else {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject );\n }\n }\n\n function compareWatchObjectProperties( oldObject: any, newObject: any, watch: ObserveWatch ) : void {\n for ( let propertyName in oldObject ) {\n if ( oldObject.hasOwnProperty( propertyName ) ) {\n const propertyOldValue: any = oldObject[ propertyName ];\n let propertyNewValue: any = null;\n\n if ( newObject.hasOwnProperty( propertyName ) ) {\n propertyNewValue = newObject[ propertyName ];\n }\n\n if ( Is.definedObject( propertyOldValue ) && Is.definedObject( propertyNewValue ) ) {\n compareWatchObjectProperties( propertyOldValue, propertyNewValue, watch );\n } else {\n\n if ( !Is.definedArray( watch.options.propertyNames ) || watch.options.propertyNames!.indexOf( propertyName ) > -1 ) {\n if ( JSON.stringify( propertyOldValue ) !== JSON.stringify( propertyNewValue ) ) {\n fireCustomTriggerEvent( watch.options.events!.onPropertyChange!, propertyName, propertyOldValue, propertyNewValue );\n }\n }\n }\n }\n }\n }\n\n function cancelWatchesForObjects() : void {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n cancelWatchObject( storageId );\n }\n }\n }\n\n function cancelWatchObject( storageId: string ) : void {\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watchOptions: WatchOptions = _watches[ storageId ].options;\n\n if ( watchOptions.allowCanceling || _watches_Cancel ) {\n fireCustomTriggerEvent( watchOptions.events!.onCancel!, storageId );\n clearInterval( _watches[ storageId ].timer );\n \n delete _watches[ storageId ];\n }\n }\n }\n\n function pauseWatchObject( storageId: string, milliseconds: number ) : boolean {\n let result: boolean = false;\n\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watchOptions: WatchOptions = _watches[ storageId ].options;\n\n if ( watchOptions.allowPausing ) {\n watchOptions.starts = new Date();\n watchOptions.starts.setMilliseconds( watchOptions.starts.getMilliseconds() + milliseconds );\n \n result = true;\n }\n }\n\n return result;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Watch Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function getWatchOptions( newOptions: any ) : WatchOptions {\n let options: WatchOptions = Data.getDefaultObject( newOptions, {} as WatchOptions );\n\n options.timeout = Data.getDefaultNumber( options.timeout, 250 );\n options.starts = Data.getDefaultDate( options.starts, null! );\n options.expires = Data.getDefaultDate( options.expires, null! );\n options.reset = Data.getDefaultBoolean( options.reset, false );\n options.cancelOnChange = Data.getDefaultBoolean( options.cancelOnChange, false );\n options.maximumChangesBeforeCanceling = Data.getDefaultNumber( options.maximumChangesBeforeCanceling, 0 );\n options.pauseTimeoutOnChange = Data.getDefaultNumber( options.pauseTimeoutOnChange, 0 );\n options.propertyNames = Data.getDefaultArray( options.propertyNames, null! );\n options.allowCanceling = Data.getDefaultBoolean( options.allowCanceling, true );\n options.allowPausing = Data.getDefaultBoolean( options.allowPausing, true );\n options.removeAttribute = Data.getDefaultBoolean( options.removeAttribute, true );\n\n options = getWatchOptionsCustomTriggers( options );\n\n return options;\n }\n\n function getWatchOptionsCustomTriggers( options: WatchOptions ) : WatchOptions {\n options.events = Data.getDefaultObject( options.events, {} as WatchOptionEvents );\n options.events!.onChange = Data.getDefaultFunction( options.events!.onChange, null! );\n options.events!.onPropertyChange = Data.getDefaultFunction( options.events!.onPropertyChange, null! );\n options.events!.onCancel = Data.getDefaultFunction( options.events!.onCancel, null! );\n options.events!.onRemove = Data.getDefaultFunction( options.events!.onRemove, null! );\n options.events!.onStart = Data.getDefaultFunction( options.events!.onStart, null! );\n\n return options;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Triggering Custom Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function fireCustomTriggerEvent( triggerFunction: Function, ...args : any[] ) : void {\n if ( Is.definedFunction( triggerFunction ) ) {\n triggerFunction.apply( null, [].slice.call( args, 0 ) );\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Default Parameter/Option Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function getObjectFromString( objectString: any ) : StringToJson {\n const result: StringToJson = {\n parsed: true,\n object: null\n } as StringToJson;\n\n try {\n if ( Is.definedString( objectString ) ) {\n result.object = JSON.parse( objectString );\n }\n\n } catch ( e1: any ) {\n try {\n result.object = eval( `(${objectString})` );\n\n if ( Is.definedFunction( result.object ) ) {\n result.object = result.object();\n }\n \n } catch ( e2: any ) {\n if ( !_configuration.safeMode ) {\n logError( _configuration.text!.objectErrorText!.replace( \"{{error_1}}\", e1.message ).replace( \"{{error_2}}\", e2.message ) );\n result.parsed = false;\n }\n \n result.object = null;\n }\n }\n\n return result;\n }\n\n function logError( error: string ) : boolean {\n let result: boolean = true;\n\n if ( !_configuration.safeMode ) {\n console.error( error );\n result = false;\n }\n\n return result;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: any = null ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.safeMode = Data.getDefaultBoolean( _configuration.safeMode, true );\n _configuration.domElementTypes = Data.getDefaultStringOrArray( _configuration.domElementTypes, [ \"*\" ] );\n\n buildDefaultConfigurationStrings();\n }\n\n function buildDefaultConfigurationStrings() : void {\n _configuration.text = Data.getDefaultObject( _configuration.text, {} as ConfigurationText );\n _configuration.text!.objectErrorText = Data.getDefaultString( _configuration.text!.objectErrorText, \"Errors in object: {{error_1}}, {{error_2}}\" );\n _configuration.text!.attributeNotValidErrorText = Data.getDefaultString( _configuration.text!.attributeNotValidErrorText, \"The attribute '{{attribute_name}}' is not a valid object.\" );\n _configuration.text!.attributeNotSetErrorText = Data.getDefaultString( _configuration.text!.attributeNotSetErrorText, \"The attribute '{{attribute_name}}' has not been set correctly.\" ); \n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions:\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n const _public: PublicApi = {\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Watching Objects\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n watch: function ( object: any, options: WatchOptions ) : string {\n return createWatch( object, options );\n },\n\n cancelWatch: function ( id: string ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n cancelWatchObject( id );\n \n result = true;\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n cancelWatchObject( storageId );\n \n result = true;\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n cancelWatches: function () : PublicApi {\n cancelWatchesForObjects();\n\n return _public;\n },\n\n getWatch: function ( id: string ) : ObserveWatch {\n let result: ObserveWatch = null!;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n result = _watches[ id ];\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n result = _watches[ storageId ];\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n getWatches: function () : Record {\n return _watches;\n },\n\n pauseWatch: function ( id: string, milliseconds: number ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) && Is.definedNumber( milliseconds ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n result = pauseWatchObject( id, milliseconds );\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n result = pauseWatchObject( storageId, milliseconds );\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n pauseWatches: function ( milliseconds: number ) : PublicApi {\n if ( Is.definedNumber( milliseconds ) ) {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n pauseWatchObject( storageId, milliseconds );\n }\n }\n }\n \n return _public;\n },\n\n resumeWatch: function ( id: string ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n _watches[ id ].options.starts = null!;\n result = true;\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n _watches[ storageId ].options.starts = null!;\n result = true;\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n resumeWatches: function () : PublicApi {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n _watches[ storageId ].options.starts = null!;\n }\n }\n \n return _public;\n },\n\n searchDomForNewWatches: function () : PublicApi {\n collectDOMObjects();\n\n return _public;\n },\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Configuration\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n setConfiguration: function ( newConfiguration: any ) : PublicApi {\n if ( Is.definedObject( newConfiguration ) ) {\n let configurationHasChanged: boolean = false;\n const newInternalConfiguration: any = _configuration;\n \n for ( let propertyName in newConfiguration ) {\n if ( newConfiguration.hasOwnProperty( propertyName ) && _configuration.hasOwnProperty( propertyName ) && newInternalConfiguration[ propertyName ] !== newConfiguration[ propertyName ] ) {\n newInternalConfiguration[ propertyName ] = newConfiguration[ propertyName ];\n configurationHasChanged = true;\n }\n }\n \n if ( configurationHasChanged ) {\n buildDefaultConfiguration( newInternalConfiguration );\n }\n }\n \n return _public;\n },\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Additional Data\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n getVersion: function () : string {\n return \"1.0.0\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Observe.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", function() {\n collectDOMObjects();\n } );\n\n window.addEventListener( \"pagehide\", function() {\n _watches_Cancel = true;\n\n cancelWatchesForObjects();\n } );\n\n if ( !Is.defined( window.$observe ) ) {\n window.$observe = _public;\n }\n } )();\n} )();"]} \ No newline at end of file +{"version":3,"sources":["../src/ts/constant.ts","../src/ts/enum.ts","../src/ts/is.ts","../src/ts/data.ts","../src/observe.ts"],"names":["Constant","Is","Data","String","result"],"mappings":";;;;;;;;;AAAA,IAaiB;AAbjB;AAAA;AAAA;AAaO,MAAUA,cAAV;AACI,MAAMA,UAAA,4BAA4B;AAAA,OAD5B;AAAA;AAAA;;;ACbjB;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAgBiB;AAhBjB;AAAA;AAAA;AAaA;AAGO,MAAUC,QAAV;AACI,eAAS,QAAS,OAAuB;AAC5C,eAAO,UAAU,QAAQ,UAAU,UAAa,MAAM,SAAS;AAAA,MACnE;AAFO,MAAAA,IAAS;AAIT,eAAS,cAAe,QAAwB;AACnD,eAAO,QAAS,MAAO,KAAK,OAAO,WAAW;AAAA,MAClD;AAFO,MAAAA,IAAS;AAIT,eAAS,eAAgB,QAAwB;AACpD,eAAO,QAAS,MAAO,KAAK,OAAO,WAAW;AAAA,MAClD;AAFO,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,SAAW,kBAAoC;AAC7D,cAAK,GAAG,cAAe,gBAAiB,GAAI;AACxC,gBAAI,0BAAmC;AACvC,kBAAM,2BAAgC;AAEtC,qBAAU,gBAAgB,kBAAmB;AACzC,kBAAK,iBAAiB,eAAgB,YAAa,KAAK,eAAe,eAAgB,YAAa,KAAK,yBAA0B,YAAa,MAAM,iBAAkB,YAAa,GAAI;AACrL,yCAA0B,YAAa,IAAI,iBAAkB,YAAa;AAC1E,0CAA0B;AAAA,cAC9B;AAAA,YACJ;AAEA,gBAAK,yBAA0B;AAC3B,wCAA2B,wBAAyB;AAAA,YACxD;AAAA,UACJ;AAEA,iBAAO;AAAA,QACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QASA,YAAY,WAAqB;AAC7B,iBAAO;AAAA,QACX;AAAA,MACJ;AASA,OAAE,MAAM;AACJ,kCAA0B;AAE1B,iBAAS,iBAAkB,oBAAoB,WAAW;AACtD,4BAAkB;AAAA,QACtB,CAAE;AAEF,eAAO,iBAAkB,YAAY,WAAW;AAC5C,4BAAkB;AAElB,kCAAwB;AAAA,QAC5B,CAAE;AAEF,YAAK,CAAC,GAAG,QAAS,OAAO,QAAS,GAAI;AAClC,iBAAO,WAAW;AAAA,QACtB;AAAA,MACJ,GAAI;AAAA,IACR,GAAI;AAAA;AAAA","sourcesContent":["/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file constant.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const OBSERVE_JS_ATTRIBUTE_NAME = \"data-observe-js\";\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file enum.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport const enum Char {\n empty = \"\",\n space = \"space\",\n dash = \"-\",\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file is.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Char } from \"./enum\"\n\n\nexport namespace Is {\n export function defined( value: any ) : boolean {\n return value !== null && value !== undefined && value.toString() !== Char.empty;\n }\n\n export function definedObject( object: any ) : boolean {\n return defined( object ) && typeof object === \"object\";\n }\n\n export function definedBoolean( object: any ) : boolean {\n return defined( object ) && typeof object === \"boolean\";\n }\n\n export function definedString( object: any ) : boolean {\n return defined( object ) && typeof object === \"string\";\n }\n\n export function definedFunction( object: any ) : boolean {\n return defined( object ) && typeof object === \"function\";\n }\n\n export function definedNumber( object: any ) : boolean {\n return defined( object ) && typeof object === \"number\";\n }\n\n export function definedArray( object: any ) : boolean {\n return definedObject( object ) && object instanceof Array;\n }\n\n export function definedDate( object: any ) : boolean {\n return definedObject( object ) && object instanceof Date;\n }\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file data.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Char } from \"./enum\";\nimport { Is } from \"./is\";\n\n\nexport namespace Data {\n export namespace String {\n export function newGuid() : string {\n const result: string[] = [];\n \n for ( let charIndex: number = 0; charIndex < 32; charIndex++ ) {\n if ( charIndex === 8 || charIndex === 12 || charIndex === 16 || charIndex === 20 ) {\n result.push( Char.dash );\n }\n \n const character: string = Math.floor( Math.random() * 16 ).toString( 16 );\n result.push( character );\n }\n \n return result.join( Char.empty );\n }\n }\n\n export function getDefaultAnyString( value: any, defaultValue: string ) : string {\n return typeof value === \"string\" ? value : defaultValue;\n }\n\n export function getDefaultString( value: any, defaultValue: string ) : string {\n return Is.definedString( value ) ? value : defaultValue;\n }\n\n export function getDefaultBoolean( value: any, defaultValue: boolean ) : boolean {\n return Is.definedBoolean( value ) ? value : defaultValue;\n }\n\n export function getDefaultNumber( value: any, defaultValue: number ) : number {\n return Is.definedNumber( value ) ? value : defaultValue;\n }\n\n export function getDefaultFunction( value: any, defaultValue: object ) : any {\n return Is.definedFunction( value ) ? value : defaultValue;\n }\n\n export function getDefaultArray( value: any, defaultValue: any[] ) : any[] {\n return Is.definedArray( value ) ? value : defaultValue;\n }\n\n export function getDefaultObject( value: any, defaultValue: object ) : any {\n return Is.definedObject( value ) ? value : defaultValue;\n }\n\n export function getDefaultDate( value: any, defaultValue: Date ) : Date {\n return Is.definedDate( value ) ? value : defaultValue;\n }\n\n export function getDefaultStringOrArray( value: any, defaultValue: string[] ) : string[] {\n let result: string[] = defaultValue;\n\n if ( Is.definedString( value ) ) {\n const values: string[] = value.toString().split( Char.space );\n\n if ( values.length === 0 ) {\n value = defaultValue;\n } else {\n result = values;\n }\n\n } else {\n result = getDefaultArray( value, defaultValue );\n }\n\n return result;\n }\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file observe.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport {\n type WatchOptionEvents,\n type WatchOptions,\n type Configuration,\n type ObserveWatch, \n type ConfigurationText } from \"./ts/type\";\n \nimport { Constant } from \"./ts/constant\";\nimport { Data } from \"./ts/data\";\nimport { Char } from \"./ts/enum\";\nimport { Is } from \"./ts/is\";\nimport { type PublicApi } from \"./ts/api\";\n\n\ntype StringToJson = {\n parsed: boolean;\n object: any;\n};\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Watches\n const _watches: Record = {} as Record;\n let _watches_Cancel: boolean = false;\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Observable DOM Object Creation / Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function collectDOMObjects() : void {\n const tagTypes: string[] = _configuration.domElementTypes as string[];\n const tagTypesLength: number = tagTypes.length;\n\n for ( let tagTypeIndex: number = 0; tagTypeIndex < tagTypesLength; tagTypeIndex++ ) {\n const domElements: HTMLCollectionOf = document.getElementsByTagName( tagTypes[ tagTypeIndex ] );\n const elements: HTMLElement[] = [].slice.call( domElements );\n const elementsLength: number = elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < elementsLength; elementIndex++ ) {\n if ( !collectDOMObject( elements[ elementIndex ] ) ) {\n break;\n }\n }\n }\n }\n\n function collectDOMObject( element: HTMLElement ) : boolean {\n let result: boolean = true;\n\n if ( Is.defined( element ) && element.hasAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME ) ) {\n const bindingOptionsData: string = element.getAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME )!;\n\n if ( Is.definedString( bindingOptionsData ) ) {\n const watchOptionsJson: StringToJson = getObjectFromString( bindingOptionsData );\n\n if ( watchOptionsJson.parsed && Is.definedObject( watchOptionsJson.object ) ) {\n const watchOptions: WatchOptions = getWatchOptions( watchOptionsJson.object );\n\n if ( !Is.definedString( element.id ) ) {\n element.id = Data.String.newGuid();\n }\n\n if ( watchOptions.removeAttribute ) {\n element.removeAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME );\n }\n\n createWatch( element, watchOptions, element.id );\n\n } else {\n logError( _configuration.text!.attributeNotValidErrorText!.replace( \"{{attribute_name}}\", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );\n result = false;\n }\n\n } else {\n logError( _configuration.text!.attributeNotSetErrorText!.replace( \"{{attribute_name}}\", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );\n result = false;\n }\n }\n\n return result;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Watch Object Creation / Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function createWatch( object: any, options: any, domElementId: string = null! ) : string {\n let storageId: string = null!;\n\n if ( Is.definedObject( object ) ) {\n storageId = Data.String.newGuid();\n\n const watchOptions: WatchOptions = getWatchOptions( options );\n const watch: ObserveWatch = {} as ObserveWatch;\n let startWatchObject: any = null;\n\n watch.options = watchOptions;\n watch.totalChanges = 0;\n\n if ( Is.definedString( domElementId ) ) {\n const domElement: HTMLElement = document.getElementById( domElementId )!;\n\n if ( Is.defined( domElement ) ) {\n watch.domElementId = domElementId;\n watch.cachedObject = domElement.outerHTML;\n watch.originalObject = domElement.outerHTML;\n\n startWatchObject = domElement.outerHTML;\n }\n\n } else {\n watch.cachedObject = JSON.stringify( object );\n watch.originalObject = object;\n\n startWatchObject = object;\n }\n\n if ( Is.defined( watch.cachedObject ) ) {\n fireCustomTriggerEvent( watch.options.events!.onStart!, startWatchObject );\n\n watch.timer = setInterval( function() {\n watchTimer( watchOptions, storageId );\n }, watchOptions.timeout );\n \n _watches[ storageId ] = watch;\n }\n }\n\n return storageId;\n }\n\n function watchTimer( watchOptions: WatchOptions, storageId: string ) : void {\n const currentDateTime: Date = new Date();\n\n if ( !Is.definedDate( watchOptions.starts ) || currentDateTime >= watchOptions.starts! ) {\n watchObjectForChanges( storageId );\n\n if ( Is.definedDate( watchOptions.expires ) && currentDateTime >= watchOptions.expires! ) {\n cancelWatchObject( storageId );\n }\n }\n }\n\n function watchObjectForChanges( storageId: string ) : void {\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watch: ObserveWatch = _watches[ storageId ];\n const isDomElement: boolean = Is.definedString( watch.domElementId );\n let domElement: HTMLElement = null!;\n\n if ( isDomElement ) {\n domElement = document.getElementById( watch.domElementId )!;\n\n if ( Is.defined( domElement ) ) {\n watch.originalObject = domElement.outerHTML;\n } else {\n watch.originalObject = Char.empty;\n\n fireCustomTriggerEvent( watch.options.events!.onRemove!, watch.domElementId );\n }\n }\n\n const cachedObject: any = watch.cachedObject;\n const originalObject: any = watch.originalObject;\n const originalObjectJson: any = !isDomElement ? JSON.stringify( originalObject ) : originalObject;\n\n if ( cachedObject !== originalObjectJson ) {\n if ( watch.options.reset ) {\n if ( isDomElement ) {\n domElement.outerHTML = watch.cachedObject;\n } else {\n watch.originalObject = getObjectFromString( cachedObject ).object;\n }\n\n } else {\n watch.cachedObject = originalObjectJson;\n }\n\n if ( isDomElement ) {\n fireCustomTriggerEvent( watch.options.events!.onChange!, cachedObject, originalObjectJson );\n } else {\n\n const oldValue: any = getObjectFromString( cachedObject ).object;\n const newValue: any = getObjectFromString( originalObjectJson ).object;\n\n if ( !Is.definedArray( oldValue ) && !Is.definedArray( newValue ) ) {\n compareWatchObject( oldValue, newValue, watch );\n\n if ( Is.definedFunction( watch.options.events!.onPropertyChange ) ) {\n compareWatchObjectProperties( oldValue, newValue, watch );\n }\n \n } else {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldValue, newValue );\n }\n }\n\n watch.totalChanges++;\n\n if ( watch.options.pauseTimeoutOnChange! > 0 ) {\n pauseWatchObject( storageId, watch.options.pauseTimeoutOnChange! );\n }\n\n if ( watch.options.cancelOnChange ) {\n cancelWatchObject( storageId );\n }\n\n if ( watch.options.maximumChangesBeforeCanceling! > 0 && watch.totalChanges >= watch.options.maximumChangesBeforeCanceling! ) {\n cancelWatchObject( storageId );\n }\n }\n }\n }\n\n function compareWatchObject( oldObject: any, newObject: any, watch: ObserveWatch ) : void {\n if ( Is.definedArray( watch.options.propertyNames ) ) {\n const propertyNamesLength: number = watch.options.propertyNames!.length;\n\n for ( let propertyNameIndex: number = 0; propertyNameIndex < propertyNamesLength; propertyNameIndex++ ) {\n const propertyName: string = watch.options.propertyNames![ propertyNameIndex ];\n\n if ( oldObject[ propertyName ] !== newObject[ propertyName ] ) {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject );\n break;\n }\n }\n\n } else {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject );\n }\n }\n\n function compareWatchObjectProperties( oldObject: any, newObject: any, watch: ObserveWatch ) : void {\n for ( let propertyName in oldObject ) {\n if ( oldObject.hasOwnProperty( propertyName ) ) {\n const propertyOldValue: any = oldObject[ propertyName ];\n let propertyNewValue: any = null;\n\n if ( newObject.hasOwnProperty( propertyName ) ) {\n propertyNewValue = newObject[ propertyName ];\n }\n\n if ( Is.definedObject( propertyOldValue ) && Is.definedObject( propertyNewValue ) ) {\n compareWatchObjectProperties( propertyOldValue, propertyNewValue, watch );\n } else {\n\n if ( !Is.definedArray( watch.options.propertyNames ) || watch.options.propertyNames!.indexOf( propertyName ) > -1 ) {\n if ( JSON.stringify( propertyOldValue ) !== JSON.stringify( propertyNewValue ) ) {\n fireCustomTriggerEvent( watch.options.events!.onPropertyChange!, propertyName, propertyOldValue, propertyNewValue );\n }\n }\n }\n }\n }\n }\n\n function cancelWatchesForObjects() : void {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n cancelWatchObject( storageId );\n }\n }\n }\n\n function cancelWatchObject( storageId: string ) : void {\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watchOptions: WatchOptions = _watches[ storageId ].options;\n\n if ( watchOptions.allowCanceling || _watches_Cancel ) {\n fireCustomTriggerEvent( watchOptions.events!.onCancel!, storageId );\n clearInterval( _watches[ storageId ].timer );\n \n delete _watches[ storageId ];\n }\n }\n }\n\n function pauseWatchObject( storageId: string, milliseconds: number ) : boolean {\n let result: boolean = false;\n\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watchOptions: WatchOptions = _watches[ storageId ].options;\n\n if ( watchOptions.allowPausing ) {\n watchOptions.starts = new Date();\n watchOptions.starts.setMilliseconds( watchOptions.starts.getMilliseconds() + milliseconds );\n \n result = true;\n }\n }\n\n return result;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Watch Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function getWatchOptions( newOptions: any ) : WatchOptions {\n let options: WatchOptions = Data.getDefaultObject( newOptions, {} as WatchOptions );\n\n options.timeout = Data.getDefaultNumber( options.timeout, 250 );\n options.starts = Data.getDefaultDate( options.starts, null! );\n options.expires = Data.getDefaultDate( options.expires, null! );\n options.reset = Data.getDefaultBoolean( options.reset, false );\n options.cancelOnChange = Data.getDefaultBoolean( options.cancelOnChange, false );\n options.maximumChangesBeforeCanceling = Data.getDefaultNumber( options.maximumChangesBeforeCanceling, 0 );\n options.pauseTimeoutOnChange = Data.getDefaultNumber( options.pauseTimeoutOnChange, 0 );\n options.propertyNames = Data.getDefaultArray( options.propertyNames, null! );\n options.allowCanceling = Data.getDefaultBoolean( options.allowCanceling, true );\n options.allowPausing = Data.getDefaultBoolean( options.allowPausing, true );\n options.removeAttribute = Data.getDefaultBoolean( options.removeAttribute, true );\n\n options = getWatchOptionsCustomTriggers( options );\n\n return options;\n }\n\n function getWatchOptionsCustomTriggers( options: WatchOptions ) : WatchOptions {\n options.events = Data.getDefaultObject( options.events, {} as WatchOptionEvents );\n options.events!.onChange = Data.getDefaultFunction( options.events!.onChange, null! );\n options.events!.onPropertyChange = Data.getDefaultFunction( options.events!.onPropertyChange, null! );\n options.events!.onCancel = Data.getDefaultFunction( options.events!.onCancel, null! );\n options.events!.onRemove = Data.getDefaultFunction( options.events!.onRemove, null! );\n options.events!.onStart = Data.getDefaultFunction( options.events!.onStart, null! );\n\n return options;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Triggering Custom Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function fireCustomTriggerEvent( triggerFunction: Function, ...args : any[] ) : void {\n if ( Is.definedFunction( triggerFunction ) ) {\n triggerFunction.apply( null, [].slice.call( args, 0 ) );\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Default Parameter/Option Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function getObjectFromString( objectString: any ) : StringToJson {\n const result: StringToJson = {\n parsed: true,\n object: null\n } as StringToJson;\n\n try {\n if ( Is.definedString( objectString ) ) {\n result.object = JSON.parse( objectString );\n }\n\n } catch ( e1: any ) {\n try {\n result.object = eval( `(${objectString})` );\n\n if ( Is.definedFunction( result.object ) ) {\n result.object = result.object();\n }\n \n } catch ( e2: any ) {\n if ( !_configuration.safeMode ) {\n logError( _configuration.text!.objectErrorText!.replace( \"{{error_1}}\", e1.message ).replace( \"{{error_2}}\", e2.message ) );\n result.parsed = false;\n }\n \n result.object = null;\n }\n }\n\n return result;\n }\n\n function logError( error: string ) : boolean {\n let result: boolean = true;\n\n if ( !_configuration.safeMode ) {\n console.error( error );\n result = false;\n }\n\n return result;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: any = null ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.safeMode = Data.getDefaultBoolean( _configuration.safeMode, true );\n _configuration.domElementTypes = Data.getDefaultStringOrArray( _configuration.domElementTypes, [ \"*\" ] );\n\n buildDefaultConfigurationStrings();\n }\n\n function buildDefaultConfigurationStrings() : void {\n _configuration.text = Data.getDefaultObject( _configuration.text, {} as ConfigurationText );\n _configuration.text!.objectErrorText = Data.getDefaultString( _configuration.text!.objectErrorText, \"Errors in object: {{error_1}}, {{error_2}}\" );\n _configuration.text!.attributeNotValidErrorText = Data.getDefaultString( _configuration.text!.attributeNotValidErrorText, \"The attribute '{{attribute_name}}' is not a valid object.\" );\n _configuration.text!.attributeNotSetErrorText = Data.getDefaultString( _configuration.text!.attributeNotSetErrorText, \"The attribute '{{attribute_name}}' has not been set correctly.\" ); \n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions:\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n const _public: PublicApi = {\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Watching Objects\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n watch: function ( object: any, options: WatchOptions ) : string {\n return createWatch( object, options );\n },\n\n cancelWatch: function ( id: string ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n cancelWatchObject( id );\n \n result = true;\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n cancelWatchObject( storageId );\n \n result = true;\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n cancelWatches: function () : PublicApi {\n cancelWatchesForObjects();\n\n return _public;\n },\n\n getWatch: function ( id: string ) : ObserveWatch {\n let result: ObserveWatch = null!;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n result = _watches[ id ];\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n result = _watches[ storageId ];\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n getWatches: function () : Record {\n return _watches;\n },\n\n pauseWatch: function ( id: string, milliseconds: number ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) && Is.definedNumber( milliseconds ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n result = pauseWatchObject( id, milliseconds );\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n result = pauseWatchObject( storageId, milliseconds );\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n pauseWatches: function ( milliseconds: number ) : PublicApi {\n if ( Is.definedNumber( milliseconds ) ) {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n pauseWatchObject( storageId, milliseconds );\n }\n }\n }\n \n return _public;\n },\n\n resumeWatch: function ( id: string ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n _watches[ id ].options.starts = null!;\n result = true;\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n _watches[ storageId ].options.starts = null!;\n result = true;\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n resumeWatches: function () : PublicApi {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n _watches[ storageId ].options.starts = null!;\n }\n }\n \n return _public;\n },\n\n searchDomForNewWatches: function () : PublicApi {\n collectDOMObjects();\n\n return _public;\n },\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Configuration\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n setConfiguration: function ( newConfiguration: any ) : PublicApi {\n if ( Is.definedObject( newConfiguration ) ) {\n let configurationHasChanged: boolean = false;\n const newInternalConfiguration: any = _configuration;\n \n for ( let propertyName in newConfiguration ) {\n if ( newConfiguration.hasOwnProperty( propertyName ) && _configuration.hasOwnProperty( propertyName ) && newInternalConfiguration[ propertyName ] !== newConfiguration[ propertyName ] ) {\n newInternalConfiguration[ propertyName ] = newConfiguration[ propertyName ];\n configurationHasChanged = true;\n }\n }\n \n if ( configurationHasChanged ) {\n buildDefaultConfiguration( newInternalConfiguration );\n }\n }\n \n return _public;\n },\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Additional Data\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n getVersion: function () : string {\n return \"1.0.1\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Observe.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", function() {\n collectDOMObjects();\n } );\n\n window.addEventListener( \"pagehide\", function() {\n _watches_Cancel = true;\n\n cancelWatchesForObjects();\n } );\n\n if ( !Is.defined( window.$observe ) ) {\n window.$observe = _public;\n }\n } )();\n} )();"]} \ No newline at end of file diff --git a/dist/observe.js b/dist/observe.js index 31a8f70..95dcb8c 100644 --- a/dist/observe.js +++ b/dist/observe.js @@ -505,7 +505,7 @@ var Data; return _public; }, getVersion: function() { - return "1.0.0"; + return "1.0.1"; } }; (() => { diff --git a/dist/observe.js.map b/dist/observe.js.map index a9ed779..c6ac7e0 100644 --- a/dist/observe.js.map +++ b/dist/observe.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/ts/constant.ts","../src/ts/is.ts","../src/ts/data.ts","../src/observe.ts"],"names":["Constant","Is","Data","String","result"],"mappings":";;;AAaO,IAAU;AAAA,CAAV,CAAUA,cAAV;AACI,EAAMA,UAAA,4BAA4B;AAAA,GAD5B;;;ACGV,IAAU;AAAA,CAAV,CAAUC,QAAV;AACI,WAAS,QAAS,OAAuB;AAC5C,WAAO,UAAU,QAAQ,UAAU,UAAa,MAAM,SAAS;AAAA,EACnE;AAFO,EAAAA,IAAS;AAIT,WAAS,cAAe,QAAwB;AACnD,WAAO,QAAS,MAAO,KAAK,OAAO,WAAW;AAAA,EAClD;AAFO,EAAAA,IAAS;AAIT,WAAS,eAAgB,QAAwB;AACpD,WAAO,QAAS,MAAO,KAAK,OAAO,WAAW;AAAA,EAClD;AAFO,EAAAA,IAAS;AAIT,WAAS,cAAe,QAAwB;AACnD,WAAO,QAAS,MAAO,KAAK,OAAO,WAAW;AAAA,EAClD;AAFO,EAAAA,IAAS;AAIT,WAAS,gBAAiB,QAAwB;AACrD,WAAO,QAAS,MAAO,KAAK,OAAO,WAAW;AAAA,EAClD;AAFO,EAAAA,IAAS;AAIT,WAAS,cAAe,QAAwB;AACnD,WAAO,QAAS,MAAO,KAA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AA,EACJ;AASA,GAAE,MAAM;AACJ,8BAA0B;AAE1B,aAAS,iBAAkB,oBAAoB,WAAW;AACtD,wBAAkB;AAAA,IACtB,CAAE;AAEF,WAAO,iBAAkB,YAAY,WAAW;AAC5C,wBAAkB;AAElB,8BAAwB;AAAA,IAC5B,CAAE;AAEF,QAAK,CAAC,GAAG,QAAS,OAAO,QAAS,GAAI;AAClC,aAAO,WAAW;AAAA,IACtB;AAAA,EACJ,GAAI;AACR,GAAI","sourcesContent":["/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file constant.ts\n * @version v1.0.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const OBSERVE_JS_ATTRIBUTE_NAME = \"data-observe-js\";\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file is.ts\n * @version v1.0.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Char } from \"./enum\"\n\n\nexport namespace Is {\n export function defined( value: any ) : boolean {\n return value !== null && value !== undefined && value.toString() !== Char.empty;\n }\n\n export function definedObject( object: any ) : boolean {\n return defined( object ) && typeof object === \"object\";\n }\n\n export function definedBoolean( object: any ) : boolean {\n return defined( object ) && typeof object === \"boolean\";\n }\n\n export function definedString( object: any ) : boolean {\n return defined( object ) && typeof object === \"string\";\n }\n\n export function definedFunction( object: any ) : boolean {\n return defined( object ) && typeof object === \"function\";\n }\n\n export function definedNumber( object: any ) : boolean {\n return defined( object ) && typeof object === \"number\";\n }\n\n export function definedArray( object: any ) : boolean {\n return definedObject( object ) && object instanceof Array;\n }\n\n export function definedDate( object: any ) : boolean {\n return definedObject( object ) && object instanceof Date;\n }\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file data.ts\n * @version v1.0.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Char } from \"./enum\";\nimport { Is } from \"./is\";\n\n\nexport namespace Data {\n export namespace String {\n export function newGuid() : string {\n const result: string[] = [];\n \n for ( let charIndex: number = 0; charIndex < 32; charIndex++ ) {\n if ( charIndex === 8 || charIndex === 12 || charIndex === 16 || charIndex === 20 ) {\n result.push( Char.dash );\n }\n \n const character: string = Math.floor( Math.random() * 16 ).toString( 16 );\n result.push( character );\n }\n \n return result.join( Char.empty );\n }\n }\n\n export function getDefaultAnyString( value: any, defaultValue: string ) : string {\n return typeof value === \"string\" ? value : defaultValue;\n }\n\n export function getDefaultString( value: any, defaultValue: string ) : string {\n return Is.definedString( value ) ? value : defaultValue;\n }\n\n export function getDefaultBoolean( value: any, defaultValue: boolean ) : boolean {\n return Is.definedBoolean( value ) ? value : defaultValue;\n }\n\n export function getDefaultNumber( value: any, defaultValue: number ) : number {\n return Is.definedNumber( value ) ? value : defaultValue;\n }\n\n export function getDefaultFunction( value: any, defaultValue: object ) : any {\n return Is.definedFunction( value ) ? value : defaultValue;\n }\n\n export function getDefaultArray( value: any, defaultValue: any[] ) : any[] {\n return Is.definedArray( value ) ? value : defaultValue;\n }\n\n export function getDefaultObject( value: any, defaultValue: object ) : any {\n return Is.definedObject( value ) ? value : defaultValue;\n }\n\n export function getDefaultDate( value: any, defaultValue: Date ) : Date {\n return Is.definedDate( value ) ? value : defaultValue;\n }\n\n export function getDefaultStringOrArray( value: any, defaultValue: string[] ) : string[] {\n let result: string[] = defaultValue;\n\n if ( Is.definedString( value ) ) {\n const values: string[] = value.toString().split( Char.space );\n\n if ( values.length === 0 ) {\n value = defaultValue;\n } else {\n result = values;\n }\n\n } else {\n result = getDefaultArray( value, defaultValue );\n }\n\n return result;\n }\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file observe.ts\n * @version v1.0.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport {\n type WatchOptionEvents,\n type WatchOptions,\n type Configuration,\n type ObserveWatch, \n type ConfigurationText } from \"./ts/type\";\n \nimport { Constant } from \"./ts/constant\";\nimport { Data } from \"./ts/data\";\nimport { Char } from \"./ts/enum\";\nimport { Is } from \"./ts/is\";\nimport { type PublicApi } from \"./ts/api\";\n\n\ntype StringToJson = {\n parsed: boolean;\n object: any;\n};\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Watches\n const _watches: Record = {} as Record;\n let _watches_Cancel: boolean = false;\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Observable DOM Object Creation / Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function collectDOMObjects() : void {\n const tagTypes: string[] = _configuration.domElementTypes as string[];\n const tagTypesLength: number = tagTypes.length;\n\n for ( let tagTypeIndex: number = 0; tagTypeIndex < tagTypesLength; tagTypeIndex++ ) {\n const domElements: HTMLCollectionOf = document.getElementsByTagName( tagTypes[ tagTypeIndex ] );\n const elements: HTMLElement[] = [].slice.call( domElements );\n const elementsLength: number = elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < elementsLength; elementIndex++ ) {\n if ( !collectDOMObject( elements[ elementIndex ] ) ) {\n break;\n }\n }\n }\n }\n\n function collectDOMObject( element: HTMLElement ) : boolean {\n let result: boolean = true;\n\n if ( Is.defined( element ) && element.hasAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME ) ) {\n const bindingOptionsData: string = element.getAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME )!;\n\n if ( Is.definedString( bindingOptionsData ) ) {\n const watchOptionsJson: StringToJson = getObjectFromString( bindingOptionsData );\n\n if ( watchOptionsJson.parsed && Is.definedObject( watchOptionsJson.object ) ) {\n const watchOptions: WatchOptions = getWatchOptions( watchOptionsJson.object );\n\n if ( !Is.definedString( element.id ) ) {\n element.id = Data.String.newGuid();\n }\n\n if ( watchOptions.removeAttribute ) {\n element.removeAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME );\n }\n\n createWatch( element, watchOptions, element.id );\n\n } else {\n logError( _configuration.text!.attributeNotValidErrorText!.replace( \"{{attribute_name}}\", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );\n result = false;\n }\n\n } else {\n logError( _configuration.text!.attributeNotSetErrorText!.replace( \"{{attribute_name}}\", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );\n result = false;\n }\n }\n\n return result;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Watch Object Creation / Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function createWatch( object: any, options: any, domElementId: string = null! ) : string {\n let storageId: string = null!;\n\n if ( Is.definedObject( object ) ) {\n storageId = Data.String.newGuid();\n\n const watchOptions: WatchOptions = getWatchOptions( options );\n const watch: ObserveWatch = {} as ObserveWatch;\n let startWatchObject: any = null;\n\n watch.options = watchOptions;\n watch.totalChanges = 0;\n\n if ( Is.definedString( domElementId ) ) {\n const domElement: HTMLElement = document.getElementById( domElementId )!;\n\n if ( Is.defined( domElement ) ) {\n watch.domElementId = domElementId;\n watch.cachedObject = domElement.outerHTML;\n watch.originalObject = domElement.outerHTML;\n\n startWatchObject = domElement.outerHTML;\n }\n\n } else {\n watch.cachedObject = JSON.stringify( object );\n watch.originalObject = object;\n\n startWatchObject = object;\n }\n\n if ( Is.defined( watch.cachedObject ) ) {\n fireCustomTriggerEvent( watch.options.events!.onStart!, startWatchObject );\n\n watch.timer = setInterval( function() {\n watchTimer( watchOptions, storageId );\n }, watchOptions.timeout );\n \n _watches[ storageId ] = watch;\n }\n }\n\n return storageId;\n }\n\n function watchTimer( watchOptions: WatchOptions, storageId: string ) : void {\n const currentDateTime: Date = new Date();\n\n if ( !Is.definedDate( watchOptions.starts ) || currentDateTime >= watchOptions.starts! ) {\n watchObjectForChanges( storageId );\n\n if ( Is.definedDate( watchOptions.expires ) && currentDateTime >= watchOptions.expires! ) {\n cancelWatchObject( storageId );\n }\n }\n }\n\n function watchObjectForChanges( storageId: string ) : void {\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watch: ObserveWatch = _watches[ storageId ];\n const isDomElement: boolean = Is.definedString( watch.domElementId );\n let domElement: HTMLElement = null!;\n\n if ( isDomElement ) {\n domElement = document.getElementById( watch.domElementId )!;\n\n if ( Is.defined( domElement ) ) {\n watch.originalObject = domElement.outerHTML;\n } else {\n watch.originalObject = Char.empty;\n\n fireCustomTriggerEvent( watch.options.events!.onRemove!, watch.domElementId );\n }\n }\n\n const cachedObject: any = watch.cachedObject;\n const originalObject: any = watch.originalObject;\n const originalObjectJson: any = !isDomElement ? JSON.stringify( originalObject ) : originalObject;\n\n if ( cachedObject !== originalObjectJson ) {\n if ( watch.options.reset ) {\n if ( isDomElement ) {\n domElement.outerHTML = watch.cachedObject;\n } else {\n watch.originalObject = getObjectFromString( cachedObject ).object;\n }\n\n } else {\n watch.cachedObject = originalObjectJson;\n }\n\n if ( isDomElement ) {\n fireCustomTriggerEvent( watch.options.events!.onChange!, cachedObject, originalObjectJson );\n } else {\n\n const oldValue: any = getObjectFromString( cachedObject ).object;\n const newValue: any = getObjectFromString( originalObjectJson ).object;\n\n if ( !Is.definedArray( oldValue ) && !Is.definedArray( newValue ) ) {\n compareWatchObject( oldValue, newValue, watch );\n\n if ( Is.definedFunction( watch.options.events!.onPropertyChange ) ) {\n compareWatchObjectProperties( oldValue, newValue, watch );\n }\n \n } else {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldValue, newValue );\n }\n }\n\n watch.totalChanges++;\n\n if ( watch.options.pauseTimeoutOnChange! > 0 ) {\n pauseWatchObject( storageId, watch.options.pauseTimeoutOnChange! );\n }\n\n if ( watch.options.cancelOnChange ) {\n cancelWatchObject( storageId );\n }\n\n if ( watch.options.maximumChangesBeforeCanceling! > 0 && watch.totalChanges >= watch.options.maximumChangesBeforeCanceling! ) {\n cancelWatchObject( storageId );\n }\n }\n }\n }\n\n function compareWatchObject( oldObject: any, newObject: any, watch: ObserveWatch ) : void {\n if ( Is.definedArray( watch.options.propertyNames ) ) {\n const propertyNamesLength: number = watch.options.propertyNames!.length;\n\n for ( let propertyNameIndex: number = 0; propertyNameIndex < propertyNamesLength; propertyNameIndex++ ) {\n const propertyName: string = watch.options.propertyNames![ propertyNameIndex ];\n\n if ( oldObject[ propertyName ] !== newObject[ propertyName ] ) {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject );\n break;\n }\n }\n\n } else {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject );\n }\n }\n\n function compareWatchObjectProperties( oldObject: any, newObject: any, watch: ObserveWatch ) : void {\n for ( let propertyName in oldObject ) {\n if ( oldObject.hasOwnProperty( propertyName ) ) {\n const propertyOldValue: any = oldObject[ propertyName ];\n let propertyNewValue: any = null;\n\n if ( newObject.hasOwnProperty( propertyName ) ) {\n propertyNewValue = newObject[ propertyName ];\n }\n\n if ( Is.definedObject( propertyOldValue ) && Is.definedObject( propertyNewValue ) ) {\n compareWatchObjectProperties( propertyOldValue, propertyNewValue, watch );\n } else {\n\n if ( !Is.definedArray( watch.options.propertyNames ) || watch.options.propertyNames!.indexOf( propertyName ) > -1 ) {\n if ( JSON.stringify( propertyOldValue ) !== JSON.stringify( propertyNewValue ) ) {\n fireCustomTriggerEvent( watch.options.events!.onPropertyChange!, propertyName, propertyOldValue, propertyNewValue );\n }\n }\n }\n }\n }\n }\n\n function cancelWatchesForObjects() : void {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n cancelWatchObject( storageId );\n }\n }\n }\n\n function cancelWatchObject( storageId: string ) : void {\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watchOptions: WatchOptions = _watches[ storageId ].options;\n\n if ( watchOptions.allowCanceling || _watches_Cancel ) {\n fireCustomTriggerEvent( watchOptions.events!.onCancel!, storageId );\n clearInterval( _watches[ storageId ].timer );\n \n delete _watches[ storageId ];\n }\n }\n }\n\n function pauseWatchObject( storageId: string, milliseconds: number ) : boolean {\n let result: boolean = false;\n\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watchOptions: WatchOptions = _watches[ storageId ].options;\n\n if ( watchOptions.allowPausing ) {\n watchOptions.starts = new Date();\n watchOptions.starts.setMilliseconds( watchOptions.starts.getMilliseconds() + milliseconds );\n \n result = true;\n }\n }\n\n return result;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Watch Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function getWatchOptions( newOptions: any ) : WatchOptions {\n let options: WatchOptions = Data.getDefaultObject( newOptions, {} as WatchOptions );\n\n options.timeout = Data.getDefaultNumber( options.timeout, 250 );\n options.starts = Data.getDefaultDate( options.starts, null! );\n options.expires = Data.getDefaultDate( options.expires, null! );\n options.reset = Data.getDefaultBoolean( options.reset, false );\n options.cancelOnChange = Data.getDefaultBoolean( options.cancelOnChange, false );\n options.maximumChangesBeforeCanceling = Data.getDefaultNumber( options.maximumChangesBeforeCanceling, 0 );\n options.pauseTimeoutOnChange = Data.getDefaultNumber( options.pauseTimeoutOnChange, 0 );\n options.propertyNames = Data.getDefaultArray( options.propertyNames, null! );\n options.allowCanceling = Data.getDefaultBoolean( options.allowCanceling, true );\n options.allowPausing = Data.getDefaultBoolean( options.allowPausing, true );\n options.removeAttribute = Data.getDefaultBoolean( options.removeAttribute, true );\n\n options = getWatchOptionsCustomTriggers( options );\n\n return options;\n }\n\n function getWatchOptionsCustomTriggers( options: WatchOptions ) : WatchOptions {\n options.events = Data.getDefaultObject( options.events, {} as WatchOptionEvents );\n options.events!.onChange = Data.getDefaultFunction( options.events!.onChange, null! );\n options.events!.onPropertyChange = Data.getDefaultFunction( options.events!.onPropertyChange, null! );\n options.events!.onCancel = Data.getDefaultFunction( options.events!.onCancel, null! );\n options.events!.onRemove = Data.getDefaultFunction( options.events!.onRemove, null! );\n options.events!.onStart = Data.getDefaultFunction( options.events!.onStart, null! );\n\n return options;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Triggering Custom Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function fireCustomTriggerEvent( triggerFunction: Function, ...args : any[] ) : void {\n if ( Is.definedFunction( triggerFunction ) ) {\n triggerFunction.apply( null, [].slice.call( args, 0 ) );\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Default Parameter/Option Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function getObjectFromString( objectString: any ) : StringToJson {\n const result: StringToJson = {\n parsed: true,\n object: null\n } as StringToJson;\n\n try {\n if ( Is.definedString( objectString ) ) {\n result.object = JSON.parse( objectString );\n }\n\n } catch ( e1: any ) {\n try {\n result.object = eval( `(${objectString})` );\n\n if ( Is.definedFunction( result.object ) ) {\n result.object = result.object();\n }\n \n } catch ( e2: any ) {\n if ( !_configuration.safeMode ) {\n logError( _configuration.text!.objectErrorText!.replace( \"{{error_1}}\", e1.message ).replace( \"{{error_2}}\", e2.message ) );\n result.parsed = false;\n }\n \n result.object = null;\n }\n }\n\n return result;\n }\n\n function logError( error: string ) : boolean {\n let result: boolean = true;\n\n if ( !_configuration.safeMode ) {\n console.error( error );\n result = false;\n }\n\n return result;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: any = null ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.safeMode = Data.getDefaultBoolean( _configuration.safeMode, true );\n _configuration.domElementTypes = Data.getDefaultStringOrArray( _configuration.domElementTypes, [ \"*\" ] );\n\n buildDefaultConfigurationStrings();\n }\n\n function buildDefaultConfigurationStrings() : void {\n _configuration.text = Data.getDefaultObject( _configuration.text, {} as ConfigurationText );\n _configuration.text!.objectErrorText = Data.getDefaultString( _configuration.text!.objectErrorText, \"Errors in object: {{error_1}}, {{error_2}}\" );\n _configuration.text!.attributeNotValidErrorText = Data.getDefaultString( _configuration.text!.attributeNotValidErrorText, \"The attribute '{{attribute_name}}' is not a valid object.\" );\n _configuration.text!.attributeNotSetErrorText = Data.getDefaultString( _configuration.text!.attributeNotSetErrorText, \"The attribute '{{attribute_name}}' has not been set correctly.\" ); \n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions:\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n const _public: PublicApi = {\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Watching Objects\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n watch: function ( object: any, options: WatchOptions ) : string {\n return createWatch( object, options );\n },\n\n cancelWatch: function ( id: string ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n cancelWatchObject( id );\n \n result = true;\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n cancelWatchObject( storageId );\n \n result = true;\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n cancelWatches: function () : PublicApi {\n cancelWatchesForObjects();\n\n return _public;\n },\n\n getWatch: function ( id: string ) : ObserveWatch {\n let result: ObserveWatch = null!;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n result = _watches[ id ];\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n result = _watches[ storageId ];\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n getWatches: function () : Record {\n return _watches;\n },\n\n pauseWatch: function ( id: string, milliseconds: number ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) && Is.definedNumber( milliseconds ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n result = pauseWatchObject( id, milliseconds );\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n result = pauseWatchObject( storageId, milliseconds );\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n pauseWatches: function ( milliseconds: number ) : PublicApi {\n if ( Is.definedNumber( milliseconds ) ) {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n pauseWatchObject( storageId, milliseconds );\n }\n }\n }\n \n return _public;\n },\n\n resumeWatch: function ( id: string ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n _watches[ id ].options.starts = null!;\n result = true;\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n _watches[ storageId ].options.starts = null!;\n result = true;\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n resumeWatches: function () : PublicApi {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n _watches[ storageId ].options.starts = null!;\n }\n }\n \n return _public;\n },\n\n searchDomForNewWatches: function () : PublicApi {\n collectDOMObjects();\n\n return _public;\n },\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Configuration\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n setConfiguration: function ( newConfiguration: any ) : PublicApi {\n if ( Is.definedObject( newConfiguration ) ) {\n let configurationHasChanged: boolean = false;\n const newInternalConfiguration: any = _configuration;\n \n for ( let propertyName in newConfiguration ) {\n if ( newConfiguration.hasOwnProperty( propertyName ) && _configuration.hasOwnProperty( propertyName ) && newInternalConfiguration[ propertyName ] !== newConfiguration[ propertyName ] ) {\n newInternalConfiguration[ propertyName ] = newConfiguration[ propertyName ];\n configurationHasChanged = true;\n }\n }\n \n if ( configurationHasChanged ) {\n buildDefaultConfiguration( newInternalConfiguration );\n }\n }\n \n return _public;\n },\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Additional Data\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n getVersion: function () : string {\n return \"1.0.0\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Observe.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", function() {\n collectDOMObjects();\n } );\n\n window.addEventListener( \"pagehide\", function() {\n _watches_Cancel = true;\n\n cancelWatchesForObjects();\n } );\n\n if ( !Is.defined( window.$observe ) ) {\n window.$observe = _public;\n }\n } )();\n} )();"]} \ No newline at end of file +{"version":3,"sources":["../src/ts/constant.ts","../src/ts/is.ts","../src/ts/data.ts","../src/observe.ts"],"names":["Constant","Is","Data","String","result"],"mappings":";;;AAaO,IAAU;AAAA,CAAV,CAAUA,cAAV;AACI,EAAMA,UAAA,4BAA4B;AAAA,GAD5B;;;ACGV,IAAU;AAAA,CAAV,CAAUC,QAAV;AACI,WAAS,QAAS,OAAuB;AAC5C,WAAO,UAAU,QAAQ,UAAU,UAAa,MAAM,SAAS;AAAA,EACnE;AAFO,EAAAA,IAAS;AAIT,WAAS,cAAe,QAAwB;AACnD,WAAO,QAAS,MAAO,KAAK,OAAO,WAAW;AAAA,EAClD;AAFO,EAAAA,IAAS;AAIT,WAAS,eAAgB,QAAwB;AACpD,WAAO,QAAS,MAAO,KAAK,OAAO,WAAW;AAAA,EAClD;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AAkB,YAAa,GAAI;AACrL,qCAA0B,YAAa,IAAI,iBAAkB,YAAa;AAC1E,sCAA0B;AAAA,UAC9B;AAAA,QACJ;AAEA,YAAK,yBAA0B;AAC3B,oCAA2B,wBAAyB;AAAA,QACxD;AAAA,MACJ;AAEA,aAAO;AAAA,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,YAAY,WAAqB;AAC7B,aAAO;AAAA,IACX;AAAA,EACJ;AASA,GAAE,MAAM;AACJ,8BAA0B;AAE1B,aAAS,iBAAkB,oBAAoB,WAAW;AACtD,wBAAkB;AAAA,IACtB,CAAE;AAEF,WAAO,iBAAkB,YAAY,WAAW;AAC5C,wBAAkB;AAElB,8BAAwB;AAAA,IAC5B,CAAE;AAEF,QAAK,CAAC,GAAG,QAAS,OAAO,QAAS,GAAI;AAClC,aAAO,WAAW;AAAA,IACtB;AAAA,EACJ,GAAI;AACR,GAAI","sourcesContent":["/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file constant.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const OBSERVE_JS_ATTRIBUTE_NAME = \"data-observe-js\";\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file is.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Char } from \"./enum\"\n\n\nexport namespace Is {\n export function defined( value: any ) : boolean {\n return value !== null && value !== undefined && value.toString() !== Char.empty;\n }\n\n export function definedObject( object: any ) : boolean {\n return defined( object ) && typeof object === \"object\";\n }\n\n export function definedBoolean( object: any ) : boolean {\n return defined( object ) && typeof object === \"boolean\";\n }\n\n export function definedString( object: any ) : boolean {\n return defined( object ) && typeof object === \"string\";\n }\n\n export function definedFunction( object: any ) : boolean {\n return defined( object ) && typeof object === \"function\";\n }\n\n export function definedNumber( object: any ) : boolean {\n return defined( object ) && typeof object === \"number\";\n }\n\n export function definedArray( object: any ) : boolean {\n return definedObject( object ) && object instanceof Array;\n }\n\n export function definedDate( object: any ) : boolean {\n return definedObject( object ) && object instanceof Date;\n }\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file data.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Char } from \"./enum\";\nimport { Is } from \"./is\";\n\n\nexport namespace Data {\n export namespace String {\n export function newGuid() : string {\n const result: string[] = [];\n \n for ( let charIndex: number = 0; charIndex < 32; charIndex++ ) {\n if ( charIndex === 8 || charIndex === 12 || charIndex === 16 || charIndex === 20 ) {\n result.push( Char.dash );\n }\n \n const character: string = Math.floor( Math.random() * 16 ).toString( 16 );\n result.push( character );\n }\n \n return result.join( Char.empty );\n }\n }\n\n export function getDefaultAnyString( value: any, defaultValue: string ) : string {\n return typeof value === \"string\" ? value : defaultValue;\n }\n\n export function getDefaultString( value: any, defaultValue: string ) : string {\n return Is.definedString( value ) ? value : defaultValue;\n }\n\n export function getDefaultBoolean( value: any, defaultValue: boolean ) : boolean {\n return Is.definedBoolean( value ) ? value : defaultValue;\n }\n\n export function getDefaultNumber( value: any, defaultValue: number ) : number {\n return Is.definedNumber( value ) ? value : defaultValue;\n }\n\n export function getDefaultFunction( value: any, defaultValue: object ) : any {\n return Is.definedFunction( value ) ? value : defaultValue;\n }\n\n export function getDefaultArray( value: any, defaultValue: any[] ) : any[] {\n return Is.definedArray( value ) ? value : defaultValue;\n }\n\n export function getDefaultObject( value: any, defaultValue: object ) : any {\n return Is.definedObject( value ) ? value : defaultValue;\n }\n\n export function getDefaultDate( value: any, defaultValue: Date ) : Date {\n return Is.definedDate( value ) ? value : defaultValue;\n }\n\n export function getDefaultStringOrArray( value: any, defaultValue: string[] ) : string[] {\n let result: string[] = defaultValue;\n\n if ( Is.definedString( value ) ) {\n const values: string[] = value.toString().split( Char.space );\n\n if ( values.length === 0 ) {\n value = defaultValue;\n } else {\n result = values;\n }\n\n } else {\n result = getDefaultArray( value, defaultValue );\n }\n\n return result;\n }\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file observe.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport {\n type WatchOptionEvents,\n type WatchOptions,\n type Configuration,\n type ObserveWatch, \n type ConfigurationText } from \"./ts/type\";\n \nimport { Constant } from \"./ts/constant\";\nimport { Data } from \"./ts/data\";\nimport { Char } from \"./ts/enum\";\nimport { Is } from \"./ts/is\";\nimport { type PublicApi } from \"./ts/api\";\n\n\ntype StringToJson = {\n parsed: boolean;\n object: any;\n};\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Watches\n const _watches: Record = {} as Record;\n let _watches_Cancel: boolean = false;\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Observable DOM Object Creation / Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function collectDOMObjects() : void {\n const tagTypes: string[] = _configuration.domElementTypes as string[];\n const tagTypesLength: number = tagTypes.length;\n\n for ( let tagTypeIndex: number = 0; tagTypeIndex < tagTypesLength; tagTypeIndex++ ) {\n const domElements: HTMLCollectionOf = document.getElementsByTagName( tagTypes[ tagTypeIndex ] );\n const elements: HTMLElement[] = [].slice.call( domElements );\n const elementsLength: number = elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < elementsLength; elementIndex++ ) {\n if ( !collectDOMObject( elements[ elementIndex ] ) ) {\n break;\n }\n }\n }\n }\n\n function collectDOMObject( element: HTMLElement ) : boolean {\n let result: boolean = true;\n\n if ( Is.defined( element ) && element.hasAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME ) ) {\n const bindingOptionsData: string = element.getAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME )!;\n\n if ( Is.definedString( bindingOptionsData ) ) {\n const watchOptionsJson: StringToJson = getObjectFromString( bindingOptionsData );\n\n if ( watchOptionsJson.parsed && Is.definedObject( watchOptionsJson.object ) ) {\n const watchOptions: WatchOptions = getWatchOptions( watchOptionsJson.object );\n\n if ( !Is.definedString( element.id ) ) {\n element.id = Data.String.newGuid();\n }\n\n if ( watchOptions.removeAttribute ) {\n element.removeAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME );\n }\n\n createWatch( element, watchOptions, element.id );\n\n } else {\n logError( _configuration.text!.attributeNotValidErrorText!.replace( \"{{attribute_name}}\", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );\n result = false;\n }\n\n } else {\n logError( _configuration.text!.attributeNotSetErrorText!.replace( \"{{attribute_name}}\", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );\n result = false;\n }\n }\n\n return result;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Watch Object Creation / Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function createWatch( object: any, options: any, domElementId: string = null! ) : string {\n let storageId: string = null!;\n\n if ( Is.definedObject( object ) ) {\n storageId = Data.String.newGuid();\n\n const watchOptions: WatchOptions = getWatchOptions( options );\n const watch: ObserveWatch = {} as ObserveWatch;\n let startWatchObject: any = null;\n\n watch.options = watchOptions;\n watch.totalChanges = 0;\n\n if ( Is.definedString( domElementId ) ) {\n const domElement: HTMLElement = document.getElementById( domElementId )!;\n\n if ( Is.defined( domElement ) ) {\n watch.domElementId = domElementId;\n watch.cachedObject = domElement.outerHTML;\n watch.originalObject = domElement.outerHTML;\n\n startWatchObject = domElement.outerHTML;\n }\n\n } else {\n watch.cachedObject = JSON.stringify( object );\n watch.originalObject = object;\n\n startWatchObject = object;\n }\n\n if ( Is.defined( watch.cachedObject ) ) {\n fireCustomTriggerEvent( watch.options.events!.onStart!, startWatchObject );\n\n watch.timer = setInterval( function() {\n watchTimer( watchOptions, storageId );\n }, watchOptions.timeout );\n \n _watches[ storageId ] = watch;\n }\n }\n\n return storageId;\n }\n\n function watchTimer( watchOptions: WatchOptions, storageId: string ) : void {\n const currentDateTime: Date = new Date();\n\n if ( !Is.definedDate( watchOptions.starts ) || currentDateTime >= watchOptions.starts! ) {\n watchObjectForChanges( storageId );\n\n if ( Is.definedDate( watchOptions.expires ) && currentDateTime >= watchOptions.expires! ) {\n cancelWatchObject( storageId );\n }\n }\n }\n\n function watchObjectForChanges( storageId: string ) : void {\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watch: ObserveWatch = _watches[ storageId ];\n const isDomElement: boolean = Is.definedString( watch.domElementId );\n let domElement: HTMLElement = null!;\n\n if ( isDomElement ) {\n domElement = document.getElementById( watch.domElementId )!;\n\n if ( Is.defined( domElement ) ) {\n watch.originalObject = domElement.outerHTML;\n } else {\n watch.originalObject = Char.empty;\n\n fireCustomTriggerEvent( watch.options.events!.onRemove!, watch.domElementId );\n }\n }\n\n const cachedObject: any = watch.cachedObject;\n const originalObject: any = watch.originalObject;\n const originalObjectJson: any = !isDomElement ? JSON.stringify( originalObject ) : originalObject;\n\n if ( cachedObject !== originalObjectJson ) {\n if ( watch.options.reset ) {\n if ( isDomElement ) {\n domElement.outerHTML = watch.cachedObject;\n } else {\n watch.originalObject = getObjectFromString( cachedObject ).object;\n }\n\n } else {\n watch.cachedObject = originalObjectJson;\n }\n\n if ( isDomElement ) {\n fireCustomTriggerEvent( watch.options.events!.onChange!, cachedObject, originalObjectJson );\n } else {\n\n const oldValue: any = getObjectFromString( cachedObject ).object;\n const newValue: any = getObjectFromString( originalObjectJson ).object;\n\n if ( !Is.definedArray( oldValue ) && !Is.definedArray( newValue ) ) {\n compareWatchObject( oldValue, newValue, watch );\n\n if ( Is.definedFunction( watch.options.events!.onPropertyChange ) ) {\n compareWatchObjectProperties( oldValue, newValue, watch );\n }\n \n } else {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldValue, newValue );\n }\n }\n\n watch.totalChanges++;\n\n if ( watch.options.pauseTimeoutOnChange! > 0 ) {\n pauseWatchObject( storageId, watch.options.pauseTimeoutOnChange! );\n }\n\n if ( watch.options.cancelOnChange ) {\n cancelWatchObject( storageId );\n }\n\n if ( watch.options.maximumChangesBeforeCanceling! > 0 && watch.totalChanges >= watch.options.maximumChangesBeforeCanceling! ) {\n cancelWatchObject( storageId );\n }\n }\n }\n }\n\n function compareWatchObject( oldObject: any, newObject: any, watch: ObserveWatch ) : void {\n if ( Is.definedArray( watch.options.propertyNames ) ) {\n const propertyNamesLength: number = watch.options.propertyNames!.length;\n\n for ( let propertyNameIndex: number = 0; propertyNameIndex < propertyNamesLength; propertyNameIndex++ ) {\n const propertyName: string = watch.options.propertyNames![ propertyNameIndex ];\n\n if ( oldObject[ propertyName ] !== newObject[ propertyName ] ) {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject );\n break;\n }\n }\n\n } else {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject );\n }\n }\n\n function compareWatchObjectProperties( oldObject: any, newObject: any, watch: ObserveWatch ) : void {\n for ( let propertyName in oldObject ) {\n if ( oldObject.hasOwnProperty( propertyName ) ) {\n const propertyOldValue: any = oldObject[ propertyName ];\n let propertyNewValue: any = null;\n\n if ( newObject.hasOwnProperty( propertyName ) ) {\n propertyNewValue = newObject[ propertyName ];\n }\n\n if ( Is.definedObject( propertyOldValue ) && Is.definedObject( propertyNewValue ) ) {\n compareWatchObjectProperties( propertyOldValue, propertyNewValue, watch );\n } else {\n\n if ( !Is.definedArray( watch.options.propertyNames ) || watch.options.propertyNames!.indexOf( propertyName ) > -1 ) {\n if ( JSON.stringify( propertyOldValue ) !== JSON.stringify( propertyNewValue ) ) {\n fireCustomTriggerEvent( watch.options.events!.onPropertyChange!, propertyName, propertyOldValue, propertyNewValue );\n }\n }\n }\n }\n }\n }\n\n function cancelWatchesForObjects() : void {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n cancelWatchObject( storageId );\n }\n }\n }\n\n function cancelWatchObject( storageId: string ) : void {\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watchOptions: WatchOptions = _watches[ storageId ].options;\n\n if ( watchOptions.allowCanceling || _watches_Cancel ) {\n fireCustomTriggerEvent( watchOptions.events!.onCancel!, storageId );\n clearInterval( _watches[ storageId ].timer );\n \n delete _watches[ storageId ];\n }\n }\n }\n\n function pauseWatchObject( storageId: string, milliseconds: number ) : boolean {\n let result: boolean = false;\n\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watchOptions: WatchOptions = _watches[ storageId ].options;\n\n if ( watchOptions.allowPausing ) {\n watchOptions.starts = new Date();\n watchOptions.starts.setMilliseconds( watchOptions.starts.getMilliseconds() + milliseconds );\n \n result = true;\n }\n }\n\n return result;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Watch Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function getWatchOptions( newOptions: any ) : WatchOptions {\n let options: WatchOptions = Data.getDefaultObject( newOptions, {} as WatchOptions );\n\n options.timeout = Data.getDefaultNumber( options.timeout, 250 );\n options.starts = Data.getDefaultDate( options.starts, null! );\n options.expires = Data.getDefaultDate( options.expires, null! );\n options.reset = Data.getDefaultBoolean( options.reset, false );\n options.cancelOnChange = Data.getDefaultBoolean( options.cancelOnChange, false );\n options.maximumChangesBeforeCanceling = Data.getDefaultNumber( options.maximumChangesBeforeCanceling, 0 );\n options.pauseTimeoutOnChange = Data.getDefaultNumber( options.pauseTimeoutOnChange, 0 );\n options.propertyNames = Data.getDefaultArray( options.propertyNames, null! );\n options.allowCanceling = Data.getDefaultBoolean( options.allowCanceling, true );\n options.allowPausing = Data.getDefaultBoolean( options.allowPausing, true );\n options.removeAttribute = Data.getDefaultBoolean( options.removeAttribute, true );\n\n options = getWatchOptionsCustomTriggers( options );\n\n return options;\n }\n\n function getWatchOptionsCustomTriggers( options: WatchOptions ) : WatchOptions {\n options.events = Data.getDefaultObject( options.events, {} as WatchOptionEvents );\n options.events!.onChange = Data.getDefaultFunction( options.events!.onChange, null! );\n options.events!.onPropertyChange = Data.getDefaultFunction( options.events!.onPropertyChange, null! );\n options.events!.onCancel = Data.getDefaultFunction( options.events!.onCancel, null! );\n options.events!.onRemove = Data.getDefaultFunction( options.events!.onRemove, null! );\n options.events!.onStart = Data.getDefaultFunction( options.events!.onStart, null! );\n\n return options;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Triggering Custom Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function fireCustomTriggerEvent( triggerFunction: Function, ...args : any[] ) : void {\n if ( Is.definedFunction( triggerFunction ) ) {\n triggerFunction.apply( null, [].slice.call( args, 0 ) );\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Default Parameter/Option Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function getObjectFromString( objectString: any ) : StringToJson {\n const result: StringToJson = {\n parsed: true,\n object: null\n } as StringToJson;\n\n try {\n if ( Is.definedString( objectString ) ) {\n result.object = JSON.parse( objectString );\n }\n\n } catch ( e1: any ) {\n try {\n result.object = eval( `(${objectString})` );\n\n if ( Is.definedFunction( result.object ) ) {\n result.object = result.object();\n }\n \n } catch ( e2: any ) {\n if ( !_configuration.safeMode ) {\n logError( _configuration.text!.objectErrorText!.replace( \"{{error_1}}\", e1.message ).replace( \"{{error_2}}\", e2.message ) );\n result.parsed = false;\n }\n \n result.object = null;\n }\n }\n\n return result;\n }\n\n function logError( error: string ) : boolean {\n let result: boolean = true;\n\n if ( !_configuration.safeMode ) {\n console.error( error );\n result = false;\n }\n\n return result;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: any = null ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.safeMode = Data.getDefaultBoolean( _configuration.safeMode, true );\n _configuration.domElementTypes = Data.getDefaultStringOrArray( _configuration.domElementTypes, [ \"*\" ] );\n\n buildDefaultConfigurationStrings();\n }\n\n function buildDefaultConfigurationStrings() : void {\n _configuration.text = Data.getDefaultObject( _configuration.text, {} as ConfigurationText );\n _configuration.text!.objectErrorText = Data.getDefaultString( _configuration.text!.objectErrorText, \"Errors in object: {{error_1}}, {{error_2}}\" );\n _configuration.text!.attributeNotValidErrorText = Data.getDefaultString( _configuration.text!.attributeNotValidErrorText, \"The attribute '{{attribute_name}}' is not a valid object.\" );\n _configuration.text!.attributeNotSetErrorText = Data.getDefaultString( _configuration.text!.attributeNotSetErrorText, \"The attribute '{{attribute_name}}' has not been set correctly.\" ); \n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions:\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n const _public: PublicApi = {\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Watching Objects\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n watch: function ( object: any, options: WatchOptions ) : string {\n return createWatch( object, options );\n },\n\n cancelWatch: function ( id: string ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n cancelWatchObject( id );\n \n result = true;\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n cancelWatchObject( storageId );\n \n result = true;\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n cancelWatches: function () : PublicApi {\n cancelWatchesForObjects();\n\n return _public;\n },\n\n getWatch: function ( id: string ) : ObserveWatch {\n let result: ObserveWatch = null!;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n result = _watches[ id ];\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n result = _watches[ storageId ];\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n getWatches: function () : Record {\n return _watches;\n },\n\n pauseWatch: function ( id: string, milliseconds: number ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) && Is.definedNumber( milliseconds ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n result = pauseWatchObject( id, milliseconds );\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n result = pauseWatchObject( storageId, milliseconds );\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n pauseWatches: function ( milliseconds: number ) : PublicApi {\n if ( Is.definedNumber( milliseconds ) ) {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n pauseWatchObject( storageId, milliseconds );\n }\n }\n }\n \n return _public;\n },\n\n resumeWatch: function ( id: string ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n _watches[ id ].options.starts = null!;\n result = true;\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n _watches[ storageId ].options.starts = null!;\n result = true;\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n resumeWatches: function () : PublicApi {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n _watches[ storageId ].options.starts = null!;\n }\n }\n \n return _public;\n },\n\n searchDomForNewWatches: function () : PublicApi {\n collectDOMObjects();\n\n return _public;\n },\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Configuration\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n setConfiguration: function ( newConfiguration: any ) : PublicApi {\n if ( Is.definedObject( newConfiguration ) ) {\n let configurationHasChanged: boolean = false;\n const newInternalConfiguration: any = _configuration;\n \n for ( let propertyName in newConfiguration ) {\n if ( newConfiguration.hasOwnProperty( propertyName ) && _configuration.hasOwnProperty( propertyName ) && newInternalConfiguration[ propertyName ] !== newConfiguration[ propertyName ] ) {\n newInternalConfiguration[ propertyName ] = newConfiguration[ propertyName ];\n configurationHasChanged = true;\n }\n }\n \n if ( configurationHasChanged ) {\n buildDefaultConfiguration( newInternalConfiguration );\n }\n }\n \n return _public;\n },\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Additional Data\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n getVersion: function () : string {\n return \"1.0.1\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Observe.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", function() {\n collectDOMObjects();\n } );\n\n window.addEventListener( \"pagehide\", function() {\n _watches_Cancel = true;\n\n cancelWatchesForObjects();\n } );\n\n if ( !Is.defined( window.$observe ) ) {\n window.$observe = _public;\n }\n } )();\n} )();"]} \ No newline at end of file diff --git a/dist/observe.min.js b/dist/observe.min.js index 6fd0afe..bdf2400 100644 --- a/dist/observe.min.js +++ b/dist/observe.min.js @@ -1 +1 @@ -"use strict";var Constant,Is,Data;(Constant||(Constant={})).OBSERVE_JS_ATTRIBUTE_NAME="data-observe-js",(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=function(e){return n(e)&&e instanceof Array},e.definedDate=function(e){return n(e)&&e instanceof Date}})(Is||(Is={})),(e=>{let t;function n(e,t){return Is.definedArray(e)?e:t}(t=e.String||(e.String={})).newGuid=function(){const e=[];for(let t=0;t<32;t++){8!==t&&12!==t&&16!==t&&20!==t||e.push("-");const n=Math.floor(16*Math.random()).toString(16);e.push(n)}return e.join("")},e.getDefaultAnyString=function(e,t){return"string"==typeof e?e:t},e.getDefaultString=function(e,t){return Is.definedString(e)?e:t},e.getDefaultBoolean=function(e,t){return Is.definedBoolean(e)?e:t},e.getDefaultNumber=function(e,t){return Is.definedNumber(e)?e:t},e.getDefaultFunction=function(e,t){return Is.definedFunction(e)?e:t},e.getDefaultArray=n,e.getDefaultObject=function(e,t){return Is.definedObject(e)?e:t},e.getDefaultDate=function(e,t){return Is.definedDate(e)?e:t},e.getDefaultStringOrArray=function(e,t){let r=t;if(Is.definedString(e)){const n=e.toString().split("space");0===n.length?e=t:r=n}else r=n(e,t);return r}})(Data||(Data={})),(()=>{let _configuration={};const _watches={};let _watches_Cancel=!1;function collectDOMObjects(){const e=_configuration.domElementTypes,t=e.length;for(let n=0;n=e.starts)&&(watchObjectForChanges(t),Is.definedDate(e.expires)&&n>=e.expires&&cancelWatchObject(t))}function watchObjectForChanges(e){if(_watches.hasOwnProperty(e)){const t=_watches[e],n=Is.definedString(t.domElementId);let r=null;n&&(r=document.getElementById(t.domElementId),Is.defined(r)?t.originalObject=r.outerHTML:(t.originalObject="",fireCustomTriggerEvent(t.options.events.onRemove,t.domElementId)));const o=t.cachedObject,a=t.originalObject,i=n?a:JSON.stringify(a);if(o!==i){if(t.options.reset?n?r.outerHTML=t.cachedObject:t.originalObject=getObjectFromString(o).object:t.cachedObject=i,n)fireCustomTriggerEvent(t.options.events.onChange,o,i);else{const e=getObjectFromString(o).object,n=getObjectFromString(i).object;Is.definedArray(e)||Is.definedArray(n)?fireCustomTriggerEvent(t.options.events.onChange,e,n):(compareWatchObject(e,n,t),Is.definedFunction(t.options.events.onPropertyChange)&&compareWatchObjectProperties(e,n,t))}t.totalChanges++,t.options.pauseTimeoutOnChange>0&&pauseWatchObject(e,t.options.pauseTimeoutOnChange),t.options.cancelOnChange&&cancelWatchObject(e),t.options.maximumChangesBeforeCanceling>0&&t.totalChanges>=t.options.maximumChangesBeforeCanceling&&cancelWatchObject(e)}}}function compareWatchObject(e,t,n){if(Is.definedArray(n.options.propertyNames)){const r=n.options.propertyNames.length;for(let o=0;o-1)&&JSON.stringify(o)!==JSON.stringify(a)&&fireCustomTriggerEvent(n.options.events.onPropertyChange,r,o,a)}}function cancelWatchesForObjects(){for(let e in _watches)_watches.hasOwnProperty(e)&&cancelWatchObject(e)}function cancelWatchObject(e){if(_watches.hasOwnProperty(e)){const t=_watches[e].options;(t.allowCanceling||_watches_Cancel)&&(fireCustomTriggerEvent(t.events.onCancel,e),clearInterval(_watches[e].timer),delete _watches[e])}}function pauseWatchObject(e,t){let n=!1;if(_watches.hasOwnProperty(e)){const r=_watches[e].options;r.allowPausing&&(r.starts=new Date,r.starts.setMilliseconds(r.starts.getMilliseconds()+t),n=!0)}return n}function getWatchOptions(e){let t=Data.getDefaultObject(e,{});return t.timeout=Data.getDefaultNumber(t.timeout,250),t.starts=Data.getDefaultDate(t.starts,null),t.expires=Data.getDefaultDate(t.expires,null),t.reset=Data.getDefaultBoolean(t.reset,!1),t.cancelOnChange=Data.getDefaultBoolean(t.cancelOnChange,!1),t.maximumChangesBeforeCanceling=Data.getDefaultNumber(t.maximumChangesBeforeCanceling,0),t.pauseTimeoutOnChange=Data.getDefaultNumber(t.pauseTimeoutOnChange,0),t.propertyNames=Data.getDefaultArray(t.propertyNames,null),t.allowCanceling=Data.getDefaultBoolean(t.allowCanceling,!0),t.allowPausing=Data.getDefaultBoolean(t.allowPausing,!0),t.removeAttribute=Data.getDefaultBoolean(t.removeAttribute,!0),t=getWatchOptionsCustomTriggers(t),t}function getWatchOptionsCustomTriggers(e){return e.events=Data.getDefaultObject(e.events,{}),e.events.onChange=Data.getDefaultFunction(e.events.onChange,null),e.events.onPropertyChange=Data.getDefaultFunction(e.events.onPropertyChange,null),e.events.onCancel=Data.getDefaultFunction(e.events.onCancel,null),e.events.onRemove=Data.getDefaultFunction(e.events.onRemove,null),e.events.onStart=Data.getDefaultFunction(e.events.onStart,null),e}function fireCustomTriggerEvent(e,...t){Is.definedFunction(e)&&e.apply(null,[].slice.call(t,0))}function getObjectFromString(objectString){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval(`(${objectString})`),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){_configuration.safeMode||(logError(_configuration.text.objectErrorText.replace("{{error_1}}",e1.message).replace("{{error_2}}",e.message)),result.parsed=!1),result.object=null}}return result}function logError(e){let t=!0;return _configuration.safeMode||(console.error(e),t=!1),t}function buildDefaultConfiguration(e=null){_configuration=Data.getDefaultObject(e,{}),_configuration.safeMode=Data.getDefaultBoolean(_configuration.safeMode,!0),_configuration.domElementTypes=Data.getDefaultStringOrArray(_configuration.domElementTypes,["*"]),buildDefaultConfigurationStrings()}function buildDefaultConfigurationStrings(){_configuration.text=Data.getDefaultObject(_configuration.text,{}),_configuration.text.objectErrorText=Data.getDefaultString(_configuration.text.objectErrorText,"Errors in object: {{error_1}}, {{error_2}}"),_configuration.text.attributeNotValidErrorText=Data.getDefaultString(_configuration.text.attributeNotValidErrorText,"The attribute '{{attribute_name}}' is not a valid object."),_configuration.text.attributeNotSetErrorText=Data.getDefaultString(_configuration.text.attributeNotSetErrorText,"The attribute '{{attribute_name}}' has not been set correctly.")}const _public={watch:function(e,t){return createWatch(e,t)},cancelWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))cancelWatchObject(e),t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){cancelWatchObject(n),t=!0;break}return t},cancelWatches:function(){return cancelWatchesForObjects(),_public},getWatch:function(e){let t=null;if(Is.definedString(e))if(_watches.hasOwnProperty(e))t=_watches[e];else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){t=_watches[n];break}return t},getWatches:function(){return _watches},pauseWatch:function(e,t){let n=!1;if(Is.definedString(e)&&Is.definedNumber(t))if(_watches.hasOwnProperty(e))n=pauseWatchObject(e,t);else for(let r in _watches)if(_watches.hasOwnProperty(r)&&Is.definedString(_watches[r].domElementId)&&_watches[r].domElementId===e){n=pauseWatchObject(r,t);break}return n},pauseWatches:function(e){if(Is.definedNumber(e))for(let t in _watches)_watches.hasOwnProperty(t)&&pauseWatchObject(t,e);return _public},resumeWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))_watches[e].options.starts=null,t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){_watches[n].options.starts=null,t=!0;break}return t},resumeWatches:function(){for(let e in _watches)_watches.hasOwnProperty(e)&&(_watches[e].options.starts=null);return _public},searchDomForNewWatches:function(){return collectDOMObjects(),_public},setConfiguration:function(e){if(Is.definedObject(e)){let t=!1;const n=_configuration;for(let r in e)e.hasOwnProperty(r)&&_configuration.hasOwnProperty(r)&&n[r]!==e[r]&&(n[r]=e[r],t=!0);t&&buildDefaultConfiguration(n)}return _public},getVersion:function(){return"1.0.0"}};buildDefaultConfiguration(),document.addEventListener("DOMContentLoaded",(function(){collectDOMObjects()})),window.addEventListener("pagehide",(function(){_watches_Cancel=!0,cancelWatchesForObjects()})),Is.defined(window.$observe)||(window.$observe=_public)})(); \ No newline at end of file +"use strict";var Constant,Is,Data;(Constant||(Constant={})).OBSERVE_JS_ATTRIBUTE_NAME="data-observe-js",(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=function(e){return n(e)&&e instanceof Array},e.definedDate=function(e){return n(e)&&e instanceof Date}})(Is||(Is={})),(e=>{let t;function n(e,t){return Is.definedArray(e)?e:t}(t=e.String||(e.String={})).newGuid=function(){const e=[];for(let t=0;t<32;t++){8!==t&&12!==t&&16!==t&&20!==t||e.push("-");const n=Math.floor(16*Math.random()).toString(16);e.push(n)}return e.join("")},e.getDefaultAnyString=function(e,t){return"string"==typeof e?e:t},e.getDefaultString=function(e,t){return Is.definedString(e)?e:t},e.getDefaultBoolean=function(e,t){return Is.definedBoolean(e)?e:t},e.getDefaultNumber=function(e,t){return Is.definedNumber(e)?e:t},e.getDefaultFunction=function(e,t){return Is.definedFunction(e)?e:t},e.getDefaultArray=n,e.getDefaultObject=function(e,t){return Is.definedObject(e)?e:t},e.getDefaultDate=function(e,t){return Is.definedDate(e)?e:t},e.getDefaultStringOrArray=function(e,t){let r=t;if(Is.definedString(e)){const n=e.toString().split("space");0===n.length?e=t:r=n}else r=n(e,t);return r}})(Data||(Data={})),(()=>{let _configuration={};const _watches={};let _watches_Cancel=!1;function collectDOMObjects(){const e=_configuration.domElementTypes,t=e.length;for(let n=0;n=e.starts)&&(watchObjectForChanges(t),Is.definedDate(e.expires)&&n>=e.expires&&cancelWatchObject(t))}function watchObjectForChanges(e){if(_watches.hasOwnProperty(e)){const t=_watches[e],n=Is.definedString(t.domElementId);let r=null;n&&(r=document.getElementById(t.domElementId),Is.defined(r)?t.originalObject=r.outerHTML:(t.originalObject="",fireCustomTriggerEvent(t.options.events.onRemove,t.domElementId)));const o=t.cachedObject,a=t.originalObject,i=n?a:JSON.stringify(a);if(o!==i){if(t.options.reset?n?r.outerHTML=t.cachedObject:t.originalObject=getObjectFromString(o).object:t.cachedObject=i,n)fireCustomTriggerEvent(t.options.events.onChange,o,i);else{const e=getObjectFromString(o).object,n=getObjectFromString(i).object;Is.definedArray(e)||Is.definedArray(n)?fireCustomTriggerEvent(t.options.events.onChange,e,n):(compareWatchObject(e,n,t),Is.definedFunction(t.options.events.onPropertyChange)&&compareWatchObjectProperties(e,n,t))}t.totalChanges++,t.options.pauseTimeoutOnChange>0&&pauseWatchObject(e,t.options.pauseTimeoutOnChange),t.options.cancelOnChange&&cancelWatchObject(e),t.options.maximumChangesBeforeCanceling>0&&t.totalChanges>=t.options.maximumChangesBeforeCanceling&&cancelWatchObject(e)}}}function compareWatchObject(e,t,n){if(Is.definedArray(n.options.propertyNames)){const r=n.options.propertyNames.length;for(let o=0;o-1)&&JSON.stringify(o)!==JSON.stringify(a)&&fireCustomTriggerEvent(n.options.events.onPropertyChange,r,o,a)}}function cancelWatchesForObjects(){for(let e in _watches)_watches.hasOwnProperty(e)&&cancelWatchObject(e)}function cancelWatchObject(e){if(_watches.hasOwnProperty(e)){const t=_watches[e].options;(t.allowCanceling||_watches_Cancel)&&(fireCustomTriggerEvent(t.events.onCancel,e),clearInterval(_watches[e].timer),delete _watches[e])}}function pauseWatchObject(e,t){let n=!1;if(_watches.hasOwnProperty(e)){const r=_watches[e].options;r.allowPausing&&(r.starts=new Date,r.starts.setMilliseconds(r.starts.getMilliseconds()+t),n=!0)}return n}function getWatchOptions(e){let t=Data.getDefaultObject(e,{});return t.timeout=Data.getDefaultNumber(t.timeout,250),t.starts=Data.getDefaultDate(t.starts,null),t.expires=Data.getDefaultDate(t.expires,null),t.reset=Data.getDefaultBoolean(t.reset,!1),t.cancelOnChange=Data.getDefaultBoolean(t.cancelOnChange,!1),t.maximumChangesBeforeCanceling=Data.getDefaultNumber(t.maximumChangesBeforeCanceling,0),t.pauseTimeoutOnChange=Data.getDefaultNumber(t.pauseTimeoutOnChange,0),t.propertyNames=Data.getDefaultArray(t.propertyNames,null),t.allowCanceling=Data.getDefaultBoolean(t.allowCanceling,!0),t.allowPausing=Data.getDefaultBoolean(t.allowPausing,!0),t.removeAttribute=Data.getDefaultBoolean(t.removeAttribute,!0),t=getWatchOptionsCustomTriggers(t),t}function getWatchOptionsCustomTriggers(e){return e.events=Data.getDefaultObject(e.events,{}),e.events.onChange=Data.getDefaultFunction(e.events.onChange,null),e.events.onPropertyChange=Data.getDefaultFunction(e.events.onPropertyChange,null),e.events.onCancel=Data.getDefaultFunction(e.events.onCancel,null),e.events.onRemove=Data.getDefaultFunction(e.events.onRemove,null),e.events.onStart=Data.getDefaultFunction(e.events.onStart,null),e}function fireCustomTriggerEvent(e,...t){Is.definedFunction(e)&&e.apply(null,[].slice.call(t,0))}function getObjectFromString(objectString){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval(`(${objectString})`),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){_configuration.safeMode||(logError(_configuration.text.objectErrorText.replace("{{error_1}}",e1.message).replace("{{error_2}}",e.message)),result.parsed=!1),result.object=null}}return result}function logError(e){let t=!0;return _configuration.safeMode||(console.error(e),t=!1),t}function buildDefaultConfiguration(e=null){_configuration=Data.getDefaultObject(e,{}),_configuration.safeMode=Data.getDefaultBoolean(_configuration.safeMode,!0),_configuration.domElementTypes=Data.getDefaultStringOrArray(_configuration.domElementTypes,["*"]),buildDefaultConfigurationStrings()}function buildDefaultConfigurationStrings(){_configuration.text=Data.getDefaultObject(_configuration.text,{}),_configuration.text.objectErrorText=Data.getDefaultString(_configuration.text.objectErrorText,"Errors in object: {{error_1}}, {{error_2}}"),_configuration.text.attributeNotValidErrorText=Data.getDefaultString(_configuration.text.attributeNotValidErrorText,"The attribute '{{attribute_name}}' is not a valid object."),_configuration.text.attributeNotSetErrorText=Data.getDefaultString(_configuration.text.attributeNotSetErrorText,"The attribute '{{attribute_name}}' has not been set correctly.")}const _public={watch:function(e,t){return createWatch(e,t)},cancelWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))cancelWatchObject(e),t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){cancelWatchObject(n),t=!0;break}return t},cancelWatches:function(){return cancelWatchesForObjects(),_public},getWatch:function(e){let t=null;if(Is.definedString(e))if(_watches.hasOwnProperty(e))t=_watches[e];else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){t=_watches[n];break}return t},getWatches:function(){return _watches},pauseWatch:function(e,t){let n=!1;if(Is.definedString(e)&&Is.definedNumber(t))if(_watches.hasOwnProperty(e))n=pauseWatchObject(e,t);else for(let r in _watches)if(_watches.hasOwnProperty(r)&&Is.definedString(_watches[r].domElementId)&&_watches[r].domElementId===e){n=pauseWatchObject(r,t);break}return n},pauseWatches:function(e){if(Is.definedNumber(e))for(let t in _watches)_watches.hasOwnProperty(t)&&pauseWatchObject(t,e);return _public},resumeWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))_watches[e].options.starts=null,t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){_watches[n].options.starts=null,t=!0;break}return t},resumeWatches:function(){for(let e in _watches)_watches.hasOwnProperty(e)&&(_watches[e].options.starts=null);return _public},searchDomForNewWatches:function(){return collectDOMObjects(),_public},setConfiguration:function(e){if(Is.definedObject(e)){let t=!1;const n=_configuration;for(let r in e)e.hasOwnProperty(r)&&_configuration.hasOwnProperty(r)&&n[r]!==e[r]&&(n[r]=e[r],t=!0);t&&buildDefaultConfiguration(n)}return _public},getVersion:function(){return"1.0.1"}};buildDefaultConfiguration(),document.addEventListener("DOMContentLoaded",(function(){collectDOMObjects()})),window.addEventListener("pagehide",(function(){_watches_Cancel=!0,cancelWatchesForObjects()})),Is.defined(window.$observe)||(window.$observe=_public)})(); \ No newline at end of file diff --git a/docs/CHANGE_LOG.md b/docs/CHANGE_LOG.md index 24ed495..dda75c4 100644 --- a/docs/CHANGE_LOG.md +++ b/docs/CHANGE_LOG.md @@ -1,5 +1,11 @@ # Observe.js - Change Log: +## Version 1.0.1: +- + +
+ + ## Version 1.0.0: #### **Language Shift:** diff --git a/observe.js.nuspec b/observe.js.nuspec index df55605..67d8072 100644 --- a/observe.js.nuspec +++ b/observe.js.nuspec @@ -2,7 +2,7 @@ jObserve.js - 1.0.0 + 1.0.1 Observe.js A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. William Troup diff --git a/package-lock.json b/package-lock.json index b2e66a2..56b0e7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jobserve.js", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jobserve.js", - "version": "1.0.0", + "version": "1.0.1", "license": "MIT", "dependencies": { "typescript": "^5.5.3" diff --git a/package.json b/package.json index 76deff4..3cc45bc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "jobserve.js", "title": "Observe.js", "description": "A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.", - "version": "1.0.0", + "version": "1.0.1", "homepage": "https://www.william-troup.com/observe-js/", "author": { "name": "Bunoon" diff --git a/src/_old/observe.js b/src/_old/observe.js index df5bda1..8df704f 100644 --- a/src/_old/observe.js +++ b/src/_old/observe.js @@ -4,7 +4,7 @@ * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. * * @file observe.js - * @version v1.0.0 + * @version v1.0.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 @@ -821,7 +821,7 @@ * @returns {string} The version number. */ _public.getVersion = function() { - return "1.0.0"; + return "1.0.1"; }; diff --git a/src/observe.ts b/src/observe.ts index 1574103..2981f71 100644 --- a/src/observe.ts +++ b/src/observe.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. * * @file observe.ts - * @version v1.0.0 + * @version v1.0.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 @@ -613,7 +613,7 @@ type StringToJson = { */ getVersion: function () : string { - return "1.0.0"; + return "1.0.1"; } }; diff --git a/src/ts/api.ts b/src/ts/api.ts index 0d79bf4..7b11c15 100644 --- a/src/ts/api.ts +++ b/src/ts/api.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. * * @file api.ts - * @version v1.0.0 + * @version v1.0.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 diff --git a/src/ts/constant.ts b/src/ts/constant.ts index e0db072..c3974c4 100644 --- a/src/ts/constant.ts +++ b/src/ts/constant.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. * * @file constant.ts - * @version v1.0.0 + * @version v1.0.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 diff --git a/src/ts/data.ts b/src/ts/data.ts index 6db366f..c1e5d98 100644 --- a/src/ts/data.ts +++ b/src/ts/data.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. * * @file data.ts - * @version v1.0.0 + * @version v1.0.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 diff --git a/src/ts/enum.ts b/src/ts/enum.ts index ca83b1b..9b4b41a 100644 --- a/src/ts/enum.ts +++ b/src/ts/enum.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. * * @file enum.ts - * @version v1.0.0 + * @version v1.0.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 diff --git a/src/ts/is.ts b/src/ts/is.ts index 2a8abe7..1d8b270 100644 --- a/src/ts/is.ts +++ b/src/ts/is.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. * * @file is.ts - * @version v1.0.0 + * @version v1.0.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 diff --git a/src/ts/type.ts b/src/ts/type.ts index eccd37a..1c0b22e 100644 --- a/src/ts/type.ts +++ b/src/ts/type.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. * * @file type.ts - * @version v1.0.0 + * @version v1.0.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 From f012464c591e71675b1ca5967ffb8aa4c6aac9d2 Mon Sep 17 00:00:00 2001 From: William Troup Date: Tue, 23 Jul 2024 19:56:15 +0100 Subject: [PATCH 2/7] Updated to the latest NPM packages. --- dist/observe.esm.js.map | 2 +- dist/observe.js.map | 2 +- docs/CHANGE_LOG.md | 2 +- package-lock.json | 626 ++++++++++++++++++++++------------------ package.json | 8 +- 5 files changed, 353 insertions(+), 287 deletions(-) diff --git a/dist/observe.esm.js.map b/dist/observe.esm.js.map index c8761c3..da5fb52 100644 --- a/dist/observe.esm.js.map +++ b/dist/observe.esm.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/ts/constant.ts","../src/ts/enum.ts","../src/ts/is.ts","../src/ts/data.ts","../src/observe.ts"],"names":["Constant","Is","Data","String","result"],"mappings":";;;;;;;;;AAAA,IAaiB;AAbjB;AAAA;AAAA;AAaO,MAAUA,cAAV;AACI,MAAMA,UAAA,4BAA4B;AAAA,OAD5B;AAAA;AAAA;;;ACbjB;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAgBiB;AAhBjB;AAAA;AAAA;AAaA;AAGO,MAAUC,QAAV;AACI,eAAS,QAAS,OAAuB;AAC5C,eAAO,UAAU,QAAQ,UAAU,UAAa,MAAM,SAAS;AAAA,MACnE;AAFO,MAAAA,IAAS;AAIT,eAAS,cAAe,QAAwB;AACnD,eAAO,QAAS,MAAO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EA,iBAAO;AAAA,QACX;AAAA,QAEA,wBAAwB,WAAwB;AAC5C,4BAAkB;AAElB,iBAAO;AAAA,QACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QASA,kBAAkB,SAAW,kBAAoC;AAC7D,cAAK,GAAG,cAAe,gBAAiB,GAAI;AACxC,gBAAI,0BAAmC;AACvC,kBAAM,2BAAgC;AAEtC,qBAAU,gBAAgB,kBAAmB;AACzC,kBAAK,iBAAiB,eAAgB,YAAa,KAAK,eAAe,eAAgB,YAAa,KAAK,yBAA0B,YAAa,MAAM,iBAAkB,YAAa,GAAI;AACrL,yCAA0B,YAAa,IAAI,iBAAkB,YAAa;AAC1E,0CAA0B;AAAA,cAC9B;AAAA,YACJ;AAEA,gBAAK,yBAA0B;AAC3B,wCAA2B,wBAAyB;AAAA,YACxD;AAAA,UACJ;AAEA,iBAAO;AAAA,QACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QASA,YAAY,WAAqB;AAC7B,iBAAO;AAAA,QACX;AAAA,MACJ;AASA,OAAE,MAAM;AACJ,kCAA0B;AAE1B,iBAAS,iBAAkB,oBAAoB,WAAW;AACtD,4BAAkB;AAAA,QACtB,CAAE;AAEF,eAAO,iBAAkB,YAAY,WAAW;AAC5C,4BAAkB;AAElB,kCAAwB;AAAA,QAC5B,CAAE;AAEF,YAAK,CAAC,GAAG,QAAS,OAAO,QAAS,GAAI;AAClC,iBAAO,WAAW;AAAA,QACtB;AAAA,MACJ,GAAI;AAAA,IACR,GAAI;AAAA;AAAA","sourcesContent":["/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file constant.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const OBSERVE_JS_ATTRIBUTE_NAME = \"data-observe-js\";\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file enum.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport const enum Char {\n empty = \"\",\n space = \"space\",\n dash = \"-\",\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file is.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Char } from \"./enum\"\n\n\nexport namespace Is {\n export function defined( value: any ) : boolean {\n return value !== null && value !== undefined && value.toString() !== Char.empty;\n }\n\n export function definedObject( object: any ) : boolean {\n return defined( object ) && typeof object === \"object\";\n }\n\n export function definedBoolean( object: any ) : boolean {\n return defined( object ) && typeof object === \"boolean\";\n }\n\n export function definedString( object: any ) : boolean {\n return defined( object ) && typeof object === \"string\";\n }\n\n export function definedFunction( object: any ) : boolean {\n return defined( object ) && typeof object === \"function\";\n }\n\n export function definedNumber( object: any ) : boolean {\n return defined( object ) && typeof object === \"number\";\n }\n\n export function definedArray( object: any ) : boolean {\n return definedObject( object ) && object instanceof Array;\n }\n\n export function definedDate( object: any ) : boolean {\n return definedObject( object ) && object instanceof Date;\n }\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file data.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Char } from \"./enum\";\nimport { Is } from \"./is\";\n\n\nexport namespace Data {\n export namespace String {\n export function newGuid() : string {\n const result: string[] = [];\n \n for ( let charIndex: number = 0; charIndex < 32; charIndex++ ) {\n if ( charIndex === 8 || charIndex === 12 || charIndex === 16 || charIndex === 20 ) {\n result.push( Char.dash );\n }\n \n const character: string = Math.floor( Math.random() * 16 ).toString( 16 );\n result.push( character );\n }\n \n return result.join( Char.empty );\n }\n }\n\n export function getDefaultAnyString( value: any, defaultValue: string ) : string {\n return typeof value === \"string\" ? value : defaultValue;\n }\n\n export function getDefaultString( value: any, defaultValue: string ) : string {\n return Is.definedString( value ) ? value : defaultValue;\n }\n\n export function getDefaultBoolean( value: any, defaultValue: boolean ) : boolean {\n return Is.definedBoolean( value ) ? value : defaultValue;\n }\n\n export function getDefaultNumber( value: any, defaultValue: number ) : number {\n return Is.definedNumber( value ) ? value : defaultValue;\n }\n\n export function getDefaultFunction( value: any, defaultValue: object ) : any {\n return Is.definedFunction( value ) ? value : defaultValue;\n }\n\n export function getDefaultArray( value: any, defaultValue: any[] ) : any[] {\n return Is.definedArray( value ) ? value : defaultValue;\n }\n\n export function getDefaultObject( value: any, defaultValue: object ) : any {\n return Is.definedObject( value ) ? value : defaultValue;\n }\n\n export function getDefaultDate( value: any, defaultValue: Date ) : Date {\n return Is.definedDate( value ) ? value : defaultValue;\n }\n\n export function getDefaultStringOrArray( value: any, defaultValue: string[] ) : string[] {\n let result: string[] = defaultValue;\n\n if ( Is.definedString( value ) ) {\n const values: string[] = value.toString().split( Char.space );\n\n if ( values.length === 0 ) {\n value = defaultValue;\n } else {\n result = values;\n }\n\n } else {\n result = getDefaultArray( value, defaultValue );\n }\n\n return result;\n }\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file observe.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport {\n type WatchOptionEvents,\n type WatchOptions,\n type Configuration,\n type ObserveWatch, \n type ConfigurationText } from \"./ts/type\";\n \nimport { Constant } from \"./ts/constant\";\nimport { Data } from \"./ts/data\";\nimport { Char } from \"./ts/enum\";\nimport { Is } from \"./ts/is\";\nimport { type PublicApi } from \"./ts/api\";\n\n\ntype StringToJson = {\n parsed: boolean;\n object: any;\n};\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Watches\n const _watches: Record = {} as Record;\n let _watches_Cancel: boolean = false;\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Observable DOM Object Creation / Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function collectDOMObjects() : void {\n const tagTypes: string[] = _configuration.domElementTypes as string[];\n const tagTypesLength: number = tagTypes.length;\n\n for ( let tagTypeIndex: number = 0; tagTypeIndex < tagTypesLength; tagTypeIndex++ ) {\n const domElements: HTMLCollectionOf = document.getElementsByTagName( tagTypes[ tagTypeIndex ] );\n const elements: HTMLElement[] = [].slice.call( domElements );\n const elementsLength: number = elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < elementsLength; elementIndex++ ) {\n if ( !collectDOMObject( elements[ elementIndex ] ) ) {\n break;\n }\n }\n }\n }\n\n function collectDOMObject( element: HTMLElement ) : boolean {\n let result: boolean = true;\n\n if ( Is.defined( element ) && element.hasAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME ) ) {\n const bindingOptionsData: string = element.getAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME )!;\n\n if ( Is.definedString( bindingOptionsData ) ) {\n const watchOptionsJson: StringToJson = getObjectFromString( bindingOptionsData );\n\n if ( watchOptionsJson.parsed && Is.definedObject( watchOptionsJson.object ) ) {\n const watchOptions: WatchOptions = getWatchOptions( watchOptionsJson.object );\n\n if ( !Is.definedString( element.id ) ) {\n element.id = Data.String.newGuid();\n }\n\n if ( watchOptions.removeAttribute ) {\n element.removeAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME );\n }\n\n createWatch( element, watchOptions, element.id );\n\n } else {\n logError( _configuration.text!.attributeNotValidErrorText!.replace( \"{{attribute_name}}\", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );\n result = false;\n }\n\n } else {\n logError( _configuration.text!.attributeNotSetErrorText!.replace( \"{{attribute_name}}\", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );\n result = false;\n }\n }\n\n return result;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Watch Object Creation / Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function createWatch( object: any, options: any, domElementId: string = null! ) : string {\n let storageId: string = null!;\n\n if ( Is.definedObject( object ) ) {\n storageId = Data.String.newGuid();\n\n const watchOptions: WatchOptions = getWatchOptions( options );\n const watch: ObserveWatch = {} as ObserveWatch;\n let startWatchObject: any = null;\n\n watch.options = watchOptions;\n watch.totalChanges = 0;\n\n if ( Is.definedString( domElementId ) ) {\n const domElement: HTMLElement = document.getElementById( domElementId )!;\n\n if ( Is.defined( domElement ) ) {\n watch.domElementId = domElementId;\n watch.cachedObject = domElement.outerHTML;\n watch.originalObject = domElement.outerHTML;\n\n startWatchObject = domElement.outerHTML;\n }\n\n } else {\n watch.cachedObject = JSON.stringify( object );\n watch.originalObject = object;\n\n startWatchObject = object;\n }\n\n if ( Is.defined( watch.cachedObject ) ) {\n fireCustomTriggerEvent( watch.options.events!.onStart!, startWatchObject );\n\n watch.timer = setInterval( function() {\n watchTimer( watchOptions, storageId );\n }, watchOptions.timeout );\n \n _watches[ storageId ] = watch;\n }\n }\n\n return storageId;\n }\n\n function watchTimer( watchOptions: WatchOptions, storageId: string ) : void {\n const currentDateTime: Date = new Date();\n\n if ( !Is.definedDate( watchOptions.starts ) || currentDateTime >= watchOptions.starts! ) {\n watchObjectForChanges( storageId );\n\n if ( Is.definedDate( watchOptions.expires ) && currentDateTime >= watchOptions.expires! ) {\n cancelWatchObject( storageId );\n }\n }\n }\n\n function watchObjectForChanges( storageId: string ) : void {\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watch: ObserveWatch = _watches[ storageId ];\n const isDomElement: boolean = Is.definedString( watch.domElementId );\n let domElement: HTMLElement = null!;\n\n if ( isDomElement ) {\n domElement = document.getElementById( watch.domElementId )!;\n\n if ( Is.defined( domElement ) ) {\n watch.originalObject = domElement.outerHTML;\n } else {\n watch.originalObject = Char.empty;\n\n fireCustomTriggerEvent( watch.options.events!.onRemove!, watch.domElementId );\n }\n }\n\n const cachedObject: any = watch.cachedObject;\n const originalObject: any = watch.originalObject;\n const originalObjectJson: any = !isDomElement ? JSON.stringify( originalObject ) : originalObject;\n\n if ( cachedObject !== originalObjectJson ) {\n if ( watch.options.reset ) {\n if ( isDomElement ) {\n domElement.outerHTML = watch.cachedObject;\n } else {\n watch.originalObject = getObjectFromString( cachedObject ).object;\n }\n\n } else {\n watch.cachedObject = originalObjectJson;\n }\n\n if ( isDomElement ) {\n fireCustomTriggerEvent( watch.options.events!.onChange!, cachedObject, originalObjectJson );\n } else {\n\n const oldValue: any = getObjectFromString( cachedObject ).object;\n const newValue: any = getObjectFromString( originalObjectJson ).object;\n\n if ( !Is.definedArray( oldValue ) && !Is.definedArray( newValue ) ) {\n compareWatchObject( oldValue, newValue, watch );\n\n if ( Is.definedFunction( watch.options.events!.onPropertyChange ) ) {\n compareWatchObjectProperties( oldValue, newValue, watch );\n }\n \n } else {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldValue, newValue );\n }\n }\n\n watch.totalChanges++;\n\n if ( watch.options.pauseTimeoutOnChange! > 0 ) {\n pauseWatchObject( storageId, watch.options.pauseTimeoutOnChange! );\n }\n\n if ( watch.options.cancelOnChange ) {\n cancelWatchObject( storageId );\n }\n\n if ( watch.options.maximumChangesBeforeCanceling! > 0 && watch.totalChanges >= watch.options.maximumChangesBeforeCanceling! ) {\n cancelWatchObject( storageId );\n }\n }\n }\n }\n\n function compareWatchObject( oldObject: any, newObject: any, watch: ObserveWatch ) : void {\n if ( Is.definedArray( watch.options.propertyNames ) ) {\n const propertyNamesLength: number = watch.options.propertyNames!.length;\n\n for ( let propertyNameIndex: number = 0; propertyNameIndex < propertyNamesLength; propertyNameIndex++ ) {\n const propertyName: string = watch.options.propertyNames![ propertyNameIndex ];\n\n if ( oldObject[ propertyName ] !== newObject[ propertyName ] ) {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject );\n break;\n }\n }\n\n } else {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject );\n }\n }\n\n function compareWatchObjectProperties( oldObject: any, newObject: any, watch: ObserveWatch ) : void {\n for ( let propertyName in oldObject ) {\n if ( oldObject.hasOwnProperty( propertyName ) ) {\n const propertyOldValue: any = oldObject[ propertyName ];\n let propertyNewValue: any = null;\n\n if ( newObject.hasOwnProperty( propertyName ) ) {\n propertyNewValue = newObject[ propertyName ];\n }\n\n if ( Is.definedObject( propertyOldValue ) && Is.definedObject( propertyNewValue ) ) {\n compareWatchObjectProperties( propertyOldValue, propertyNewValue, watch );\n } else {\n\n if ( !Is.definedArray( watch.options.propertyNames ) || watch.options.propertyNames!.indexOf( propertyName ) > -1 ) {\n if ( JSON.stringify( propertyOldValue ) !== JSON.stringify( propertyNewValue ) ) {\n fireCustomTriggerEvent( watch.options.events!.onPropertyChange!, propertyName, propertyOldValue, propertyNewValue );\n }\n }\n }\n }\n }\n }\n\n function cancelWatchesForObjects() : void {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n cancelWatchObject( storageId );\n }\n }\n }\n\n function cancelWatchObject( storageId: string ) : void {\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watchOptions: WatchOptions = _watches[ storageId ].options;\n\n if ( watchOptions.allowCanceling || _watches_Cancel ) {\n fireCustomTriggerEvent( watchOptions.events!.onCancel!, storageId );\n clearInterval( _watches[ storageId ].timer );\n \n delete _watches[ storageId ];\n }\n }\n }\n\n function pauseWatchObject( storageId: string, milliseconds: number ) : boolean {\n let result: boolean = false;\n\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watchOptions: WatchOptions = _watches[ storageId ].options;\n\n if ( watchOptions.allowPausing ) {\n watchOptions.starts = new Date();\n watchOptions.starts.setMilliseconds( watchOptions.starts.getMilliseconds() + milliseconds );\n \n result = true;\n }\n }\n\n return result;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Watch Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function getWatchOptions( newOptions: any ) : WatchOptions {\n let options: WatchOptions = Data.getDefaultObject( newOptions, {} as WatchOptions );\n\n options.timeout = Data.getDefaultNumber( options.timeout, 250 );\n options.starts = Data.getDefaultDate( options.starts, null! );\n options.expires = Data.getDefaultDate( options.expires, null! );\n options.reset = Data.getDefaultBoolean( options.reset, false );\n options.cancelOnChange = Data.getDefaultBoolean( options.cancelOnChange, false );\n options.maximumChangesBeforeCanceling = Data.getDefaultNumber( options.maximumChangesBeforeCanceling, 0 );\n options.pauseTimeoutOnChange = Data.getDefaultNumber( options.pauseTimeoutOnChange, 0 );\n options.propertyNames = Data.getDefaultArray( options.propertyNames, null! );\n options.allowCanceling = Data.getDefaultBoolean( options.allowCanceling, true );\n options.allowPausing = Data.getDefaultBoolean( options.allowPausing, true );\n options.removeAttribute = Data.getDefaultBoolean( options.removeAttribute, true );\n\n options = getWatchOptionsCustomTriggers( options );\n\n return options;\n }\n\n function getWatchOptionsCustomTriggers( options: WatchOptions ) : WatchOptions {\n options.events = Data.getDefaultObject( options.events, {} as WatchOptionEvents );\n options.events!.onChange = Data.getDefaultFunction( options.events!.onChange, null! );\n options.events!.onPropertyChange = Data.getDefaultFunction( options.events!.onPropertyChange, null! );\n options.events!.onCancel = Data.getDefaultFunction( options.events!.onCancel, null! );\n options.events!.onRemove = Data.getDefaultFunction( options.events!.onRemove, null! );\n options.events!.onStart = Data.getDefaultFunction( options.events!.onStart, null! );\n\n return options;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Triggering Custom Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function fireCustomTriggerEvent( triggerFunction: Function, ...args : any[] ) : void {\n if ( Is.definedFunction( triggerFunction ) ) {\n triggerFunction.apply( null, [].slice.call( args, 0 ) );\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Default Parameter/Option Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function getObjectFromString( objectString: any ) : StringToJson {\n const result: StringToJson = {\n parsed: true,\n object: null\n } as StringToJson;\n\n try {\n if ( Is.definedString( objectString ) ) {\n result.object = JSON.parse( objectString );\n }\n\n } catch ( e1: any ) {\n try {\n result.object = eval( `(${objectString})` );\n\n if ( Is.definedFunction( result.object ) ) {\n result.object = result.object();\n }\n \n } catch ( e2: any ) {\n if ( !_configuration.safeMode ) {\n logError( _configuration.text!.objectErrorText!.replace( \"{{error_1}}\", e1.message ).replace( \"{{error_2}}\", e2.message ) );\n result.parsed = false;\n }\n \n result.object = null;\n }\n }\n\n return result;\n }\n\n function logError( error: string ) : boolean {\n let result: boolean = true;\n\n if ( !_configuration.safeMode ) {\n console.error( error );\n result = false;\n }\n\n return result;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: any = null ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.safeMode = Data.getDefaultBoolean( _configuration.safeMode, true );\n _configuration.domElementTypes = Data.getDefaultStringOrArray( _configuration.domElementTypes, [ \"*\" ] );\n\n buildDefaultConfigurationStrings();\n }\n\n function buildDefaultConfigurationStrings() : void {\n _configuration.text = Data.getDefaultObject( _configuration.text, {} as ConfigurationText );\n _configuration.text!.objectErrorText = Data.getDefaultString( _configuration.text!.objectErrorText, \"Errors in object: {{error_1}}, {{error_2}}\" );\n _configuration.text!.attributeNotValidErrorText = Data.getDefaultString( _configuration.text!.attributeNotValidErrorText, \"The attribute '{{attribute_name}}' is not a valid object.\" );\n _configuration.text!.attributeNotSetErrorText = Data.getDefaultString( _configuration.text!.attributeNotSetErrorText, \"The attribute '{{attribute_name}}' has not been set correctly.\" ); \n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions:\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n const _public: PublicApi = {\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Watching Objects\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n watch: function ( object: any, options: WatchOptions ) : string {\n return createWatch( object, options );\n },\n\n cancelWatch: function ( id: string ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n cancelWatchObject( id );\n \n result = true;\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n cancelWatchObject( storageId );\n \n result = true;\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n cancelWatches: function () : PublicApi {\n cancelWatchesForObjects();\n\n return _public;\n },\n\n getWatch: function ( id: string ) : ObserveWatch {\n let result: ObserveWatch = null!;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n result = _watches[ id ];\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n result = _watches[ storageId ];\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n getWatches: function () : Record {\n return _watches;\n },\n\n pauseWatch: function ( id: string, milliseconds: number ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) && Is.definedNumber( milliseconds ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n result = pauseWatchObject( id, milliseconds );\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n result = pauseWatchObject( storageId, milliseconds );\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n pauseWatches: function ( milliseconds: number ) : PublicApi {\n if ( Is.definedNumber( milliseconds ) ) {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n pauseWatchObject( storageId, milliseconds );\n }\n }\n }\n \n return _public;\n },\n\n resumeWatch: function ( id: string ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n _watches[ id ].options.starts = null!;\n result = true;\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n _watches[ storageId ].options.starts = null!;\n result = true;\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n resumeWatches: function () : PublicApi {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n _watches[ storageId ].options.starts = null!;\n }\n }\n \n return _public;\n },\n\n searchDomForNewWatches: function () : PublicApi {\n collectDOMObjects();\n\n return _public;\n },\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Configuration\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n setConfiguration: function ( newConfiguration: any ) : PublicApi {\n if ( Is.definedObject( newConfiguration ) ) {\n let configurationHasChanged: boolean = false;\n const newInternalConfiguration: any = _configuration;\n \n for ( let propertyName in newConfiguration ) {\n if ( newConfiguration.hasOwnProperty( propertyName ) && _configuration.hasOwnProperty( propertyName ) && newInternalConfiguration[ propertyName ] !== newConfiguration[ propertyName ] ) {\n newInternalConfiguration[ propertyName ] = newConfiguration[ propertyName ];\n configurationHasChanged = true;\n }\n }\n \n if ( configurationHasChanged ) {\n buildDefaultConfiguration( newInternalConfiguration );\n }\n }\n \n return _public;\n },\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Additional Data\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n getVersion: function () : string {\n return \"1.0.1\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Observe.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", function() {\n collectDOMObjects();\n } );\n\n window.addEventListener( \"pagehide\", function() {\n _watches_Cancel = true;\n\n cancelWatchesForObjects();\n } );\n\n if ( !Is.defined( window.$observe ) ) {\n window.$observe = _public;\n }\n } )();\n} )();"]} \ No newline at end of file +{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.esm.js"],"names":["__getOwnPropNames","Object","getOwnPropertyNames","__esm","fn","res","__init","__commonJS","cb","mod","__require","exports","Constant","init_constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","init_enum","Is","init_is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Data","init_data","Data2","String","String2","newGuid","result2","charIndex","push","character","Math","floor","random","join","getDefaultAnyString","defaultValue","getDefaultString","getDefaultBoolean","getDefaultNumber","getDefaultFunction","getDefaultArray","getDefaultObject","getDefaultDate","getDefaultStringOrArray","values","split","length","require_observe","module","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","domElementTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","slice","call","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","getWatchOptions","id","removeAttribute","createWatch","logError","text","attributeNotValidErrorText","replace","attributeNotSetErrorText","options","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","fireCustomTriggerEvent","events","onStart","timer","setInterval","watchTimer","timeout","currentDateTime","starts","watchObjectForChanges","expires","cancelWatchObject","hasOwnProperty","isDomElement","onRemove","originalObjectJson","reset","onChange","oldValue","newValue","compareWatchObject","onPropertyChange","compareWatchObjectProperties","pauseTimeoutOnChange","pauseWatchObject","cancelOnChange","maximumChangesBeforeCanceling","oldObject","newObject","propertyNames","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","allowCanceling","onCancel","clearInterval","milliseconds","allowPausing","setMilliseconds","getMilliseconds","newOptions","getWatchOptionsCustomTriggers","triggerFunction","args","apply","objectString","result","parse","e1","eval","e2","safeMode","objectErrorText","message","error","console","buildDefaultConfiguration","newConfiguration","buildDefaultConfigurationStrings","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA,IAAIA,oBAAoBC,OAAOC;;AAC/B,IAAIC,QAAQ,CAACC,GAAIC,MAAQ,SAASC;IAChC,OAAOF,MAAOC,KAAO,GAAGD,EAAGJ,kBAAkBI,GAAI,KAAKA,IAAK,KAAKC;AAClE;;AACA,IAAIE,aAAa,CAACC,GAAIC,MAAQ,SAASC;IACrC,OAAOD,MAAQ,GAAGD,EAAGR,kBAAkBQ,GAAI,MAAMC,IAAM;QAAEE,SAAS,CAAC;OAAKA,SAASF,IAAMA,EAAIE;AAC7F;;AAGA,IAAIC;;AACJ,IAAIC,gBAAgBV,MAAM;IACxB;QACE;QACA,CAAEW;YACAA,EAAUC,4BAA4B;AACvC,UAFD,CAEGH,aAAaA,WAAW,CAAC;AAC9B;;;AAIF,IAAII,YAAYb,MAAM;IACpB;QACE;AACF;;;AAIF,IAAIc;;AACJ,IAAIC,UAAUf,MAAM;IAClB;QACE;QACAa;QACA,CAAEG;YACA,SAASC,EAAQC;gBACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;YACAH,EAAIC,UAAUA;YACd,SAASG,EAAcC;gBACrB,OAAOJ,EAAQI,aAAkBA,MAAW;A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GAAGS,cAAcqC,SAASmC,GAAWD,iBAAiBlC,SAASmC,GAAWD,iBAAiBT,GAAI;oCACvIzB,SAASmC,GAAWF,QAAQqB,SAAS;oCACrC9E,IAAU;oCACV;AACF;AACF;AACF;AACF;oBACA,OAAOA;AACT;gBACA6I,eAAe;oBACb,KAAK,IAAIlF,KAAanC,UAAU;wBAC9B,IAAIA,SAAS0D,eAAevB,IAAY;4BACtCnC,SAASmC,GAAWF,QAAQqB,SAAS;AACvC;AACF;oBACA,OAAOuD;AACT;gBACAS,wBAAwB;oBACtBpH;oBACA,OAAO2G;AACT;gBAMAU,kBAAkB,SAASZ;oBACzB,IAAIzJ,GAAGM,cAAcmJ,IAAmB;wBACtC,IAAIa,IAA0B;wBAC9B,MAAMC,IAA2B1H;wBACjC,KAAK,IAAI+E,KAAgB6B,GAAkB;4BACzC,IAAIA,EAAiBjD,eAAeoB,MAAiB/E,eAAe2D,eAAeoB,MAAiB2C,EAAyB3C,OAAkB6B,EAAiB7B,IAAe;gCAC7K2C,EAAyB3C,KAAgB6B,EAAiB7B;gCAC1D0C,IAA0B;AAC5B;AACF;wBACA,IAAIA,GAAyB;4BAC3Bd,0BAA0Be;AAC5B;AACF;oBACA,OAAOZ;AACT;gBAMAa,YAAY;oBACV,OAAO;AACT;;YAEF;gBACEhB;gBACAlG,SAASmH,iBAAiB,qBAAoB;oBAC5CzH;AACF;gBACA0H,OAAOD,iBAAiB,aAAY;oBAClC1H,kBAAkB;oBAClBiF;AACF;gBACA,KAAKhI,GAAGG,QAAQuK,OAAOC,WAAW;oBAChCD,OAAOC,WAAWhB;AACpB;AACD,cAZD;AAaD,UA1aD;AA2aF;;;eAEahH","sourcesContent":[null]} \ No newline at end of file diff --git a/dist/observe.js.map b/dist/observe.js.map index c6ac7e0..5c60966 100644 --- a/dist/observe.js.map +++ b/dist/observe.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/ts/constant.ts","../src/ts/is.ts","../src/ts/data.ts","../src/observe.ts"],"names":["Const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AAU,GAAI;AACxC,mBAAU,SAAU,EAAE,QAAQ,SAAS;AAAA,QAC3C;AAAA,MACJ;AAEA,aAAO;AAAA,IACX;AAAA,IAEA,wBAAwB,WAAwB;AAC5C,wBAAkB;AAElB,aAAO;AAAA,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,kBAAkB,SAAW,kBAAoC;AAC7D,UAAK,GAAG,cAAe,gBAAiB,GAAI;AACxC,YAAI,0BAAmC;AACvC,cAAM,2BAAgC;AAEtC,iBAAU,gBAAgB,kBAAmB;AACzC,cAAK,iBAAiB,eAAgB,YAAa,KAAK,eAAe,eAAgB,YAAa,KAAK,yBAA0B,YAAa,MAAM,iBAAkB,YAAa,GAAI;AACrL,qCAA0B,YAAa,IAAI,iBAAkB,YAAa;AAC1E,sCAA0B;AAAA,UAC9B;AAAA,QACJ;AAEA,YAAK,yBAA0B;AAC3B,oCAA2B,wBAAyB;AAAA,QACxD;AAAA,MACJ;AAEA,aAAO;AAAA,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,YAAY,WAAqB;AAC7B,aAAO;AAAA,IACX;AAAA,EACJ;AASA,GAAE,MAAM;AACJ,8BAA0B;AAE1B,aAAS,iBAAkB,oBAAoB,WAAW;AACtD,wBAAkB;AAAA,IACtB,CAAE;AAEF,WAAO,iBAAkB,YAAY,WAAW;AAC5C,wBAAkB;AAElB,8BAAwB;AAAA,IAC5B,CAAE;AAEF,QAAK,CAAC,GAAG,QAAS,OAAO,QAAS,GAAI;AAClC,aAAO,WAAW;AAAA,IACtB;AAAA,EACJ,GAAI;AACR,GAAI","sourcesContent":["/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file constant.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const OBSERVE_JS_ATTRIBUTE_NAME = \"data-observe-js\";\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file is.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Char } from \"./enum\"\n\n\nexport namespace Is {\n export function defined( value: any ) : boolean {\n return value !== null && value !== undefined && value.toString() !== Char.empty;\n }\n\n export function definedObject( object: any ) : boolean {\n return defined( object ) && typeof object === \"object\";\n }\n\n export function definedBoolean( object: any ) : boolean {\n return defined( object ) && typeof object === \"boolean\";\n }\n\n export function definedString( object: any ) : boolean {\n return defined( object ) && typeof object === \"string\";\n }\n\n export function definedFunction( object: any ) : boolean {\n return defined( object ) && typeof object === \"function\";\n }\n\n export function definedNumber( object: any ) : boolean {\n return defined( object ) && typeof object === \"number\";\n }\n\n export function definedArray( object: any ) : boolean {\n return definedObject( object ) && object instanceof Array;\n }\n\n export function definedDate( object: any ) : boolean {\n return definedObject( object ) && object instanceof Date;\n }\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file data.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Char } from \"./enum\";\nimport { Is } from \"./is\";\n\n\nexport namespace Data {\n export namespace String {\n export function newGuid() : string {\n const result: string[] = [];\n \n for ( let charIndex: number = 0; charIndex < 32; charIndex++ ) {\n if ( charIndex === 8 || charIndex === 12 || charIndex === 16 || charIndex === 20 ) {\n result.push( Char.dash );\n }\n \n const character: string = Math.floor( Math.random() * 16 ).toString( 16 );\n result.push( character );\n }\n \n return result.join( Char.empty );\n }\n }\n\n export function getDefaultAnyString( value: any, defaultValue: string ) : string {\n return typeof value === \"string\" ? value : defaultValue;\n }\n\n export function getDefaultString( value: any, defaultValue: string ) : string {\n return Is.definedString( value ) ? value : defaultValue;\n }\n\n export function getDefaultBoolean( value: any, defaultValue: boolean ) : boolean {\n return Is.definedBoolean( value ) ? value : defaultValue;\n }\n\n export function getDefaultNumber( value: any, defaultValue: number ) : number {\n return Is.definedNumber( value ) ? value : defaultValue;\n }\n\n export function getDefaultFunction( value: any, defaultValue: object ) : any {\n return Is.definedFunction( value ) ? value : defaultValue;\n }\n\n export function getDefaultArray( value: any, defaultValue: any[] ) : any[] {\n return Is.definedArray( value ) ? value : defaultValue;\n }\n\n export function getDefaultObject( value: any, defaultValue: object ) : any {\n return Is.definedObject( value ) ? value : defaultValue;\n }\n\n export function getDefaultDate( value: any, defaultValue: Date ) : Date {\n return Is.definedDate( value ) ? value : defaultValue;\n }\n\n export function getDefaultStringOrArray( value: any, defaultValue: string[] ) : string[] {\n let result: string[] = defaultValue;\n\n if ( Is.definedString( value ) ) {\n const values: string[] = value.toString().split( Char.space );\n\n if ( values.length === 0 ) {\n value = defaultValue;\n } else {\n result = values;\n }\n\n } else {\n result = getDefaultArray( value, defaultValue );\n }\n\n return result;\n }\n}","/**\n * Observe.js\n * \n * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.\n * \n * @file observe.ts\n * @version v1.0.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport {\n type WatchOptionEvents,\n type WatchOptions,\n type Configuration,\n type ObserveWatch, \n type ConfigurationText } from \"./ts/type\";\n \nimport { Constant } from \"./ts/constant\";\nimport { Data } from \"./ts/data\";\nimport { Char } from \"./ts/enum\";\nimport { Is } from \"./ts/is\";\nimport { type PublicApi } from \"./ts/api\";\n\n\ntype StringToJson = {\n parsed: boolean;\n object: any;\n};\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Watches\n const _watches: Record = {} as Record;\n let _watches_Cancel: boolean = false;\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Observable DOM Object Creation / Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function collectDOMObjects() : void {\n const tagTypes: string[] = _configuration.domElementTypes as string[];\n const tagTypesLength: number = tagTypes.length;\n\n for ( let tagTypeIndex: number = 0; tagTypeIndex < tagTypesLength; tagTypeIndex++ ) {\n const domElements: HTMLCollectionOf = document.getElementsByTagName( tagTypes[ tagTypeIndex ] );\n const elements: HTMLElement[] = [].slice.call( domElements );\n const elementsLength: number = elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < elementsLength; elementIndex++ ) {\n if ( !collectDOMObject( elements[ elementIndex ] ) ) {\n break;\n }\n }\n }\n }\n\n function collectDOMObject( element: HTMLElement ) : boolean {\n let result: boolean = true;\n\n if ( Is.defined( element ) && element.hasAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME ) ) {\n const bindingOptionsData: string = element.getAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME )!;\n\n if ( Is.definedString( bindingOptionsData ) ) {\n const watchOptionsJson: StringToJson = getObjectFromString( bindingOptionsData );\n\n if ( watchOptionsJson.parsed && Is.definedObject( watchOptionsJson.object ) ) {\n const watchOptions: WatchOptions = getWatchOptions( watchOptionsJson.object );\n\n if ( !Is.definedString( element.id ) ) {\n element.id = Data.String.newGuid();\n }\n\n if ( watchOptions.removeAttribute ) {\n element.removeAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME );\n }\n\n createWatch( element, watchOptions, element.id );\n\n } else {\n logError( _configuration.text!.attributeNotValidErrorText!.replace( \"{{attribute_name}}\", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );\n result = false;\n }\n\n } else {\n logError( _configuration.text!.attributeNotSetErrorText!.replace( \"{{attribute_name}}\", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );\n result = false;\n }\n }\n\n return result;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Watch Object Creation / Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function createWatch( object: any, options: any, domElementId: string = null! ) : string {\n let storageId: string = null!;\n\n if ( Is.definedObject( object ) ) {\n storageId = Data.String.newGuid();\n\n const watchOptions: WatchOptions = getWatchOptions( options );\n const watch: ObserveWatch = {} as ObserveWatch;\n let startWatchObject: any = null;\n\n watch.options = watchOptions;\n watch.totalChanges = 0;\n\n if ( Is.definedString( domElementId ) ) {\n const domElement: HTMLElement = document.getElementById( domElementId )!;\n\n if ( Is.defined( domElement ) ) {\n watch.domElementId = domElementId;\n watch.cachedObject = domElement.outerHTML;\n watch.originalObject = domElement.outerHTML;\n\n startWatchObject = domElement.outerHTML;\n }\n\n } else {\n watch.cachedObject = JSON.stringify( object );\n watch.originalObject = object;\n\n startWatchObject = object;\n }\n\n if ( Is.defined( watch.cachedObject ) ) {\n fireCustomTriggerEvent( watch.options.events!.onStart!, startWatchObject );\n\n watch.timer = setInterval( function() {\n watchTimer( watchOptions, storageId );\n }, watchOptions.timeout );\n \n _watches[ storageId ] = watch;\n }\n }\n\n return storageId;\n }\n\n function watchTimer( watchOptions: WatchOptions, storageId: string ) : void {\n const currentDateTime: Date = new Date();\n\n if ( !Is.definedDate( watchOptions.starts ) || currentDateTime >= watchOptions.starts! ) {\n watchObjectForChanges( storageId );\n\n if ( Is.definedDate( watchOptions.expires ) && currentDateTime >= watchOptions.expires! ) {\n cancelWatchObject( storageId );\n }\n }\n }\n\n function watchObjectForChanges( storageId: string ) : void {\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watch: ObserveWatch = _watches[ storageId ];\n const isDomElement: boolean = Is.definedString( watch.domElementId );\n let domElement: HTMLElement = null!;\n\n if ( isDomElement ) {\n domElement = document.getElementById( watch.domElementId )!;\n\n if ( Is.defined( domElement ) ) {\n watch.originalObject = domElement.outerHTML;\n } else {\n watch.originalObject = Char.empty;\n\n fireCustomTriggerEvent( watch.options.events!.onRemove!, watch.domElementId );\n }\n }\n\n const cachedObject: any = watch.cachedObject;\n const originalObject: any = watch.originalObject;\n const originalObjectJson: any = !isDomElement ? JSON.stringify( originalObject ) : originalObject;\n\n if ( cachedObject !== originalObjectJson ) {\n if ( watch.options.reset ) {\n if ( isDomElement ) {\n domElement.outerHTML = watch.cachedObject;\n } else {\n watch.originalObject = getObjectFromString( cachedObject ).object;\n }\n\n } else {\n watch.cachedObject = originalObjectJson;\n }\n\n if ( isDomElement ) {\n fireCustomTriggerEvent( watch.options.events!.onChange!, cachedObject, originalObjectJson );\n } else {\n\n const oldValue: any = getObjectFromString( cachedObject ).object;\n const newValue: any = getObjectFromString( originalObjectJson ).object;\n\n if ( !Is.definedArray( oldValue ) && !Is.definedArray( newValue ) ) {\n compareWatchObject( oldValue, newValue, watch );\n\n if ( Is.definedFunction( watch.options.events!.onPropertyChange ) ) {\n compareWatchObjectProperties( oldValue, newValue, watch );\n }\n \n } else {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldValue, newValue );\n }\n }\n\n watch.totalChanges++;\n\n if ( watch.options.pauseTimeoutOnChange! > 0 ) {\n pauseWatchObject( storageId, watch.options.pauseTimeoutOnChange! );\n }\n\n if ( watch.options.cancelOnChange ) {\n cancelWatchObject( storageId );\n }\n\n if ( watch.options.maximumChangesBeforeCanceling! > 0 && watch.totalChanges >= watch.options.maximumChangesBeforeCanceling! ) {\n cancelWatchObject( storageId );\n }\n }\n }\n }\n\n function compareWatchObject( oldObject: any, newObject: any, watch: ObserveWatch ) : void {\n if ( Is.definedArray( watch.options.propertyNames ) ) {\n const propertyNamesLength: number = watch.options.propertyNames!.length;\n\n for ( let propertyNameIndex: number = 0; propertyNameIndex < propertyNamesLength; propertyNameIndex++ ) {\n const propertyName: string = watch.options.propertyNames![ propertyNameIndex ];\n\n if ( oldObject[ propertyName ] !== newObject[ propertyName ] ) {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject );\n break;\n }\n }\n\n } else {\n fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject );\n }\n }\n\n function compareWatchObjectProperties( oldObject: any, newObject: any, watch: ObserveWatch ) : void {\n for ( let propertyName in oldObject ) {\n if ( oldObject.hasOwnProperty( propertyName ) ) {\n const propertyOldValue: any = oldObject[ propertyName ];\n let propertyNewValue: any = null;\n\n if ( newObject.hasOwnProperty( propertyName ) ) {\n propertyNewValue = newObject[ propertyName ];\n }\n\n if ( Is.definedObject( propertyOldValue ) && Is.definedObject( propertyNewValue ) ) {\n compareWatchObjectProperties( propertyOldValue, propertyNewValue, watch );\n } else {\n\n if ( !Is.definedArray( watch.options.propertyNames ) || watch.options.propertyNames!.indexOf( propertyName ) > -1 ) {\n if ( JSON.stringify( propertyOldValue ) !== JSON.stringify( propertyNewValue ) ) {\n fireCustomTriggerEvent( watch.options.events!.onPropertyChange!, propertyName, propertyOldValue, propertyNewValue );\n }\n }\n }\n }\n }\n }\n\n function cancelWatchesForObjects() : void {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n cancelWatchObject( storageId );\n }\n }\n }\n\n function cancelWatchObject( storageId: string ) : void {\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watchOptions: WatchOptions = _watches[ storageId ].options;\n\n if ( watchOptions.allowCanceling || _watches_Cancel ) {\n fireCustomTriggerEvent( watchOptions.events!.onCancel!, storageId );\n clearInterval( _watches[ storageId ].timer );\n \n delete _watches[ storageId ];\n }\n }\n }\n\n function pauseWatchObject( storageId: string, milliseconds: number ) : boolean {\n let result: boolean = false;\n\n if ( _watches.hasOwnProperty( storageId ) ) {\n const watchOptions: WatchOptions = _watches[ storageId ].options;\n\n if ( watchOptions.allowPausing ) {\n watchOptions.starts = new Date();\n watchOptions.starts.setMilliseconds( watchOptions.starts.getMilliseconds() + milliseconds );\n \n result = true;\n }\n }\n\n return result;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Watch Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function getWatchOptions( newOptions: any ) : WatchOptions {\n let options: WatchOptions = Data.getDefaultObject( newOptions, {} as WatchOptions );\n\n options.timeout = Data.getDefaultNumber( options.timeout, 250 );\n options.starts = Data.getDefaultDate( options.starts, null! );\n options.expires = Data.getDefaultDate( options.expires, null! );\n options.reset = Data.getDefaultBoolean( options.reset, false );\n options.cancelOnChange = Data.getDefaultBoolean( options.cancelOnChange, false );\n options.maximumChangesBeforeCanceling = Data.getDefaultNumber( options.maximumChangesBeforeCanceling, 0 );\n options.pauseTimeoutOnChange = Data.getDefaultNumber( options.pauseTimeoutOnChange, 0 );\n options.propertyNames = Data.getDefaultArray( options.propertyNames, null! );\n options.allowCanceling = Data.getDefaultBoolean( options.allowCanceling, true );\n options.allowPausing = Data.getDefaultBoolean( options.allowPausing, true );\n options.removeAttribute = Data.getDefaultBoolean( options.removeAttribute, true );\n\n options = getWatchOptionsCustomTriggers( options );\n\n return options;\n }\n\n function getWatchOptionsCustomTriggers( options: WatchOptions ) : WatchOptions {\n options.events = Data.getDefaultObject( options.events, {} as WatchOptionEvents );\n options.events!.onChange = Data.getDefaultFunction( options.events!.onChange, null! );\n options.events!.onPropertyChange = Data.getDefaultFunction( options.events!.onPropertyChange, null! );\n options.events!.onCancel = Data.getDefaultFunction( options.events!.onCancel, null! );\n options.events!.onRemove = Data.getDefaultFunction( options.events!.onRemove, null! );\n options.events!.onStart = Data.getDefaultFunction( options.events!.onStart, null! );\n\n return options;\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Triggering Custom Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function fireCustomTriggerEvent( triggerFunction: Function, ...args : any[] ) : void {\n if ( Is.definedFunction( triggerFunction ) ) {\n triggerFunction.apply( null, [].slice.call( args, 0 ) );\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Default Parameter/Option Handling\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function getObjectFromString( objectString: any ) : StringToJson {\n const result: StringToJson = {\n parsed: true,\n object: null\n } as StringToJson;\n\n try {\n if ( Is.definedString( objectString ) ) {\n result.object = JSON.parse( objectString );\n }\n\n } catch ( e1: any ) {\n try {\n result.object = eval( `(${objectString})` );\n\n if ( Is.definedFunction( result.object ) ) {\n result.object = result.object();\n }\n \n } catch ( e2: any ) {\n if ( !_configuration.safeMode ) {\n logError( _configuration.text!.objectErrorText!.replace( \"{{error_1}}\", e1.message ).replace( \"{{error_2}}\", e2.message ) );\n result.parsed = false;\n }\n \n result.object = null;\n }\n }\n\n return result;\n }\n\n function logError( error: string ) : boolean {\n let result: boolean = true;\n\n if ( !_configuration.safeMode ) {\n console.error( error );\n result = false;\n }\n\n return result;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: any = null ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.safeMode = Data.getDefaultBoolean( _configuration.safeMode, true );\n _configuration.domElementTypes = Data.getDefaultStringOrArray( _configuration.domElementTypes, [ \"*\" ] );\n\n buildDefaultConfigurationStrings();\n }\n\n function buildDefaultConfigurationStrings() : void {\n _configuration.text = Data.getDefaultObject( _configuration.text, {} as ConfigurationText );\n _configuration.text!.objectErrorText = Data.getDefaultString( _configuration.text!.objectErrorText, \"Errors in object: {{error_1}}, {{error_2}}\" );\n _configuration.text!.attributeNotValidErrorText = Data.getDefaultString( _configuration.text!.attributeNotValidErrorText, \"The attribute '{{attribute_name}}' is not a valid object.\" );\n _configuration.text!.attributeNotSetErrorText = Data.getDefaultString( _configuration.text!.attributeNotSetErrorText, \"The attribute '{{attribute_name}}' has not been set correctly.\" ); \n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions:\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n const _public: PublicApi = {\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Watching Objects\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n watch: function ( object: any, options: WatchOptions ) : string {\n return createWatch( object, options );\n },\n\n cancelWatch: function ( id: string ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n cancelWatchObject( id );\n \n result = true;\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n cancelWatchObject( storageId );\n \n result = true;\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n cancelWatches: function () : PublicApi {\n cancelWatchesForObjects();\n\n return _public;\n },\n\n getWatch: function ( id: string ) : ObserveWatch {\n let result: ObserveWatch = null!;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n result = _watches[ id ];\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n result = _watches[ storageId ];\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n getWatches: function () : Record {\n return _watches;\n },\n\n pauseWatch: function ( id: string, milliseconds: number ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) && Is.definedNumber( milliseconds ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n result = pauseWatchObject( id, milliseconds );\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n result = pauseWatchObject( storageId, milliseconds );\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n pauseWatches: function ( milliseconds: number ) : PublicApi {\n if ( Is.definedNumber( milliseconds ) ) {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n pauseWatchObject( storageId, milliseconds );\n }\n }\n }\n \n return _public;\n },\n\n resumeWatch: function ( id: string ) : boolean {\n let result: boolean = false;\n\n if ( Is.definedString( id ) ) {\n if ( _watches.hasOwnProperty( id ) ) {\n _watches[ id ].options.starts = null!;\n result = true;\n } else {\n \n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {\n _watches[ storageId ].options.starts = null!;\n result = true;\n break;\n }\n }\n }\n }\n \n return result;\n },\n\n resumeWatches: function () : PublicApi {\n for ( let storageId in _watches ) {\n if ( _watches.hasOwnProperty( storageId ) ) {\n _watches[ storageId ].options.starts = null!;\n }\n }\n \n return _public;\n },\n\n searchDomForNewWatches: function () : PublicApi {\n collectDOMObjects();\n\n return _public;\n },\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Configuration\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n setConfiguration: function ( newConfiguration: any ) : PublicApi {\n if ( Is.definedObject( newConfiguration ) ) {\n let configurationHasChanged: boolean = false;\n const newInternalConfiguration: any = _configuration;\n \n for ( let propertyName in newConfiguration ) {\n if ( newConfiguration.hasOwnProperty( propertyName ) && _configuration.hasOwnProperty( propertyName ) && newInternalConfiguration[ propertyName ] !== newConfiguration[ propertyName ] ) {\n newInternalConfiguration[ propertyName ] = newConfiguration[ propertyName ];\n configurationHasChanged = true;\n }\n }\n \n if ( configurationHasChanged ) {\n buildDefaultConfiguration( newInternalConfiguration );\n }\n }\n \n return _public;\n },\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Public API Functions: Additional Data\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n getVersion: function () : string {\n return \"1.0.1\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Observe.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", function() {\n collectDOMObjects();\n } );\n\n window.addEventListener( \"pagehide\", function() {\n _watches_Cancel = true;\n\n cancelWatchesForObjects();\n } );\n\n if ( !Is.defined( window.$observe ) ) {\n window.$observe = _public;\n }\n } )();\n} )();"]} \ No newline at end of file +{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.js"],"names":["Constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Data","Data2","String","String2","newGuid","result2","charIndex","push","character","Math","floor","random","join","getDefaultAnyString","defaultValue","getDefaultString","getDefaultBoolean","getDefaultNumber","getDefaultFunction","getDefaultArray","getDefaultObject","getDefaultDate","getDefaultStringOrArray","values","split","length","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","domElementTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","slice","call","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","getWatchOptions","id","removeAttribute","createWatch","logError","text","attributeNotValidErrorText","replace","attributeNotSetErrorText","options","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","fireCustomTriggerEvent","events","onStart","timer","setInterval","watchTimer","timeout","currentDateTime","starts","watchObjectForChanges","expires","cancelWatchObject","hasOwnProperty","isDomElement","onRemove","originalObjectJson","reset","onChange","oldValue","newValue","compareWatchObject","onPropertyChange","compareWatchObjectProperties","pauseTimeoutOnChange","pauseWatchObject","cancelOnChange","maximumChangesBeforeCanceling","oldObject","newObject","propertyNames","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","allowCanceling","onCancel","clearInterval","milliseconds","allowPausing","setMilliseconds","getMilliseconds","newOptions","getWatchOptionsCustomTriggers","triggerFunction","args","apply","objectString","result","parse","e1","eval","e2","safeMode","objectErrorText","message","error","console","buildDefaultConfiguration","newConfiguration","buildDefaultConfigurationStrings","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA;;AAGA,IAAIA;;AACJ,CAAEC;IACAA,EAAUC,4BAA4B;AACvC,EAFD,CAEGF,aAAaA,WAAW,CAAC;;AAG5B,IAAIG;;AACJ,CAAEC;IACA,SAASC,EAAQC;QACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;IACAH,EAAIC,UAAUA;IACd,SAASG,EAAcC;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAII,gBAAgBA;IACpB,SAASE,EAAeD;QACtB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIM,iBAAiBA;IACrB,SAASC,EAAcF;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIO,gBAAgBA;IACpB,SAASC,EAAgBH;QACvB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIQ,kBAAkBA;IACtB,SAASC,EAAcJ;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIS,gBAAgBA;IACpB,SAASC,EAAaL;QACpB,OAAOD,EAAcC,MAAWA,aAAkBM;AACpD;IACAX,EAAIU,eAAeA;IACnB,SAASE,EAAYP;QACnB,OAAOD,EAAcC,MAAWA,aAAkBQ;AACpD;IACAb,EAAIY,cAAcA;AACnB,EAjCD,CAiCGb,OAAOA,KAAK,CAAC;;AAGhB,IAAIe;;AACJ,CAAEC;IACA,IAAIC;IACJ,CAAEC;QACA,SAASC;YACP,MAAMC,IAAU;YAChB,KAAK,IAAIC,IAAY,GAAGA,IAAY,IA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diff --git a/docs/CHANGE_LOG.md b/docs/CHANGE_LOG.md index dda75c4..19120e8 100644 --- a/docs/CHANGE_LOG.md +++ b/docs/CHANGE_LOG.md @@ -1,7 +1,7 @@ # Observe.js - Change Log: ## Version 1.0.1: -- +- Updated to the latest NPM packages.
diff --git a/package-lock.json b/package-lock.json index 56b0e7e..4b37448 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,19 +8,18 @@ "name": "jobserve.js", "version": "1.0.1", "license": "MIT", - "dependencies": { - "typescript": "^5.5.3" - }, "devDependencies": { - "@swc/core": "^1.6.13", - "terser": "^5.31.2", - "tsup": "^8.1.0" + "@swc/core": "^1.7.0", + "sass": "^1.77.8", + "terser": "^5.31.3", + "tsup": "^8.2.2", + "typescript": "^5.5.4" } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", - "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.0.tgz", + "integrity": "sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==", "cpu": [ "ppc64" ], @@ -31,13 +30,13 @@ "aix" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", - "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.0.tgz", + "integrity": "sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==", "cpu": [ "arm" ], @@ -48,13 +47,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", - "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.0.tgz", + "integrity": "sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==", "cpu": [ "arm64" ], @@ -65,13 +64,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", - "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.0.tgz", + "integrity": "sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==", "cpu": [ "x64" ], @@ -82,13 +81,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", - "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.0.tgz", + "integrity": "sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==", "cpu": [ "arm64" ], @@ -99,13 +98,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", - "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.0.tgz", + "integrity": "sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==", "cpu": [ "x64" ], @@ -116,13 +115,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", - "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.0.tgz", + "integrity": "sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==", "cpu": [ "arm64" ], @@ -133,13 +132,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", - "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.0.tgz", + "integrity": "sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==", "cpu": [ "x64" ], @@ -150,13 +149,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", - "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.0.tgz", + "integrity": "sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==", "cpu": [ "arm" ], @@ -167,13 +166,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", - "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.0.tgz", + "integrity": "sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==", "cpu": [ "arm64" ], @@ -184,13 +183,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", - "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.0.tgz", + "integrity": "sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==", "cpu": [ "ia32" ], @@ -201,13 +200,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", - "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.0.tgz", + "integrity": "sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==", "cpu": [ "loong64" ], @@ -218,13 +217,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", - "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.0.tgz", + "integrity": "sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==", "cpu": [ "mips64el" ], @@ -235,13 +234,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", - "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.0.tgz", + "integrity": "sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==", "cpu": [ "ppc64" ], @@ -252,13 +251,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", - "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.0.tgz", + "integrity": "sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==", "cpu": [ "riscv64" ], @@ -269,13 +268,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", - "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.0.tgz", + "integrity": "sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==", "cpu": [ "s390x" ], @@ -286,13 +285,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", - "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.0.tgz", + "integrity": "sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==", "cpu": [ "x64" ], @@ -303,13 +302,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", - "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.0.tgz", + "integrity": "sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==", "cpu": [ "x64" ], @@ -320,13 +319,30 @@ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.0.tgz", + "integrity": "sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", - "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.0.tgz", + "integrity": "sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==", "cpu": [ "x64" ], @@ -337,13 +353,13 @@ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", - "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.0.tgz", + "integrity": "sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==", "cpu": [ "x64" ], @@ -354,13 +370,13 @@ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", - "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.0.tgz", + "integrity": "sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==", "cpu": [ "arm64" ], @@ -371,13 +387,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", - "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.0.tgz", + "integrity": "sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==", "cpu": [ "ia32" ], @@ -388,13 +404,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", - "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.0.tgz", + "integrity": "sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==", "cpu": [ "x64" ], @@ -405,7 +421,7 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@isaacs/cliui": { @@ -540,9 +556,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.1.tgz", - "integrity": "sha512-lncuC4aHicncmbORnx+dUaAgzee9cm/PbIqgWz1PpXuwc+sa1Ct83tnqUDy/GFKleLiN7ZIeytM6KJ4cAn1SxA==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.0.tgz", + "integrity": "sha512-JlPfZ/C7yn5S5p0yKk7uhHTTnFlvTgLetl2VxqE518QgyM7C9bSfFTYvB/Q/ftkq0RIPY4ySxTz+/wKJ/dXC0w==", "cpu": [ "arm" ], @@ -554,9 +570,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.1.tgz", - "integrity": "sha512-F/tkdw0WSs4ojqz5Ovrw5r9odqzFjb5LIgHdHZG65dFI1lWTWRVy32KDJLKRISHgJvqUeUhdIvy43fX41znyDg==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.0.tgz", + "integrity": "sha512-RDxUSY8D1tWYfn00DDi5myxKgOk6RvWPxhmWexcICt/MEC6yEMr4HNCu1sXXYLw8iAsg0D44NuU+qNq7zVWCrw==", "cpu": [ "arm64" ], @@ -568,9 +584,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.1.tgz", - "integrity": "sha512-vk+ma8iC1ebje/ahpxpnrfVQJibTMyHdWpOGZ3JpQ7Mgn/3QNHmPq7YwjZbIE7km73dH5M1e6MRRsnEBW7v5CQ==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.0.tgz", + "integrity": "sha512-emvKHL4B15x6nlNTBMtIaC9tLPRpeA5jMvRLXVbl/W9Ie7HhkrE7KQjvgS9uxgatL1HmHWDXk5TTS4IaNJxbAA==", "cpu": [ "arm64" ], @@ -582,9 +598,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.1.tgz", - "integrity": "sha512-IgpzXKauRe1Tafcej9STjSSuG0Ghu/xGYH+qG6JwsAUxXrnkvNHcq/NL6nz1+jzvWAnQkuAJ4uIwGB48K9OCGA==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.0.tgz", + "integrity": "sha512-fO28cWA1dC57qCd+D0rfLC4VPbh6EOJXrreBmFLWPGI9dpMlER2YwSPZzSGfq11XgcEpPukPTfEVFtw2q2nYJg==", "cpu": [ "x64" ], @@ -596,9 +612,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.1.tgz", - "integrity": "sha512-P9bSiAUnSSM7EmyRK+e5wgpqai86QOSv8BwvkGjLwYuOpaeomiZWifEos517CwbG+aZl1T4clSE1YqqH2JRs+g==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.0.tgz", + "integrity": "sha512-2Rn36Ubxdv32NUcfm0wB1tgKqkQuft00PtM23VqLuCUR4N5jcNWDoV5iBC9jeGdgS38WK66ElncprqgMUOyomw==", "cpu": [ "arm" ], @@ -610,9 +626,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.1.tgz", - "integrity": "sha512-5RnjpACoxtS+aWOI1dURKno11d7krfpGDEn19jI8BuWmSBbUC4ytIADfROM1FZrFhQPSoP+KEa3NlEScznBTyQ==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.0.tgz", + "integrity": "sha512-gJuzIVdq/X1ZA2bHeCGCISe0VWqCoNT8BvkQ+BfsixXwTOndhtLUpOg0A1Fcx/+eA6ei6rMBzlOz4JzmiDw7JQ==", "cpu": [ "arm" ], @@ -624,9 +640,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.1.tgz", - "integrity": "sha512-8mwmGD668m8WaGbthrEYZ9CBmPug2QPGWxhJxh/vCgBjro5o96gL04WLlg5BA233OCWLqERy4YUzX3bJGXaJgQ==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.0.tgz", + "integrity": "sha512-0EkX2HYPkSADo9cfeGFoQ7R0/wTKb7q6DdwI4Yn/ULFE1wuRRCHybxpl2goQrx4c/yzK3I8OlgtBu4xvted0ug==", "cpu": [ "arm64" ], @@ -638,9 +654,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.1.tgz", - "integrity": "sha512-dJX9u4r4bqInMGOAQoGYdwDP8lQiisWb9et+T84l2WXk41yEej8v2iGKodmdKimT8cTAYt0jFb+UEBxnPkbXEQ==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.0.tgz", + "integrity": "sha512-GlIQRj9px52ISomIOEUq/IojLZqzkvRpdP3cLgIE1wUWaiU5Takwlzpz002q0Nxxr1y2ZgxC2obWxjr13lvxNQ==", "cpu": [ "arm64" ], @@ -652,9 +668,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.1.tgz", - "integrity": "sha512-V72cXdTl4EI0x6FNmho4D502sy7ed+LuVW6Ym8aI6DRQ9hQZdp5sj0a2usYOlqvFBNKQnLQGwmYnujo2HvjCxQ==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.0.tgz", + "integrity": "sha512-N6cFJzssruDLUOKfEKeovCKiHcdwVYOT1Hs6dovDQ61+Y9n3Ek4zXvtghPPelt6U0AH4aDGnDLb83uiJMkWYzQ==", "cpu": [ "ppc64" ], @@ -666,9 +682,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.1.tgz", - "integrity": "sha512-f+pJih7sxoKmbjghrM2RkWo2WHUW8UbfxIQiWo5yeCaCM0TveMEuAzKJte4QskBp1TIinpnRcxkquY+4WuY/tg==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.0.tgz", + "integrity": "sha512-2DnD3mkS2uuam/alF+I7M84koGwvn3ZVD7uG+LEWpyzo/bq8+kKnus2EVCkcvh6PlNB8QPNFOz6fWd5N8o1CYg==", "cpu": [ "riscv64" ], @@ -680,9 +696,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.1.tgz", - "integrity": "sha512-qb1hMMT3Fr/Qz1OKovCuUM11MUNLUuHeBC2DPPAWUYYUAOFWaxInaTwTQmc7Fl5La7DShTEpmYwgdt2hG+4TEg==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.0.tgz", + "integrity": "sha512-D6pkaF7OpE7lzlTOFCB2m3Ngzu2ykw40Nka9WmKGUOTS3xcIieHe82slQlNq69sVB04ch73thKYIWz/Ian8DUA==", "cpu": [ "s390x" ], @@ -694,9 +710,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.1.tgz", - "integrity": "sha512-7O5u/p6oKUFYjRbZkL2FLbwsyoJAjyeXHCU3O4ndvzg2OFO2GinFPSJFGbiwFDaCFc+k7gs9CF243PwdPQFh5g==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.0.tgz", + "integrity": "sha512-HBndjQLP8OsdJNSxpNIN0einbDmRFg9+UQeZV1eiYupIRuZsDEoeGU43NQsS34Pp166DtwQOnpcbV/zQxM+rWA==", "cpu": [ "x64" ], @@ -708,9 +724,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.1.tgz", - "integrity": "sha512-pDLkYITdYrH/9Cv/Vlj8HppDuLMDUBmgsM0+N+xLtFd18aXgM9Nyqupb/Uw+HeidhfYg2lD6CXvz6CjoVOaKjQ==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.0.tgz", + "integrity": "sha512-HxfbvfCKJe/RMYJJn0a12eiOI9OOtAUF4G6ozrFUK95BNyoJaSiBjIOHjZskTUffUrB84IPKkFG9H9nEvJGW6A==", "cpu": [ "x64" ], @@ -722,9 +738,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.1.tgz", - "integrity": "sha512-W2ZNI323O/8pJdBGil1oCauuCzmVd9lDmWBBqxYZcOqWD6aWqJtVBQ1dFrF4dYpZPks6F+xCZHfzG5hYlSHZ6g==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.0.tgz", + "integrity": "sha512-HxDMKIhmcguGTiP5TsLNolwBUK3nGGUEoV/BO9ldUBoMLBssvh4J0X8pf11i1fTV7WShWItB1bKAKjX4RQeYmg==", "cpu": [ "arm64" ], @@ -736,9 +752,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.1.tgz", - "integrity": "sha512-ELfEX1/+eGZYMaCIbK4jqLxO1gyTSOIlZr6pbC4SRYFaSIDVKOnZNMdoZ+ON0mrFDp4+H5MhwNC1H/AhE3zQLg==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.0.tgz", + "integrity": "sha512-xItlIAZZaiG/u0wooGzRsx11rokP4qyc/79LkAOdznGRAbOFc+SfEdfUOszG1odsHNgwippUJavag/+W/Etc6Q==", "cpu": [ "ia32" ], @@ -750,9 +766,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.1.tgz", - "integrity": "sha512-yjk2MAkQmoaPYCSu35RLJ62+dz358nE83VfTePJRp8CG7aMg25mEJYpXFiD+NcevhX8LxD5OP5tktPXnXN7GDw==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.0.tgz", + "integrity": "sha512-xNo5fV5ycvCCKqiZcpB65VMR11NJB+StnxHz20jdqRAktfdfzhgjTiJ2doTDQE/7dqGaV5I7ZGqKpgph6lCIag==", "cpu": [ "x64" ], @@ -764,9 +780,9 @@ ] }, "node_modules/@swc/core": { - "version": "1.6.13", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.6.13.tgz", - "integrity": "sha512-eailUYex6fkfaQTev4Oa3mwn0/e3mQU4H8y1WPuImYQESOQDtVrowwUGDSc19evpBbHpKtwM+hw8nLlhIsF+Tw==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.7.0.tgz", + "integrity": "sha512-d4vMzH6ICllDwlPuhset2h8gu/USHdbyfJim+2hQEdxC0UONtfpmu38XBgNqRjStrji1Q5M10jfeUZL3cu1i8g==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", @@ -782,16 +798,16 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-darwin-arm64": "1.6.13", - "@swc/core-darwin-x64": "1.6.13", - "@swc/core-linux-arm-gnueabihf": "1.6.13", - "@swc/core-linux-arm64-gnu": "1.6.13", - "@swc/core-linux-arm64-musl": "1.6.13", - "@swc/core-linux-x64-gnu": "1.6.13", - "@swc/core-linux-x64-musl": "1.6.13", - "@swc/core-win32-arm64-msvc": "1.6.13", - "@swc/core-win32-ia32-msvc": "1.6.13", - "@swc/core-win32-x64-msvc": "1.6.13" + "@swc/core-darwin-arm64": "1.7.0", + "@swc/core-darwin-x64": "1.7.0", + "@swc/core-linux-arm-gnueabihf": "1.7.0", + "@swc/core-linux-arm64-gnu": "1.7.0", + "@swc/core-linux-arm64-musl": "1.7.0", + "@swc/core-linux-x64-gnu": "1.7.0", + "@swc/core-linux-x64-musl": "1.7.0", + "@swc/core-win32-arm64-msvc": "1.7.0", + "@swc/core-win32-ia32-msvc": "1.7.0", + "@swc/core-win32-x64-msvc": "1.7.0" }, "peerDependencies": { "@swc/helpers": "*" @@ -803,9 +819,9 @@ } }, "node_modules/@swc/core-darwin-arm64": { - "version": "1.6.13", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.6.13.tgz", - "integrity": "sha512-SOF4buAis72K22BGJ3N8y88mLNfxLNprTuJUpzikyMGrvkuBFNcxYtMhmomO0XHsgLDzOJ+hWzcgjRNzjMsUcQ==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.7.0.tgz", + "integrity": "sha512-2ylhM7f0HwUwLrFYZAe/dse8PCbPsYcJS3Dt7Q8NT3PUn7vy6QOMxNcOPPuDrnmaXqQQO3oxdmRapguTxaat9g==", "cpu": [ "arm64" ], @@ -820,9 +836,9 @@ } }, "node_modules/@swc/core-darwin-x64": { - "version": "1.6.13", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.6.13.tgz", - "integrity": "sha512-AW8akFSC+tmPE6YQQvK9S2A1B8pjnXEINg+gGgw0KRUUXunvu1/OEOeC5L2Co1wAwhD7bhnaefi06Qi9AiwOag==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.7.0.tgz", + "integrity": "sha512-SgVnN4gT1Rb9YfTkp4FCUITqSs7Yj0uB2SUciu5CV3HuGvS5YXCUzh+KrwpLFtx8NIgivISKcNnb41mJi98X8Q==", "cpu": [ "x64" ], @@ -837,9 +853,9 @@ } }, "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.6.13", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.6.13.tgz", - "integrity": "sha512-f4gxxvDXVUm2HLYXRd311mSrmbpQF2MZ4Ja6XCQz1hWAxXdhRl1gpnZ+LH/xIfGSwQChrtLLVrkxdYUCVuIjFg==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.7.0.tgz", + "integrity": "sha512-+Z9Dayart1iKJQEJJ9N/KS4z5EdXJE3WPFikY0jonKTo4Dd8RuyVz5yLvqcIMeVdz/SwximATaL6iJXw7hZS9A==", "cpu": [ "arm" ], @@ -854,9 +870,9 @@ } }, "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.6.13", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.6.13.tgz", - "integrity": "sha512-Nf/eoW2CbG8s+9JoLtjl9FByBXyQ5cjdBsA4efO7Zw4p+YSuXDgc8HRPC+E2+ns0praDpKNZtLvDtmF2lL+2Gg==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.7.0.tgz", + "integrity": "sha512-UnLrCiZ1EI4shznJn0xP6DLgsXUSwtfsdgHhGYCrvbgVBBve3S9iFgVFEB3SPl7Q/TdowNbrN4zHU0oChfiNfw==", "cpu": [ "arm64" ], @@ -871,9 +887,9 @@ } }, "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.6.13", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.6.13.tgz", - "integrity": "sha512-2OysYSYtdw79prJYuKIiux/Gj0iaGEbpS2QZWCIY4X9sGoETJ5iMg+lY+YCrIxdkkNYd7OhIbXdYFyGs/w5LDg==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.7.0.tgz", + "integrity": "sha512-H724UANA+ptsfwKRr9mnaDa9cb5fw0oFysiGKTgb3DMYcgk3Od0jMTnXVPFSVpo7FlmyxeC9K8ueUPBOoOK6XA==", "cpu": [ "arm64" ], @@ -888,9 +904,9 @@ } }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.6.13", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.6.13.tgz", - "integrity": "sha512-PkR4CZYJNk5hcd2+tMWBpnisnmYsUzazI1O5X7VkIGFcGePTqJ/bWlfUIVVExWxvAI33PQFzLbzmN5scyIUyGQ==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.7.0.tgz", + "integrity": "sha512-SY3HA0K0Dpqt1HIfMLGpwL4hd4UaL2xHP5oZXPlRQPhUDZrbb4PbI3ZJnh66c63eL4ZR8EJ+HRFI0Alx5p69Zw==", "cpu": [ "x64" ], @@ -905,9 +921,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.6.13", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.6.13.tgz", - "integrity": "sha512-OdsY7wryTxCKwGQcwW9jwWg3cxaHBkTTHi91+5nm7hFPpmZMz1HivJrWAMwVE7iXFw+M4l6ugB/wCvpYrUAAjA==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.7.0.tgz", + "integrity": "sha512-cEJ2ebtV1v/5Ilb55E05J6F5SrHKQWzUttIhR5Mkayyo+yvPslcpByuFC3D+J7X1ebziTOBpWuMpUdjLfh3SMQ==", "cpu": [ "x64" ], @@ -922,9 +938,9 @@ } }, "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.6.13", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.6.13.tgz", - "integrity": "sha512-ap6uNmYjwk9M/+bFEuWRNl3hq4VqgQ/Lk+ID/F5WGqczNr0L7vEf+pOsRAn0F6EV+o/nyb3ePt8rLhE/wjHpPg==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.7.0.tgz", + "integrity": "sha512-ecQOOmzEssz+m0pR4xDYCGuvn3E/l0nQ3tk5jp1NA1lsAy4bMV0YbYCHjptYvWL/UjhIerIp3IlCJ8x5DodSog==", "cpu": [ "arm64" ], @@ -939,9 +955,9 @@ } }, "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.6.13", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.6.13.tgz", - "integrity": "sha512-IJ8KH4yIUHTnS/U1jwQmtbfQals7zWPG0a9hbEfIr4zI0yKzjd83lmtS09lm2Q24QBWOCFGEEbuZxR4tIlvfzA==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.7.0.tgz", + "integrity": "sha512-gz81seZkRn3zMnVOc7L5k6F4vQC82gIxmHiL+GedK+A37XI/X26AASU3zxvORnqQbwQYXQ+AEVckxBmFlz3v2g==", "cpu": [ "ia32" ], @@ -956,9 +972,9 @@ } }, "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.6.13", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.6.13.tgz", - "integrity": "sha512-f6/sx6LMuEnbuxtiSL/EkR0Y6qUHFw1XVrh6rwzKXptTipUdOY+nXpKoh+1UsBm/r7H0/5DtOdrn3q5ZHbFZjQ==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.7.0.tgz", + "integrity": "sha512-b5Fd1xEOw9uqBpj2lqsaR4Iq9UhiL84hNDcEsi6DQA7Y1l85waQAslTbS0E4/pJ1PISAs0jW0zIGLco1eaWBOg==", "cpu": [ "x64" ], @@ -1117,9 +1133,9 @@ "license": "MIT" }, "node_modules/bundle-require": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-4.2.1.tgz", - "integrity": "sha512-7Q/6vkyYAwOmQNRw75x+4yRtZCZJXUDmHHlFdkiV0wgv/reNjtJwpu1jPJ0w2kbEpIM0uoKI3S4/f39dU7AjSA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.0.0.tgz", + "integrity": "sha512-GuziW3fSSmopcx4KRymQEJVbZUfqlCqcq7dvs6TYwKRZiegK/2buMxQTPs6MGlNv50wms1699qYO54R8XfRX4w==", "dev": true, "license": "MIT", "dependencies": { @@ -1129,7 +1145,7 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "peerDependencies": { - "esbuild": ">=0.17" + "esbuild": ">=0.18" } }, "node_modules/cac": { @@ -1197,6 +1213,16 @@ "node": ">= 6" } }, + "node_modules/consola": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.2.3.tgz", + "integrity": "sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -1258,9 +1284,9 @@ "license": "MIT" }, "node_modules/esbuild": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", - "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.0.tgz", + "integrity": "sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -1268,32 +1294,33 @@ "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.5", - "@esbuild/android-arm": "0.21.5", - "@esbuild/android-arm64": "0.21.5", - "@esbuild/android-x64": "0.21.5", - "@esbuild/darwin-arm64": "0.21.5", - "@esbuild/darwin-x64": "0.21.5", - "@esbuild/freebsd-arm64": "0.21.5", - "@esbuild/freebsd-x64": "0.21.5", - "@esbuild/linux-arm": "0.21.5", - "@esbuild/linux-arm64": "0.21.5", - "@esbuild/linux-ia32": "0.21.5", - "@esbuild/linux-loong64": "0.21.5", - "@esbuild/linux-mips64el": "0.21.5", - "@esbuild/linux-ppc64": "0.21.5", - "@esbuild/linux-riscv64": "0.21.5", - "@esbuild/linux-s390x": "0.21.5", - "@esbuild/linux-x64": "0.21.5", - "@esbuild/netbsd-x64": "0.21.5", - "@esbuild/openbsd-x64": "0.21.5", - "@esbuild/sunos-x64": "0.21.5", - "@esbuild/win32-arm64": "0.21.5", - "@esbuild/win32-ia32": "0.21.5", - "@esbuild/win32-x64": "0.21.5" + "@esbuild/aix-ppc64": "0.23.0", + "@esbuild/android-arm": "0.23.0", + "@esbuild/android-arm64": "0.23.0", + "@esbuild/android-x64": "0.23.0", + "@esbuild/darwin-arm64": "0.23.0", + "@esbuild/darwin-x64": "0.23.0", + "@esbuild/freebsd-arm64": "0.23.0", + "@esbuild/freebsd-x64": "0.23.0", + "@esbuild/linux-arm": "0.23.0", + "@esbuild/linux-arm64": "0.23.0", + "@esbuild/linux-ia32": "0.23.0", + "@esbuild/linux-loong64": "0.23.0", + "@esbuild/linux-mips64el": "0.23.0", + "@esbuild/linux-ppc64": "0.23.0", + "@esbuild/linux-riscv64": "0.23.0", + "@esbuild/linux-s390x": "0.23.0", + "@esbuild/linux-x64": "0.23.0", + "@esbuild/netbsd-x64": "0.23.0", + "@esbuild/openbsd-arm64": "0.23.0", + "@esbuild/openbsd-x64": "0.23.0", + "@esbuild/sunos-x64": "0.23.0", + "@esbuild/win32-arm64": "0.23.0", + "@esbuild/win32-ia32": "0.23.0", + "@esbuild/win32-x64": "0.23.0" } }, "node_modules/execa": { @@ -1493,6 +1520,13 @@ "node": ">= 4" } }, + "node_modules/immutable": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", + "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", + "dev": true, + "license": "MIT" + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -1818,6 +1852,13 @@ "node": ">=8" } }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true, + "license": "ISC" + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -1842,9 +1883,9 @@ } }, "node_modules/postcss-load-config": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz", - "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", "dev": true, "funding": [ { @@ -1858,21 +1899,28 @@ ], "license": "MIT", "dependencies": { - "lilconfig": "^3.0.0", - "yaml": "^2.3.4" + "lilconfig": "^3.1.1" }, "engines": { - "node": ">= 14" + "node": ">= 18" }, "peerDependencies": { + "jiti": ">=1.21.0", "postcss": ">=8.0.9", - "ts-node": ">=9.0.0" + "tsx": "^4.8.1", + "yaml": "^2.4.2" }, "peerDependenciesMeta": { + "jiti": { + "optional": true + }, "postcss": { "optional": true }, - "ts-node": { + "tsx": { + "optional": true + }, + "yaml": { "optional": true } } @@ -1943,9 +1991,9 @@ } }, "node_modules/rollup": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.1.tgz", - "integrity": "sha512-Elx2UT8lzxxOXMpy5HWQGZqkrQOtrVDDa/bm9l10+U4rQnVzbL/LgZ4NOM1MPIDyHk69W4InuYDF5dzRh4Kw1A==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.19.0.tgz", + "integrity": "sha512-5r7EYSQIowHsK4eTZ0Y81qpZuJz+MUuYeqmmYmRMl1nwhdmbiYqt5jwzf6u7wyOzJgYqtCRMtVRKOtHANBz7rA==", "dev": true, "license": "MIT", "dependencies": { @@ -1959,22 +2007,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.18.1", - "@rollup/rollup-android-arm64": "4.18.1", - "@rollup/rollup-darwin-arm64": "4.18.1", - "@rollup/rollup-darwin-x64": "4.18.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.18.1", - "@rollup/rollup-linux-arm-musleabihf": "4.18.1", - "@rollup/rollup-linux-arm64-gnu": "4.18.1", - "@rollup/rollup-linux-arm64-musl": "4.18.1", - "@rollup/rollup-linux-powerpc64le-gnu": "4.18.1", - "@rollup/rollup-linux-riscv64-gnu": "4.18.1", - "@rollup/rollup-linux-s390x-gnu": "4.18.1", - "@rollup/rollup-linux-x64-gnu": "4.18.1", - "@rollup/rollup-linux-x64-musl": "4.18.1", - "@rollup/rollup-win32-arm64-msvc": "4.18.1", - "@rollup/rollup-win32-ia32-msvc": "4.18.1", - "@rollup/rollup-win32-x64-msvc": "4.18.1", + "@rollup/rollup-android-arm-eabi": "4.19.0", + "@rollup/rollup-android-arm64": "4.19.0", + "@rollup/rollup-darwin-arm64": "4.19.0", + "@rollup/rollup-darwin-x64": "4.19.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.19.0", + "@rollup/rollup-linux-arm-musleabihf": "4.19.0", + "@rollup/rollup-linux-arm64-gnu": "4.19.0", + "@rollup/rollup-linux-arm64-musl": "4.19.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.19.0", + "@rollup/rollup-linux-riscv64-gnu": "4.19.0", + "@rollup/rollup-linux-s390x-gnu": "4.19.0", + "@rollup/rollup-linux-x64-gnu": "4.19.0", + "@rollup/rollup-linux-x64-musl": "4.19.0", + "@rollup/rollup-win32-arm64-msvc": "4.19.0", + "@rollup/rollup-win32-ia32-msvc": "4.19.0", + "@rollup/rollup-win32-x64-msvc": "4.19.0", "fsevents": "~2.3.2" } }, @@ -2002,6 +2050,24 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/sass": { + "version": "1.77.8", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.77.8.tgz", + "integrity": "sha512-4UHg6prsrycW20fqLGPShtEvo/WyHRVRHwOP4DzkUrObWoWI05QBSfzU71TVB7PFaL104TwNaHpjlWXAZbQiNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -2055,6 +2121,16 @@ "node": ">= 8" } }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", @@ -2214,9 +2290,9 @@ } }, "node_modules/terser": { - "version": "5.31.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.2.tgz", - "integrity": "sha512-LGyRZVFm/QElZHy/CPr/O4eNZOZIzsrQ92y4v9UJe/pFJjypje2yI3C2FmPtvUEnhadlSbmG2nXtdcjHOjCfxw==", + "version": "5.31.3", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.3.tgz", + "integrity": "sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -2303,25 +2379,27 @@ "license": "Apache-2.0" }, "node_modules/tsup": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.1.0.tgz", - "integrity": "sha512-UFdfCAXukax+U6KzeTNO2kAARHcWxmKsnvSPXUcfA1D+kU05XDccCrkffCQpFaWDsZfV0jMyTsxU39VfCp6EOg==", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.2.2.tgz", + "integrity": "sha512-MufIuzdSt6HYPOeOtjUXLR4rqRJySi6XsRNZdwvjC2XR+xghsu2L3vSmYmX+k4S1mO6j0OlUEyVQ3Fc0H66XcA==", "dev": true, "license": "MIT", "dependencies": { - "bundle-require": "^4.0.0", - "cac": "^6.7.12", - "chokidar": "^3.5.1", - "debug": "^4.3.1", - "esbuild": "^0.21.4", - "execa": "^5.0.0", - "globby": "^11.0.3", - "joycon": "^3.0.1", - "postcss-load-config": "^4.0.1", + "bundle-require": "^5.0.0", + "cac": "^6.7.14", + "chokidar": "^3.6.0", + "consola": "^3.2.3", + "debug": "^4.3.5", + "esbuild": "^0.23.0", + "execa": "^5.1.1", + "globby": "^11.1.0", + "joycon": "^3.1.1", + "picocolors": "^1.0.1", + "postcss-load-config": "^6.0.1", "resolve-from": "^5.0.0", - "rollup": "^4.0.2", + "rollup": "^4.19.0", "source-map": "0.8.0-beta.0", - "sucrase": "^3.20.3", + "sucrase": "^3.35.0", "tree-kill": "^1.2.2" }, "bin": { @@ -2353,9 +2431,10 @@ } }, "node_modules/typescript": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", - "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "dev": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -2497,19 +2576,6 @@ "engines": { "node": ">=8" } - }, - "node_modules/yaml": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", - "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", - "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14" - } } } } diff --git a/package.json b/package.json index 3cc45bc..fa855ad 100644 --- a/package.json +++ b/package.json @@ -43,10 +43,10 @@ "build-typescript-minimized": "tsup --config tsup.build.min.config.ts" }, "devDependencies": { - "@swc/core": "^1.6.13", + "@swc/core": "^1.7.0", "sass": "^1.77.8", - "terser": "^5.31.2", - "tsup": "^8.1.0", - "typescript": "^5.5.3" + "terser": "^5.31.3", + "tsup": "^8.2.2", + "typescript": "^5.5.4" } } From 51acf615870a3af16689814eb699d44d234fcacd Mon Sep 17 00:00:00 2001 From: William Troup Date: Tue, 23 Jul 2024 20:00:21 +0100 Subject: [PATCH 3/7] Organized all of the .ts files into separate folders. --- dist/observe.esm.js | 229 ++++++++++++++++++++------------------ dist/observe.esm.js.map | 2 +- dist/observe.js | 212 ++++++++++++++++++----------------- dist/observe.js.map | 2 +- dist/observe.min.js | 2 +- docs/CHANGE_LOG.md | 1 + src/observe.ts | 67 +++++------ src/ts/data.ts | 86 -------------- src/ts/data/default.ts | 69 ++++++++++++ src/ts/{ => data}/enum.ts | 0 src/ts/{ => data}/is.ts | 0 src/ts/data/str.ts | 32 ++++++ 12 files changed, 365 insertions(+), 337 deletions(-) delete mode 100644 src/ts/data.ts create mode 100644 src/ts/data/default.ts rename src/ts/{ => data}/enum.ts (100%) rename src/ts/{ => data}/is.ts (100%) create mode 100644 src/ts/data/str.ts diff --git a/dist/observe.esm.js b/dist/observe.esm.js index aa06650..b3e062b 100644 --- a/dist/observe.esm.js +++ b/dist/observe.esm.js @@ -22,7 +22,7 @@ var init_constant = __esm({ }); var init_enum = __esm({ - "src/ts/enum.ts"() { + "src/ts/data/enum.ts"() { "use strict"; } }); @@ -30,7 +30,7 @@ var init_enum = __esm({ var Is; var init_is = __esm({ - "src/ts/is.ts"() { + "src/ts/data/is.ts"() { "use strict"; init_enum(); (e => { @@ -46,18 +46,18 @@ var init_is = __esm({ return t(e) && typeof e === "boolean"; } e.definedBoolean = r; - function a(e) { + function o(e) { return t(e) && typeof e === "string"; } - e.definedString = a; - function o(e) { + e.definedString = o; + function i(e) { return t(e) && typeof e === "function"; } - e.definedFunction = o; - function i(e) { + e.definedFunction = i; + function a(e) { return t(e) && typeof e === "number"; } - e.definedNumber = i; + e.definedNumber = a; function s(e) { return n(e) && e instanceof Array; } @@ -70,62 +70,47 @@ var init_is = __esm({ } }); -var Data; +var Default; -var init_data = __esm({ - "src/ts/data.ts"() { +var init_default = __esm({ + "src/ts/data/default.ts"() { "use strict"; init_enum(); init_is(); (e => { - let t; - (e => { - function t() { - const e = []; - for (let t = 0; t < 32; t++) { - if (t === 8 || t === 12 || t === 16 || t === 20) { - e.push("-"); - } - const n = Math.floor(Math.random() * 16).toString(16); - e.push(n); - } - return e.join(""); - } - e.newGuid = t; - })(t = e.String || (e.String = {})); - function n(e, t) { + function t(e, t) { return typeof e === "string" ? e : t; } - e.getDefaultAnyString = n; - function r(e, t) { + e.getAnyString = t; + function n(e, t) { return Is.definedString(e) ? e : t; } - e.getDefaultString = r; - function a(e, t) { + e.getString = n; + function r(e, t) { return Is.definedBoolean(e) ? e : t; } - e.getDefaultBoolean = a; + e.getBoolean = r; function o(e, t) { return Is.definedNumber(e) ? e : t; } - e.getDefaultNumber = o; + e.getNumber = o; function i(e, t) { return Is.definedFunction(e) ? e : t; } - e.getDefaultFunction = i; - function s(e, t) { + e.getFunction = i; + function a(e, t) { return Is.definedArray(e) ? e : t; } - e.getDefaultArray = s; - function c(e, t) { + e.getArray = a; + function s(e, t) { return Is.definedObject(e) ? e : t; } - e.getDefaultObject = c; - function u(e, t) { + e.getObject = s; + function c(e, t) { return Is.definedDate(e) ? e : t; } - e.getDefaultDate = u; - function f(e, t) { + e.getDate = c; + function u(e, t) { let n = t; if (Is.definedString(e)) { const r = e.toString().split("space"); @@ -135,21 +120,45 @@ var init_data = __esm({ n = r; } } else { - n = s(e, t); + n = a(e, t); } return n; } - e.getDefaultStringOrArray = f; - })(Data || (Data = {})); + e.getStringOrArray = u; + })(Default || (Default = {})); + } +}); + +var Str; + +var init_str = __esm({ + "src/ts/data/str.ts"() { + "use strict"; + init_enum(); + (e => { + function t() { + const e = []; + for (let t = 0; t < 32; t++) { + if (t === 8 || t === 12 || t === 16 || t === 20) { + e.push("-"); + } + const n = Math.floor(Math.random() * 16).toString(16); + e.push(n); + } + return e.join(""); + } + e.newGuid = t; + })(Str || (Str = {})); } }); var require_observe = __commonJS({ "src/observe.ts"(exports, module) { init_constant(); - init_data(); + init_default(); init_enum(); init_is(); + init_str(); (() => { let _configuration = {}; const _watches = {}; @@ -160,8 +169,8 @@ var require_observe = __commonJS({ for (let n = 0; n < t; n++) { const t = document.getElementsByTagName(e[n]); const r = [].slice.call(t); - const a = r.length; - for (let e = 0; e < a; e++) { + const o = r.length; + for (let e = 0; e < o; e++) { if (!collectDOMObject(r[e])) { break; } @@ -177,7 +186,7 @@ var require_observe = __commonJS({ if (r.parsed && Is.definedObject(r.object)) { const t = getWatchOptions(r.object); if (!Is.definedString(e.id)) { - e.id = Data.String.newGuid(); + e.id = Str.newGuid(); } if (t.removeAttribute) { e.removeAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME); @@ -197,31 +206,31 @@ var require_observe = __commonJS({ function createWatch(e, t, n = null) { let r = null; if (Is.definedObject(e)) { - r = Data.String.newGuid(); - const a = getWatchOptions(t); - const o = {}; - let i = null; - o.options = a; - o.totalChanges = 0; + r = Str.newGuid(); + const o = getWatchOptions(t); + const i = {}; + let a = null; + i.options = o; + i.totalChanges = 0; if (Is.definedString(n)) { const e = document.getElementById(n); if (Is.defined(e)) { - o.domElementId = n; - o.cachedObject = e.outerHTML; - o.originalObject = e.outerHTML; - i = e.outerHTML; + i.domElementId = n; + i.cachedObject = e.outerHTML; + i.originalObject = e.outerHTML; + a = e.outerHTML; } } else { - o.cachedObject = JSON.stringify(e); - o.originalObject = e; - i = e; + i.cachedObject = JSON.stringify(e); + i.originalObject = e; + a = e; } - if (Is.defined(o.cachedObject)) { - fireCustomTriggerEvent(o.options.events.onStart, i); - o.timer = setInterval((function() { - watchTimer(a, r); - }), a.timeout); - _watches[r] = o; + if (Is.defined(i.cachedObject)) { + fireCustomTriggerEvent(i.options.events.onStart, a); + i.timer = setInterval((function() { + watchTimer(o, r); + }), o.timeout); + _watches[r] = i; } } return r; @@ -249,24 +258,24 @@ var require_observe = __commonJS({ fireCustomTriggerEvent(t.options.events.onRemove, t.domElementId); } } - const a = t.cachedObject; - const o = t.originalObject; - const i = !n ? JSON.stringify(o) : o; - if (a !== i) { + const o = t.cachedObject; + const i = t.originalObject; + const a = !n ? JSON.stringify(i) : i; + if (o !== a) { if (t.options.reset) { if (n) { r.outerHTML = t.cachedObject; } else { - t.originalObject = getObjectFromString(a).object; + t.originalObject = getObjectFromString(o).object; } } else { - t.cachedObject = i; + t.cachedObject = a; } if (n) { - fireCustomTriggerEvent(t.options.events.onChange, a, i); + fireCustomTriggerEvent(t.options.events.onChange, o, a); } else { - const e = getObjectFromString(a).object; - const n = getObjectFromString(i).object; + const e = getObjectFromString(o).object; + const n = getObjectFromString(a).object; if (!Is.definedArray(e) && !Is.definedArray(n)) { compareWatchObject(e, n, t); if (Is.definedFunction(t.options.events.onPropertyChange)) { @@ -292,8 +301,8 @@ var require_observe = __commonJS({ function compareWatchObject(e, t, n) { if (Is.definedArray(n.options.propertyNames)) { const r = n.options.propertyNames.length; - for (let a = 0; a < r; a++) { - const r = n.options.propertyNames[a]; + for (let o = 0; o < r; o++) { + const r = n.options.propertyNames[o]; if (e[r] !== t[r]) { fireCustomTriggerEvent(n.options.events.onChange, e, t); break; @@ -306,17 +315,17 @@ var require_observe = __commonJS({ function compareWatchObjectProperties(e, t, n) { for (let r in e) { if (e.hasOwnProperty(r)) { - const a = e[r]; - let o = null; + const o = e[r]; + let i = null; if (t.hasOwnProperty(r)) { - o = t[r]; + i = t[r]; } - if (Is.definedObject(a) && Is.definedObject(o)) { - compareWatchObjectProperties(a, o, n); + if (Is.definedObject(o) && Is.definedObject(i)) { + compareWatchObjectProperties(o, i, n); } else { if (!Is.definedArray(n.options.propertyNames) || n.options.propertyNames.indexOf(r) > -1) { - if (JSON.stringify(a) !== JSON.stringify(o)) { - fireCustomTriggerEvent(n.options.events.onPropertyChange, r, a, o); + if (JSON.stringify(o) !== JSON.stringify(i)) { + fireCustomTriggerEvent(n.options.events.onPropertyChange, r, o, i); } } } @@ -353,28 +362,28 @@ var require_observe = __commonJS({ return n; } function getWatchOptions(e) { - let t = Data.getDefaultObject(e, {}); - t.timeout = Data.getDefaultNumber(t.timeout, 250); - t.starts = Data.getDefaultDate(t.starts, null); - t.expires = Data.getDefaultDate(t.expires, null); - t.reset = Data.getDefaultBoolean(t.reset, false); - t.cancelOnChange = Data.getDefaultBoolean(t.cancelOnChange, false); - t.maximumChangesBeforeCanceling = Data.getDefaultNumber(t.maximumChangesBeforeCanceling, 0); - t.pauseTimeoutOnChange = Data.getDefaultNumber(t.pauseTimeoutOnChange, 0); - t.propertyNames = Data.getDefaultArray(t.propertyNames, null); - t.allowCanceling = Data.getDefaultBoolean(t.allowCanceling, true); - t.allowPausing = Data.getDefaultBoolean(t.allowPausing, true); - t.removeAttribute = Data.getDefaultBoolean(t.removeAttribute, true); + let t = Default.getObject(e, {}); + t.timeout = Default.getNumber(t.timeout, 250); + t.starts = Default.getDate(t.starts, null); + t.expires = Default.getDate(t.expires, null); + t.reset = Default.getBoolean(t.reset, false); + t.cancelOnChange = Default.getBoolean(t.cancelOnChange, false); + t.maximumChangesBeforeCanceling = Default.getNumber(t.maximumChangesBeforeCanceling, 0); + t.pauseTimeoutOnChange = Default.getNumber(t.pauseTimeoutOnChange, 0); + t.propertyNames = Default.getArray(t.propertyNames, null); + t.allowCanceling = Default.getBoolean(t.allowCanceling, true); + t.allowPausing = Default.getBoolean(t.allowPausing, true); + t.removeAttribute = Default.getBoolean(t.removeAttribute, true); t = getWatchOptionsCustomTriggers(t); return t; } function getWatchOptionsCustomTriggers(e) { - e.events = Data.getDefaultObject(e.events, {}); - e.events.onChange = Data.getDefaultFunction(e.events.onChange, null); - e.events.onPropertyChange = Data.getDefaultFunction(e.events.onPropertyChange, null); - e.events.onCancel = Data.getDefaultFunction(e.events.onCancel, null); - e.events.onRemove = Data.getDefaultFunction(e.events.onRemove, null); - e.events.onStart = Data.getDefaultFunction(e.events.onStart, null); + e.events = Default.getObject(e.events, {}); + e.events.onChange = Default.getFunction(e.events.onChange, null); + e.events.onPropertyChange = Default.getFunction(e.events.onPropertyChange, null); + e.events.onCancel = Default.getFunction(e.events.onCancel, null); + e.events.onRemove = Default.getFunction(e.events.onRemove, null); + e.events.onStart = Default.getFunction(e.events.onStart, null); return e; } function fireCustomTriggerEvent(e, ...t) { @@ -416,16 +425,16 @@ var require_observe = __commonJS({ return t; } function buildDefaultConfiguration(e = null) { - _configuration = Data.getDefaultObject(e, {}); - _configuration.safeMode = Data.getDefaultBoolean(_configuration.safeMode, true); - _configuration.domElementTypes = Data.getDefaultStringOrArray(_configuration.domElementTypes, [ "*" ]); + _configuration = Default.getObject(e, {}); + _configuration.safeMode = Default.getBoolean(_configuration.safeMode, true); + _configuration.domElementTypes = Default.getStringOrArray(_configuration.domElementTypes, [ "*" ]); buildDefaultConfigurationStrings(); } function buildDefaultConfigurationStrings() { - _configuration.text = Data.getDefaultObject(_configuration.text, {}); - _configuration.text.objectErrorText = Data.getDefaultString(_configuration.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}"); - _configuration.text.attributeNotValidErrorText = Data.getDefaultString(_configuration.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object."); - _configuration.text.attributeNotSetErrorText = Data.getDefaultString(_configuration.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly."); + _configuration.text = Default.getObject(_configuration.text, {}); + _configuration.text.objectErrorText = Default.getString(_configuration.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}"); + _configuration.text.attributeNotValidErrorText = Default.getString(_configuration.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object."); + _configuration.text.attributeNotSetErrorText = Default.getString(_configuration.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly."); } const _public = { watch: function(e, t) { diff --git a/dist/observe.esm.js.map b/dist/observe.esm.js.map index da5fb52..59c92ef 100644 --- a/dist/observe.esm.js.map +++ b/dist/observe.esm.js.map @@ -1 +1 @@ -{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.esm.js"],"names":["__getOwnPropNames","Object","getOwnPropertyNames","__esm","fn","res","__init","__commonJS","cb","mod","__require","exports","Constant","init_constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","init_enum","Is","init_is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Data","init_data","Data2","String","String2","newGuid","result2","charIndex","push","character","Math","floor","random","join","getDefaultAnyString","defaultValue","getDefaultString","getDefaultBoolean","getDefaultNumber","getDefaultFunction","getDefaultArray","getDefaultObject","getDefaultDate","getDefaultStringOrArray","values","split","length","require_observe","module","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","domElementTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","slice","call","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","getWatchOptions","id","removeAttribute","createWatch","logError","text","attributeNotValidErrorText","replace","attributeNotSetErrorText","options","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","fireCustomTriggerEvent","events","onStart","timer","setInterval","watchTimer","timeout","currentDateTime","starts","watchObjectForChanges","expires","cancelWatchObject","hasOwnProperty","isDomElement","onRemove","originalObjectJson","reset","onChange","oldValue","newValue","compareWatchObject","onPropertyChange","compareWatchObjectProperties","pauseTimeoutOnChange","pauseWatchObject","cancelOnChange","maximumChangesBeforeCanceling","oldObject","newObject","propertyNames","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","allowCanceling","onCancel","clearInterval","milliseconds","allowPausing","setMilliseconds","getMilliseconds","newOptions","getWatchOptionsCustomTriggers","triggerFunction","args","apply","objectString","result","parse","e1","eval","e2","safeMode","objectErrorText","message","error","console","buildDefaultConfiguration","newConfiguration","buildDefaultConfigurationStrings","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA,IAAIA,oBAAoBC,OAAOC;;AAC/B,IAAIC,QAAQ,CAACC,GAAIC,MAAQ,SAASC;IAChC,OAAOF,MAAOC,KAAO,GAAGD,EAAGJ,kBAAkBI,GAAI,KAAKA,IAAK,KAAKC;AAClE;;AACA,IAAIE,aAAa,CAACC,GAAIC,MAAQ,SAASC;IACrC,OAAOD,MAAQ,GAAGD,EAAGR,kBAAkBQ,GAAI,MAAMC,IAAM;QAAEE,SAAS,CAAC;OAAKA,SAASF,IAAMA,EAAIE;AAC7F;;AAGA,IAAIC;;AACJ,IAAIC,gBAAgBV,MAAM;IACxB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AiB,aAAY;oBAClC1H,kBAAkB;oBAClBiF;AACF;gBACA,KAAKhI,GAAGG,QAAQuK,OAAOC,WAAW;oBAChCD,OAAOC,WAAWhB;AACpB;AACD,cAZD;AAaD,UA1aD;AA2aF;;;eAEahH","sourcesContent":[null]} \ No newline at end of file +{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.esm.js"],"names":["__getOwnPropNames","Object","getOwnPropertyNames","__esm","fn","res","__init","__commonJS","cb","mod","__require","exports","Constant","init_constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","init_enum","Is","init_is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Default","init_default","Default2","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","result2","values","split","length","Str","init_str","Str2","newGuid","charIndex","push","character","Math","floor","random","join","require_observe","module","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","domElementTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","slice","call","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","getWatchOptions","id","removeAttribute","createWatch","logError","text","attributeNotValidErrorText","replace","attributeNotSetErrorText","options","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","fireCustomTriggerEvent","events","onStart","timer","setInterval","watchTimer","timeout","currentDateTime","starts","watchObjectForChanges","expires","cancelWatchObject","hasOwnProperty","isDomElement","onRemove","originalObjectJson","reset","onChange","oldValue","newValue","compareWatchObject","onPropertyChange","compareWatchObjectProperties","pauseTimeoutOnChange","pauseWatchObject","cancelOnChange","maximumChangesBeforeCanceling","oldObject","newObject","propertyNames","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","allowCanceling","onCancel","clearInterval","milliseconds","allowPausing","setMilliseconds","getMilliseconds","newOptions","getWatchOptionsCustomTriggers","triggerFunction","args","apply","objectString","result","parse","e1","eval","e2","safeMode","objectErrorText","message","error","console","buildDefaultConfiguration","newConfiguration","buildDefaultConfigurationStrings","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA,IAAIA,oBAAoBC,OAAOC;;AAC/B,IAAIC,QAAQ,CAACC,GAAIC,MAAQ,SAASC;IAChC,OAAOF,MAAOC,KAAO,GAAGD,EAAGJ,kBAAkBI,GAAI,KAAKA,IAAK,KAAKC;AAClE;;AACA,IAAIE,aAAa,CAACC,GAAIC,MAAQ,SAASC;IACrC,OAAOD,MAAQ,GAAGD,EAAGR,kBAAkBQ,GAAI,MAAMC,IAAM;QAAEE,SAAS,CAAC;OAAKA,SAASF,IAAMA,EAAIE;AAC7F;;AAGA,IAAIC;;AACJ,IAAIC,gBAAgBV,MAAM;IACxB;QACE;QACA,CAAEW;YACAA,EAAUC,4BAA4B;AACvC,UAFD,CAEGH,aAAaA,WAAW,CAAC;AAC9B;;;AAIF,IAAII,YAAYb,MAAM;IACpB;QACE;AACF;;;AAIF,IAAIc;;AACJ,IAAIC,UAAUf,MAAM;IAClB;QACE;QACAa;QACA,CAAEG;YACA,SAASC,EAAQC;gBACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;YACAH,EAAIC,UAAUA;YACd,SAASG,EAAcC;gBACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;YACAL,EAAII,gBAAgBA;YACpB,SAASE,EAAeD;gBACtB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;YACAL,EAAIM,iBAAiBA;YACrB,SAASC,EAAcF;gBACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;YACAL,EAAIO,gBAAgBA;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AAOuD;AACT;gBACAS,wBAAwB;oBACtBpH;oBACA,OAAO2G;AACT;gBAMAU,kBAAkB,SAASZ;oBACzB,IAAI1J,GAAGM,cAAcoJ,IAAmB;wBACtC,IAAIa,IAA0B;wBAC9B,MAAMC,IAA2B1H;wBACjC,KAAK,IAAI+E,KAAgB6B,GAAkB;4BACzC,IAAIA,EAAiBjD,eAAeoB,MAAiB/E,eAAe2D,eAAeoB,MAAiB2C,EAAyB3C,OAAkB6B,EAAiB7B,IAAe;gCAC7K2C,EAAyB3C,KAAgB6B,EAAiB7B;gCAC1D0C,IAA0B;AAC5B;AACF;wBACA,IAAIA,GAAyB;4BAC3Bd,0BAA0Be;AAC5B;AACF;oBACA,OAAOZ;AACT;gBAMAa,YAAY;oBACV,OAAO;AACT;;YAEF;gBACEhB;gBACAlG,SAASmH,iBAAiB,qBAAoB;oBAC5CzH;AACF;gBACA0H,OAAOD,iBAAiB,aAAY;oBAClC1H,kBAAkB;oBAClBiF;AACF;gBACA,KAAKjI,GAAGG,QAAQwK,OAAOC,WAAW;oBAChCD,OAAOC,WAAWhB;AACpB;AACD,cAZD;AAaD,UA1aD;AA2aF;;;eAEahH","sourcesContent":[null]} \ No newline at end of file diff --git a/dist/observe.js b/dist/observe.js index 95dcb8c..03aacaa 100644 --- a/dist/observe.js +++ b/dist/observe.js @@ -21,18 +21,18 @@ var Is; return t(e) && typeof e === "boolean"; } e.definedBoolean = r; - function a(e) { + function o(e) { return t(e) && typeof e === "string"; } - e.definedString = a; - function o(e) { + e.definedString = o; + function i(e) { return t(e) && typeof e === "function"; } - e.definedFunction = o; - function i(e) { + e.definedFunction = i; + function a(e) { return t(e) && typeof e === "number"; } - e.definedNumber = i; + e.definedNumber = a; function c(e) { return n(e) && e instanceof Array; } @@ -43,57 +43,42 @@ var Is; e.definedDate = s; })(Is || (Is = {})); -var Data; +var Default; (e => { - let t; - (e => { - function t() { - const e = []; - for (let t = 0; t < 32; t++) { - if (t === 8 || t === 12 || t === 16 || t === 20) { - e.push("-"); - } - const n = Math.floor(Math.random() * 16).toString(16); - e.push(n); - } - return e.join(""); - } - e.newGuid = t; - })(t = e.String || (e.String = {})); - function n(e, t) { + function t(e, t) { return typeof e === "string" ? e : t; } - e.getDefaultAnyString = n; - function r(e, t) { + e.getAnyString = t; + function n(e, t) { return Is.definedString(e) ? e : t; } - e.getDefaultString = r; - function a(e, t) { + e.getString = n; + function r(e, t) { return Is.definedBoolean(e) ? e : t; } - e.getDefaultBoolean = a; + e.getBoolean = r; function o(e, t) { return Is.definedNumber(e) ? e : t; } - e.getDefaultNumber = o; + e.getNumber = o; function i(e, t) { return Is.definedFunction(e) ? e : t; } - e.getDefaultFunction = i; - function c(e, t) { + e.getFunction = i; + function a(e, t) { return Is.definedArray(e) ? e : t; } - e.getDefaultArray = c; - function s(e, t) { + e.getArray = a; + function c(e, t) { return Is.definedObject(e) ? e : t; } - e.getDefaultObject = s; - function u(e, t) { + e.getObject = c; + function s(e, t) { return Is.definedDate(e) ? e : t; } - e.getDefaultDate = u; - function f(e, t) { + e.getDate = s; + function u(e, t) { let n = t; if (Is.definedString(e)) { const r = e.toString().split("space"); @@ -103,12 +88,29 @@ var Data; n = r; } } else { - n = c(e, t); + n = a(e, t); } return n; } - e.getDefaultStringOrArray = f; -})(Data || (Data = {})); + e.getStringOrArray = u; +})(Default || (Default = {})); + +var Str; + +(e => { + function t() { + const e = []; + for (let t = 0; t < 32; t++) { + if (t === 8 || t === 12 || t === 16 || t === 20) { + e.push("-"); + } + const n = Math.floor(Math.random() * 16).toString(16); + e.push(n); + } + return e.join(""); + } + e.newGuid = t; +})(Str || (Str = {})); (() => { let _configuration = {}; @@ -120,8 +122,8 @@ var Data; for (let n = 0; n < t; n++) { const t = document.getElementsByTagName(e[n]); const r = [].slice.call(t); - const a = r.length; - for (let e = 0; e < a; e++) { + const o = r.length; + for (let e = 0; e < o; e++) { if (!collectDOMObject(r[e])) { break; } @@ -137,7 +139,7 @@ var Data; if (r.parsed && Is.definedObject(r.object)) { const t = getWatchOptions(r.object); if (!Is.definedString(e.id)) { - e.id = Data.String.newGuid(); + e.id = Str.newGuid(); } if (t.removeAttribute) { e.removeAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME); @@ -157,31 +159,31 @@ var Data; function createWatch(e, t, n = null) { let r = null; if (Is.definedObject(e)) { - r = Data.String.newGuid(); - const a = getWatchOptions(t); - const o = {}; - let i = null; - o.options = a; - o.totalChanges = 0; + r = Str.newGuid(); + const o = getWatchOptions(t); + const i = {}; + let a = null; + i.options = o; + i.totalChanges = 0; if (Is.definedString(n)) { const e = document.getElementById(n); if (Is.defined(e)) { - o.domElementId = n; - o.cachedObject = e.outerHTML; - o.originalObject = e.outerHTML; - i = e.outerHTML; + i.domElementId = n; + i.cachedObject = e.outerHTML; + i.originalObject = e.outerHTML; + a = e.outerHTML; } } else { - o.cachedObject = JSON.stringify(e); - o.originalObject = e; - i = e; + i.cachedObject = JSON.stringify(e); + i.originalObject = e; + a = e; } - if (Is.defined(o.cachedObject)) { - fireCustomTriggerEvent(o.options.events.onStart, i); - o.timer = setInterval((function() { - watchTimer(a, r); - }), a.timeout); - _watches[r] = o; + if (Is.defined(i.cachedObject)) { + fireCustomTriggerEvent(i.options.events.onStart, a); + i.timer = setInterval((function() { + watchTimer(o, r); + }), o.timeout); + _watches[r] = i; } } return r; @@ -209,24 +211,24 @@ var Data; fireCustomTriggerEvent(t.options.events.onRemove, t.domElementId); } } - const a = t.cachedObject; - const o = t.originalObject; - const i = !n ? JSON.stringify(o) : o; - if (a !== i) { + const o = t.cachedObject; + const i = t.originalObject; + const a = !n ? JSON.stringify(i) : i; + if (o !== a) { if (t.options.reset) { if (n) { r.outerHTML = t.cachedObject; } else { - t.originalObject = getObjectFromString(a).object; + t.originalObject = getObjectFromString(o).object; } } else { - t.cachedObject = i; + t.cachedObject = a; } if (n) { - fireCustomTriggerEvent(t.options.events.onChange, a, i); + fireCustomTriggerEvent(t.options.events.onChange, o, a); } else { - const e = getObjectFromString(a).object; - const n = getObjectFromString(i).object; + const e = getObjectFromString(o).object; + const n = getObjectFromString(a).object; if (!Is.definedArray(e) && !Is.definedArray(n)) { compareWatchObject(e, n, t); if (Is.definedFunction(t.options.events.onPropertyChange)) { @@ -252,8 +254,8 @@ var Data; function compareWatchObject(e, t, n) { if (Is.definedArray(n.options.propertyNames)) { const r = n.options.propertyNames.length; - for (let a = 0; a < r; a++) { - const r = n.options.propertyNames[a]; + for (let o = 0; o < r; o++) { + const r = n.options.propertyNames[o]; if (e[r] !== t[r]) { fireCustomTriggerEvent(n.options.events.onChange, e, t); break; @@ -266,17 +268,17 @@ var Data; function compareWatchObjectProperties(e, t, n) { for (let r in e) { if (e.hasOwnProperty(r)) { - const a = e[r]; - let o = null; + const o = e[r]; + let i = null; if (t.hasOwnProperty(r)) { - o = t[r]; + i = t[r]; } - if (Is.definedObject(a) && Is.definedObject(o)) { - compareWatchObjectProperties(a, o, n); + if (Is.definedObject(o) && Is.definedObject(i)) { + compareWatchObjectProperties(o, i, n); } else { if (!Is.definedArray(n.options.propertyNames) || n.options.propertyNames.indexOf(r) > -1) { - if (JSON.stringify(a) !== JSON.stringify(o)) { - fireCustomTriggerEvent(n.options.events.onPropertyChange, r, a, o); + if (JSON.stringify(o) !== JSON.stringify(i)) { + fireCustomTriggerEvent(n.options.events.onPropertyChange, r, o, i); } } } @@ -313,28 +315,28 @@ var Data; return n; } function getWatchOptions(e) { - let t = Data.getDefaultObject(e, {}); - t.timeout = Data.getDefaultNumber(t.timeout, 250); - t.starts = Data.getDefaultDate(t.starts, null); - t.expires = Data.getDefaultDate(t.expires, null); - t.reset = Data.getDefaultBoolean(t.reset, false); - t.cancelOnChange = Data.getDefaultBoolean(t.cancelOnChange, false); - t.maximumChangesBeforeCanceling = Data.getDefaultNumber(t.maximumChangesBeforeCanceling, 0); - t.pauseTimeoutOnChange = Data.getDefaultNumber(t.pauseTimeoutOnChange, 0); - t.propertyNames = Data.getDefaultArray(t.propertyNames, null); - t.allowCanceling = Data.getDefaultBoolean(t.allowCanceling, true); - t.allowPausing = Data.getDefaultBoolean(t.allowPausing, true); - t.removeAttribute = Data.getDefaultBoolean(t.removeAttribute, true); + let t = Default.getObject(e, {}); + t.timeout = Default.getNumber(t.timeout, 250); + t.starts = Default.getDate(t.starts, null); + t.expires = Default.getDate(t.expires, null); + t.reset = Default.getBoolean(t.reset, false); + t.cancelOnChange = Default.getBoolean(t.cancelOnChange, false); + t.maximumChangesBeforeCanceling = Default.getNumber(t.maximumChangesBeforeCanceling, 0); + t.pauseTimeoutOnChange = Default.getNumber(t.pauseTimeoutOnChange, 0); + t.propertyNames = Default.getArray(t.propertyNames, null); + t.allowCanceling = Default.getBoolean(t.allowCanceling, true); + t.allowPausing = Default.getBoolean(t.allowPausing, true); + t.removeAttribute = Default.getBoolean(t.removeAttribute, true); t = getWatchOptionsCustomTriggers(t); return t; } function getWatchOptionsCustomTriggers(e) { - e.events = Data.getDefaultObject(e.events, {}); - e.events.onChange = Data.getDefaultFunction(e.events.onChange, null); - e.events.onPropertyChange = Data.getDefaultFunction(e.events.onPropertyChange, null); - e.events.onCancel = Data.getDefaultFunction(e.events.onCancel, null); - e.events.onRemove = Data.getDefaultFunction(e.events.onRemove, null); - e.events.onStart = Data.getDefaultFunction(e.events.onStart, null); + e.events = Default.getObject(e.events, {}); + e.events.onChange = Default.getFunction(e.events.onChange, null); + e.events.onPropertyChange = Default.getFunction(e.events.onPropertyChange, null); + e.events.onCancel = Default.getFunction(e.events.onCancel, null); + e.events.onRemove = Default.getFunction(e.events.onRemove, null); + e.events.onStart = Default.getFunction(e.events.onStart, null); return e; } function fireCustomTriggerEvent(e, ...t) { @@ -376,16 +378,16 @@ var Data; return t; } function buildDefaultConfiguration(e = null) { - _configuration = Data.getDefaultObject(e, {}); - _configuration.safeMode = Data.getDefaultBoolean(_configuration.safeMode, true); - _configuration.domElementTypes = Data.getDefaultStringOrArray(_configuration.domElementTypes, [ "*" ]); + _configuration = Default.getObject(e, {}); + _configuration.safeMode = Default.getBoolean(_configuration.safeMode, true); + _configuration.domElementTypes = Default.getStringOrArray(_configuration.domElementTypes, [ "*" ]); buildDefaultConfigurationStrings(); } function buildDefaultConfigurationStrings() { - _configuration.text = Data.getDefaultObject(_configuration.text, {}); - _configuration.text.objectErrorText = Data.getDefaultString(_configuration.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}"); - _configuration.text.attributeNotValidErrorText = Data.getDefaultString(_configuration.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object."); - _configuration.text.attributeNotSetErrorText = Data.getDefaultString(_configuration.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly."); + _configuration.text = Default.getObject(_configuration.text, {}); + _configuration.text.objectErrorText = Default.getString(_configuration.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}"); + _configuration.text.attributeNotValidErrorText = Default.getString(_configuration.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object."); + _configuration.text.attributeNotSetErrorText = Default.getString(_configuration.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly."); } const _public = { watch: function(e, t) { diff --git a/dist/observe.js.map b/dist/observe.js.map index 5c60966..0fc8254 100644 --- a/dist/observe.js.map +++ b/dist/observe.js.map @@ -1 +1 @@ -{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.js"],"names":["Constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Data","Data2","String","String2","newGuid","result2","charIndex","push","character","Math","floor","random","join","getDefaultAnyString","defaultValue","getDefaultString","getDefaultBoolean","getDefaultNumber","getDefaultFunction","getDefaultArray","getDefaultObject","getDefaultDate","getDefaultStringOrArray","values","split","length","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","domElementTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","slice","call","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","getWatchOptions","id","removeAttribute","createWatch","logError","text","attributeNotValidErrorText","replace","attributeNotSetErrorText","options","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","fireCustomTriggerEvent","events","onStart","timer","setInterval","watchTimer","timeout","currentDateTime","starts","watchObjectForChanges","expires","cancelWatchObject","hasOwnProperty","isDomElement","onRemove","originalObjectJson","reset","onChange","oldValue","newValue","compareWatchObject","onPropertyChange","compareWatchObjectProperties","pauseTimeoutOnChange","pauseWatchObject","cancelOnChange","maximumChangesBeforeCanceling","oldObject","newObject","propertyNames","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","allowCanceling","onCancel","clearInterval","milliseconds","allowPausing","setMilliseconds","getMilliseconds","newOptions","getWatchOptionsCustomTriggers","triggerFunction","args","apply","objectString","result","parse","e1","eval","e2","safeMode","objectErrorText","message","error","console","buildDefaultConfiguration","newConfiguration","buildDefaultConfigurationStrings","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA;;AAGA,IAAIA;;AACJ,CAAEC;IACAA,EAAUC,4BAA4B;AACvC,EAFD,CAEGF,aAAaA,WAAW,CAAC;;AAG5B,IAAIG;;AACJ,CAAEC;IACA,SAASC,EAAQC;QACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;IACAH,EAAIC,UAAUA;IACd,SAASG,EAAcC;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAII,gBAAgBA;IACpB,SAASE,EAAeD;QACtB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIM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AmB;gBACtC,IAAIa,IAA0B;gBAC9B,MAAMC,IAA2B1H;gBACjC,KAAK,IAAI+E,KAAgB6B,GAAkB;oBACzC,IAAIA,EAAiBjD,eAAeoB,MAAiB/E,eAAe2D,eAAeoB,MAAiB2C,EAAyB3C,OAAkB6B,EAAiB7B,IAAe;wBAC7K2C,EAAyB3C,KAAgB6B,EAAiB7B;wBAC1D0C,IAA0B;AAC5B;AACF;gBACA,IAAIA,GAAyB;oBAC3Bd,0BAA0Be;AAC5B;AACF;YACA,OAAOZ;AACT;QAMAa,YAAY;YACV,OAAO;AACT;;IAEF;QACEhB;QACAlG,SAASmH,iBAAiB,qBAAoB;YAC5CzH;AACF;QACA0H,OAAOD,iBAAiB,aAAY;YAClC1H,kBAAkB;YAClBiF;AACF;QACA,KAAK5H,GAAGE,QAAQoK,OAAOC,WAAW;YAChCD,OAAOC,WAAWhB;AACpB;AACD,MAZD;AAaD,EA1aD","sourcesContent":[null]} \ No newline at end of file +{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.js"],"names":["Constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Default","Default2","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","result2","values","split","length","Str","Str2","newGuid","charIndex","push","character","Math","floor","random","join","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","domElementTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","slice","call","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","getWatchOptions","id","removeAttribute","createWatch","logError","text","attributeNotValidErrorText","replace","attributeNotSetErrorText","options","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","fireCustomTriggerEvent","events","onStart","timer","setInterval","watchTimer","timeout","currentDateTime","starts","watchObjectForChanges","expires","cancelWatchObject","hasOwnProperty","isDomElement","onRemove","originalObjectJson","reset","onChange","oldValue","newValue","compareWatchObject","onPropertyChange","compareWatchObjectProperties","pauseTimeoutOnChange","pauseWatchObject","cancelOnChange","maximumChangesBeforeCanceling","oldObject","newObject","propertyNames","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","allowCanceling","onCancel","clearInterval","milliseconds","allowPausing","setMilliseconds","getMilliseconds","newOptions","getWatchOptionsCustomTriggers","triggerFunction","args","apply","objectString","result","parse","e1","eval","e2","safeMode","objectErrorText","message","error","console","buildDefaultConfiguration","newConfiguration","buildDefaultConfigurationStrings","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA;;AAGA,IAAIA;;AACJ,CAAEC;IACAA,EAAUC,4BAA4B;AACvC,EAFD,CAEGF,aAAaA,WAAW,CAAC;;AAG5B,IAAIG;;AACJ,CAAEC;IACA,SAASC,EAAQC;QACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;IACAH,EAAIC,UAAUA;IACd,SAASG,EAAcC;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAII,gBAAgBA;IACpB,SAASE,EAAeD;QACtB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIM,iBAAiBA;IACrB,SAASC,EAAcF;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIO,gBAAgBA;IACpB,SAASC,EAAgBH;QACvB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIQ,kBAAkBA;IACtB,SAASC,EAAcJ;QACrB,OAAOJ,EAAQI,aAAkBA,MAA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iB,aAAY;YAClC1H,kBAAkB;YAClBiF;AACF;QACA,KAAK5H,GAAGE,QAAQoK,OAAOC,WAAW;YAChCD,OAAOC,WAAWhB;AACpB;AACD,MAZD;AAaD,EA1aD","sourcesContent":[null]} \ No newline at end of file diff --git a/dist/observe.min.js b/dist/observe.min.js index bdf2400..7e6fbb5 100644 --- a/dist/observe.min.js +++ b/dist/observe.min.js @@ -1 +1 @@ -"use strict";var Constant,Is,Data;(Constant||(Constant={})).OBSERVE_JS_ATTRIBUTE_NAME="data-observe-js",(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=function(e){return n(e)&&e instanceof Array},e.definedDate=function(e){return n(e)&&e instanceof Date}})(Is||(Is={})),(e=>{let t;function n(e,t){return Is.definedArray(e)?e:t}(t=e.String||(e.String={})).newGuid=function(){const e=[];for(let t=0;t<32;t++){8!==t&&12!==t&&16!==t&&20!==t||e.push("-");const n=Math.floor(16*Math.random()).toString(16);e.push(n)}return e.join("")},e.getDefaultAnyString=function(e,t){return"string"==typeof e?e:t},e.getDefaultString=function(e,t){return Is.definedString(e)?e:t},e.getDefaultBoolean=function(e,t){return Is.definedBoolean(e)?e:t},e.getDefaultNumber=function(e,t){return Is.definedNumber(e)?e:t},e.getDefaultFunction=function(e,t){return Is.definedFunction(e)?e:t},e.getDefaultArray=n,e.getDefaultObject=function(e,t){return Is.definedObject(e)?e:t},e.getDefaultDate=function(e,t){return Is.definedDate(e)?e:t},e.getDefaultStringOrArray=function(e,t){let r=t;if(Is.definedString(e)){const n=e.toString().split("space");0===n.length?e=t:r=n}else r=n(e,t);return r}})(Data||(Data={})),(()=>{let _configuration={};const _watches={};let _watches_Cancel=!1;function collectDOMObjects(){const e=_configuration.domElementTypes,t=e.length;for(let n=0;n=e.starts)&&(watchObjectForChanges(t),Is.definedDate(e.expires)&&n>=e.expires&&cancelWatchObject(t))}function watchObjectForChanges(e){if(_watches.hasOwnProperty(e)){const t=_watches[e],n=Is.definedString(t.domElementId);let r=null;n&&(r=document.getElementById(t.domElementId),Is.defined(r)?t.originalObject=r.outerHTML:(t.originalObject="",fireCustomTriggerEvent(t.options.events.onRemove,t.domElementId)));const o=t.cachedObject,a=t.originalObject,i=n?a:JSON.stringify(a);if(o!==i){if(t.options.reset?n?r.outerHTML=t.cachedObject:t.originalObject=getObjectFromString(o).object:t.cachedObject=i,n)fireCustomTriggerEvent(t.options.events.onChange,o,i);else{const e=getObjectFromString(o).object,n=getObjectFromString(i).object;Is.definedArray(e)||Is.definedArray(n)?fireCustomTriggerEvent(t.options.events.onChange,e,n):(compareWatchObject(e,n,t),Is.definedFunction(t.options.events.onPropertyChange)&&compareWatchObjectProperties(e,n,t))}t.totalChanges++,t.options.pauseTimeoutOnChange>0&&pauseWatchObject(e,t.options.pauseTimeoutOnChange),t.options.cancelOnChange&&cancelWatchObject(e),t.options.maximumChangesBeforeCanceling>0&&t.totalChanges>=t.options.maximumChangesBeforeCanceling&&cancelWatchObject(e)}}}function compareWatchObject(e,t,n){if(Is.definedArray(n.options.propertyNames)){const r=n.options.propertyNames.length;for(let o=0;o-1)&&JSON.stringify(o)!==JSON.stringify(a)&&fireCustomTriggerEvent(n.options.events.onPropertyChange,r,o,a)}}function cancelWatchesForObjects(){for(let e in _watches)_watches.hasOwnProperty(e)&&cancelWatchObject(e)}function cancelWatchObject(e){if(_watches.hasOwnProperty(e)){const t=_watches[e].options;(t.allowCanceling||_watches_Cancel)&&(fireCustomTriggerEvent(t.events.onCancel,e),clearInterval(_watches[e].timer),delete _watches[e])}}function pauseWatchObject(e,t){let n=!1;if(_watches.hasOwnProperty(e)){const r=_watches[e].options;r.allowPausing&&(r.starts=new Date,r.starts.setMilliseconds(r.starts.getMilliseconds()+t),n=!0)}return n}function getWatchOptions(e){let t=Data.getDefaultObject(e,{});return t.timeout=Data.getDefaultNumber(t.timeout,250),t.starts=Data.getDefaultDate(t.starts,null),t.expires=Data.getDefaultDate(t.expires,null),t.reset=Data.getDefaultBoolean(t.reset,!1),t.cancelOnChange=Data.getDefaultBoolean(t.cancelOnChange,!1),t.maximumChangesBeforeCanceling=Data.getDefaultNumber(t.maximumChangesBeforeCanceling,0),t.pauseTimeoutOnChange=Data.getDefaultNumber(t.pauseTimeoutOnChange,0),t.propertyNames=Data.getDefaultArray(t.propertyNames,null),t.allowCanceling=Data.getDefaultBoolean(t.allowCanceling,!0),t.allowPausing=Data.getDefaultBoolean(t.allowPausing,!0),t.removeAttribute=Data.getDefaultBoolean(t.removeAttribute,!0),t=getWatchOptionsCustomTriggers(t),t}function getWatchOptionsCustomTriggers(e){return e.events=Data.getDefaultObject(e.events,{}),e.events.onChange=Data.getDefaultFunction(e.events.onChange,null),e.events.onPropertyChange=Data.getDefaultFunction(e.events.onPropertyChange,null),e.events.onCancel=Data.getDefaultFunction(e.events.onCancel,null),e.events.onRemove=Data.getDefaultFunction(e.events.onRemove,null),e.events.onStart=Data.getDefaultFunction(e.events.onStart,null),e}function fireCustomTriggerEvent(e,...t){Is.definedFunction(e)&&e.apply(null,[].slice.call(t,0))}function getObjectFromString(objectString){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval(`(${objectString})`),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){_configuration.safeMode||(logError(_configuration.text.objectErrorText.replace("{{error_1}}",e1.message).replace("{{error_2}}",e.message)),result.parsed=!1),result.object=null}}return result}function logError(e){let t=!0;return _configuration.safeMode||(console.error(e),t=!1),t}function buildDefaultConfiguration(e=null){_configuration=Data.getDefaultObject(e,{}),_configuration.safeMode=Data.getDefaultBoolean(_configuration.safeMode,!0),_configuration.domElementTypes=Data.getDefaultStringOrArray(_configuration.domElementTypes,["*"]),buildDefaultConfigurationStrings()}function buildDefaultConfigurationStrings(){_configuration.text=Data.getDefaultObject(_configuration.text,{}),_configuration.text.objectErrorText=Data.getDefaultString(_configuration.text.objectErrorText,"Errors in object: {{error_1}}, {{error_2}}"),_configuration.text.attributeNotValidErrorText=Data.getDefaultString(_configuration.text.attributeNotValidErrorText,"The attribute '{{attribute_name}}' is not a valid object."),_configuration.text.attributeNotSetErrorText=Data.getDefaultString(_configuration.text.attributeNotSetErrorText,"The attribute '{{attribute_name}}' has not been set correctly.")}const _public={watch:function(e,t){return createWatch(e,t)},cancelWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))cancelWatchObject(e),t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){cancelWatchObject(n),t=!0;break}return t},cancelWatches:function(){return cancelWatchesForObjects(),_public},getWatch:function(e){let t=null;if(Is.definedString(e))if(_watches.hasOwnProperty(e))t=_watches[e];else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){t=_watches[n];break}return t},getWatches:function(){return _watches},pauseWatch:function(e,t){let n=!1;if(Is.definedString(e)&&Is.definedNumber(t))if(_watches.hasOwnProperty(e))n=pauseWatchObject(e,t);else for(let r in _watches)if(_watches.hasOwnProperty(r)&&Is.definedString(_watches[r].domElementId)&&_watches[r].domElementId===e){n=pauseWatchObject(r,t);break}return n},pauseWatches:function(e){if(Is.definedNumber(e))for(let t in _watches)_watches.hasOwnProperty(t)&&pauseWatchObject(t,e);return _public},resumeWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))_watches[e].options.starts=null,t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){_watches[n].options.starts=null,t=!0;break}return t},resumeWatches:function(){for(let e in _watches)_watches.hasOwnProperty(e)&&(_watches[e].options.starts=null);return _public},searchDomForNewWatches:function(){return collectDOMObjects(),_public},setConfiguration:function(e){if(Is.definedObject(e)){let t=!1;const n=_configuration;for(let r in e)e.hasOwnProperty(r)&&_configuration.hasOwnProperty(r)&&n[r]!==e[r]&&(n[r]=e[r],t=!0);t&&buildDefaultConfiguration(n)}return _public},getVersion:function(){return"1.0.1"}};buildDefaultConfiguration(),document.addEventListener("DOMContentLoaded",(function(){collectDOMObjects()})),window.addEventListener("pagehide",(function(){_watches_Cancel=!0,cancelWatchesForObjects()})),Is.defined(window.$observe)||(window.$observe=_public)})(); \ No newline at end of file +"use strict";var Constant,Is,Default,Str;(Constant||(Constant={})).OBSERVE_JS_ATTRIBUTE_NAME="data-observe-js",(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=function(e){return n(e)&&e instanceof Array},e.definedDate=function(e){return n(e)&&e instanceof Date}})(Is||(Is={})),(e=>{function t(e,t){return Is.definedArray(e)?e:t}e.getAnyString=function(e,t){return"string"==typeof e?e:t},e.getString=function(e,t){return Is.definedString(e)?e:t},e.getBoolean=function(e,t){return Is.definedBoolean(e)?e:t},e.getNumber=function(e,t){return Is.definedNumber(e)?e:t},e.getFunction=function(e,t){return Is.definedFunction(e)?e:t},e.getArray=t,e.getObject=function(e,t){return Is.definedObject(e)?e:t},e.getDate=function(e,t){return Is.definedDate(e)?e:t},e.getStringOrArray=function(e,n){let r=n;if(Is.definedString(e)){const t=e.toString().split("space");0===t.length?e=n:r=t}else r=t(e,n);return r}})(Default||(Default={})),(Str||(Str={})).newGuid=function(){const e=[];for(let t=0;t<32;t++){8!==t&&12!==t&&16!==t&&20!==t||e.push("-");const n=Math.floor(16*Math.random()).toString(16);e.push(n)}return e.join("")},(()=>{let _configuration={};const _watches={};let _watches_Cancel=!1;function collectDOMObjects(){const e=_configuration.domElementTypes,t=e.length;for(let n=0;n=e.starts)&&(watchObjectForChanges(t),Is.definedDate(e.expires)&&n>=e.expires&&cancelWatchObject(t))}function watchObjectForChanges(e){if(_watches.hasOwnProperty(e)){const t=_watches[e],n=Is.definedString(t.domElementId);let r=null;n&&(r=document.getElementById(t.domElementId),Is.defined(r)?t.originalObject=r.outerHTML:(t.originalObject="",fireCustomTriggerEvent(t.options.events.onRemove,t.domElementId)));const o=t.cachedObject,i=t.originalObject,a=n?i:JSON.stringify(i);if(o!==a){if(t.options.reset?n?r.outerHTML=t.cachedObject:t.originalObject=getObjectFromString(o).object:t.cachedObject=a,n)fireCustomTriggerEvent(t.options.events.onChange,o,a);else{const e=getObjectFromString(o).object,n=getObjectFromString(a).object;Is.definedArray(e)||Is.definedArray(n)?fireCustomTriggerEvent(t.options.events.onChange,e,n):(compareWatchObject(e,n,t),Is.definedFunction(t.options.events.onPropertyChange)&&compareWatchObjectProperties(e,n,t))}t.totalChanges++,t.options.pauseTimeoutOnChange>0&&pauseWatchObject(e,t.options.pauseTimeoutOnChange),t.options.cancelOnChange&&cancelWatchObject(e),t.options.maximumChangesBeforeCanceling>0&&t.totalChanges>=t.options.maximumChangesBeforeCanceling&&cancelWatchObject(e)}}}function compareWatchObject(e,t,n){if(Is.definedArray(n.options.propertyNames)){const r=n.options.propertyNames.length;for(let o=0;o-1)&&JSON.stringify(o)!==JSON.stringify(i)&&fireCustomTriggerEvent(n.options.events.onPropertyChange,r,o,i)}}function cancelWatchesForObjects(){for(let e in _watches)_watches.hasOwnProperty(e)&&cancelWatchObject(e)}function cancelWatchObject(e){if(_watches.hasOwnProperty(e)){const t=_watches[e].options;(t.allowCanceling||_watches_Cancel)&&(fireCustomTriggerEvent(t.events.onCancel,e),clearInterval(_watches[e].timer),delete _watches[e])}}function pauseWatchObject(e,t){let n=!1;if(_watches.hasOwnProperty(e)){const r=_watches[e].options;r.allowPausing&&(r.starts=new Date,r.starts.setMilliseconds(r.starts.getMilliseconds()+t),n=!0)}return n}function getWatchOptions(e){let t=Default.getObject(e,{});return t.timeout=Default.getNumber(t.timeout,250),t.starts=Default.getDate(t.starts,null),t.expires=Default.getDate(t.expires,null),t.reset=Default.getBoolean(t.reset,!1),t.cancelOnChange=Default.getBoolean(t.cancelOnChange,!1),t.maximumChangesBeforeCanceling=Default.getNumber(t.maximumChangesBeforeCanceling,0),t.pauseTimeoutOnChange=Default.getNumber(t.pauseTimeoutOnChange,0),t.propertyNames=Default.getArray(t.propertyNames,null),t.allowCanceling=Default.getBoolean(t.allowCanceling,!0),t.allowPausing=Default.getBoolean(t.allowPausing,!0),t.removeAttribute=Default.getBoolean(t.removeAttribute,!0),t=getWatchOptionsCustomTriggers(t),t}function getWatchOptionsCustomTriggers(e){return e.events=Default.getObject(e.events,{}),e.events.onChange=Default.getFunction(e.events.onChange,null),e.events.onPropertyChange=Default.getFunction(e.events.onPropertyChange,null),e.events.onCancel=Default.getFunction(e.events.onCancel,null),e.events.onRemove=Default.getFunction(e.events.onRemove,null),e.events.onStart=Default.getFunction(e.events.onStart,null),e}function fireCustomTriggerEvent(e,...t){Is.definedFunction(e)&&e.apply(null,[].slice.call(t,0))}function getObjectFromString(objectString){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval(`(${objectString})`),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){_configuration.safeMode||(logError(_configuration.text.objectErrorText.replace("{{error_1}}",e1.message).replace("{{error_2}}",e.message)),result.parsed=!1),result.object=null}}return result}function logError(e){let t=!0;return _configuration.safeMode||(console.error(e),t=!1),t}function buildDefaultConfiguration(e=null){_configuration=Default.getObject(e,{}),_configuration.safeMode=Default.getBoolean(_configuration.safeMode,!0),_configuration.domElementTypes=Default.getStringOrArray(_configuration.domElementTypes,["*"]),buildDefaultConfigurationStrings()}function buildDefaultConfigurationStrings(){_configuration.text=Default.getObject(_configuration.text,{}),_configuration.text.objectErrorText=Default.getString(_configuration.text.objectErrorText,"Errors in object: {{error_1}}, {{error_2}}"),_configuration.text.attributeNotValidErrorText=Default.getString(_configuration.text.attributeNotValidErrorText,"The attribute '{{attribute_name}}' is not a valid object."),_configuration.text.attributeNotSetErrorText=Default.getString(_configuration.text.attributeNotSetErrorText,"The attribute '{{attribute_name}}' has not been set correctly.")}const _public={watch:function(e,t){return createWatch(e,t)},cancelWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))cancelWatchObject(e),t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){cancelWatchObject(n),t=!0;break}return t},cancelWatches:function(){return cancelWatchesForObjects(),_public},getWatch:function(e){let t=null;if(Is.definedString(e))if(_watches.hasOwnProperty(e))t=_watches[e];else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){t=_watches[n];break}return t},getWatches:function(){return _watches},pauseWatch:function(e,t){let n=!1;if(Is.definedString(e)&&Is.definedNumber(t))if(_watches.hasOwnProperty(e))n=pauseWatchObject(e,t);else for(let r in _watches)if(_watches.hasOwnProperty(r)&&Is.definedString(_watches[r].domElementId)&&_watches[r].domElementId===e){n=pauseWatchObject(r,t);break}return n},pauseWatches:function(e){if(Is.definedNumber(e))for(let t in _watches)_watches.hasOwnProperty(t)&&pauseWatchObject(t,e);return _public},resumeWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))_watches[e].options.starts=null,t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){_watches[n].options.starts=null,t=!0;break}return t},resumeWatches:function(){for(let e in _watches)_watches.hasOwnProperty(e)&&(_watches[e].options.starts=null);return _public},searchDomForNewWatches:function(){return collectDOMObjects(),_public},setConfiguration:function(e){if(Is.definedObject(e)){let t=!1;const n=_configuration;for(let r in e)e.hasOwnProperty(r)&&_configuration.hasOwnProperty(r)&&n[r]!==e[r]&&(n[r]=e[r],t=!0);t&&buildDefaultConfiguration(n)}return _public},getVersion:function(){return"1.0.1"}};buildDefaultConfiguration(),document.addEventListener("DOMContentLoaded",(function(){collectDOMObjects()})),window.addEventListener("pagehide",(function(){_watches_Cancel=!0,cancelWatchesForObjects()})),Is.defined(window.$observe)||(window.$observe=_public)})(); \ No newline at end of file diff --git a/docs/CHANGE_LOG.md b/docs/CHANGE_LOG.md index 19120e8..97ba494 100644 --- a/docs/CHANGE_LOG.md +++ b/docs/CHANGE_LOG.md @@ -2,6 +2,7 @@ ## Version 1.0.1: - Updated to the latest NPM packages. +- Organized all of the .ts files into separate folders.
diff --git a/src/observe.ts b/src/observe.ts index 2981f71..555b5f4 100644 --- a/src/observe.ts +++ b/src/observe.ts @@ -17,12 +17,13 @@ import { type Configuration, type ObserveWatch, type ConfigurationText } from "./ts/type"; - -import { Constant } from "./ts/constant"; -import { Data } from "./ts/data"; -import { Char } from "./ts/enum"; -import { Is } from "./ts/is"; + import { type PublicApi } from "./ts/api"; +import { Constant } from "./ts/constant"; +import { Default } from "./ts/data/default"; +import { Char } from "./ts/data/enum"; +import { Is } from "./ts/data/is"; +import { Str } from "./ts/data/str"; type StringToJson = { @@ -76,7 +77,7 @@ type StringToJson = { const watchOptions: WatchOptions = getWatchOptions( watchOptionsJson.object ); if ( !Is.definedString( element.id ) ) { - element.id = Data.String.newGuid(); + element.id = Str.newGuid(); } if ( watchOptions.removeAttribute ) { @@ -110,7 +111,7 @@ type StringToJson = { let storageId: string = null!; if ( Is.definedObject( object ) ) { - storageId = Data.String.newGuid(); + storageId = Str.newGuid(); const watchOptions: WatchOptions = getWatchOptions( options ); const watch: ObserveWatch = {} as ObserveWatch; @@ -321,19 +322,19 @@ type StringToJson = { */ function getWatchOptions( newOptions: any ) : WatchOptions { - let options: WatchOptions = Data.getDefaultObject( newOptions, {} as WatchOptions ); - - options.timeout = Data.getDefaultNumber( options.timeout, 250 ); - options.starts = Data.getDefaultDate( options.starts, null! ); - options.expires = Data.getDefaultDate( options.expires, null! ); - options.reset = Data.getDefaultBoolean( options.reset, false ); - options.cancelOnChange = Data.getDefaultBoolean( options.cancelOnChange, false ); - options.maximumChangesBeforeCanceling = Data.getDefaultNumber( options.maximumChangesBeforeCanceling, 0 ); - options.pauseTimeoutOnChange = Data.getDefaultNumber( options.pauseTimeoutOnChange, 0 ); - options.propertyNames = Data.getDefaultArray( options.propertyNames, null! ); - options.allowCanceling = Data.getDefaultBoolean( options.allowCanceling, true ); - options.allowPausing = Data.getDefaultBoolean( options.allowPausing, true ); - options.removeAttribute = Data.getDefaultBoolean( options.removeAttribute, true ); + let options: WatchOptions = Default.getObject( newOptions, {} as WatchOptions ); + + options.timeout = Default.getNumber( options.timeout, 250 ); + options.starts = Default.getDate( options.starts, null! ); + options.expires = Default.getDate( options.expires, null! ); + options.reset = Default.getBoolean( options.reset, false ); + options.cancelOnChange = Default.getBoolean( options.cancelOnChange, false ); + options.maximumChangesBeforeCanceling = Default.getNumber( options.maximumChangesBeforeCanceling, 0 ); + options.pauseTimeoutOnChange = Default.getNumber( options.pauseTimeoutOnChange, 0 ); + options.propertyNames = Default.getArray( options.propertyNames, null! ); + options.allowCanceling = Default.getBoolean( options.allowCanceling, true ); + options.allowPausing = Default.getBoolean( options.allowPausing, true ); + options.removeAttribute = Default.getBoolean( options.removeAttribute, true ); options = getWatchOptionsCustomTriggers( options ); @@ -341,12 +342,12 @@ type StringToJson = { } function getWatchOptionsCustomTriggers( options: WatchOptions ) : WatchOptions { - options.events = Data.getDefaultObject( options.events, {} as WatchOptionEvents ); - options.events!.onChange = Data.getDefaultFunction( options.events!.onChange, null! ); - options.events!.onPropertyChange = Data.getDefaultFunction( options.events!.onPropertyChange, null! ); - options.events!.onCancel = Data.getDefaultFunction( options.events!.onCancel, null! ); - options.events!.onRemove = Data.getDefaultFunction( options.events!.onRemove, null! ); - options.events!.onStart = Data.getDefaultFunction( options.events!.onStart, null! ); + options.events = Default.getObject( options.events, {} as WatchOptionEvents ); + options.events!.onChange = Default.getFunction( options.events!.onChange, null! ); + options.events!.onPropertyChange = Default.getFunction( options.events!.onPropertyChange, null! ); + options.events!.onCancel = Default.getFunction( options.events!.onCancel, null! ); + options.events!.onRemove = Default.getFunction( options.events!.onRemove, null! ); + options.events!.onStart = Default.getFunction( options.events!.onStart, null! ); return options; } @@ -422,18 +423,18 @@ type StringToJson = { */ function buildDefaultConfiguration( newConfiguration: any = null ) : void { - _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration ); - _configuration.safeMode = Data.getDefaultBoolean( _configuration.safeMode, true ); - _configuration.domElementTypes = Data.getDefaultStringOrArray( _configuration.domElementTypes, [ "*" ] ); + _configuration = Default.getObject( newConfiguration, {} as Configuration ); + _configuration.safeMode = Default.getBoolean( _configuration.safeMode, true ); + _configuration.domElementTypes = Default.getStringOrArray( _configuration.domElementTypes, [ "*" ] ); buildDefaultConfigurationStrings(); } function buildDefaultConfigurationStrings() : void { - _configuration.text = Data.getDefaultObject( _configuration.text, {} as ConfigurationText ); - _configuration.text!.objectErrorText = Data.getDefaultString( _configuration.text!.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}" ); - _configuration.text!.attributeNotValidErrorText = Data.getDefaultString( _configuration.text!.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object." ); - _configuration.text!.attributeNotSetErrorText = Data.getDefaultString( _configuration.text!.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly." ); + _configuration.text = Default.getObject( _configuration.text, {} as ConfigurationText ); + _configuration.text!.objectErrorText = Default.getString( _configuration.text!.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}" ); + _configuration.text!.attributeNotValidErrorText = Default.getString( _configuration.text!.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object." ); + _configuration.text!.attributeNotSetErrorText = Default.getString( _configuration.text!.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly." ); } diff --git a/src/ts/data.ts b/src/ts/data.ts deleted file mode 100644 index c1e5d98..0000000 --- a/src/ts/data.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Observe.js - * - * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. - * - * @file data.ts - * @version v1.0.1 - * @author Bunoon - * @license MIT License - * @copyright Bunoon 2024 - */ - - -import { Char } from "./enum"; -import { Is } from "./is"; - - -export namespace Data { - export namespace String { - export function newGuid() : string { - const result: string[] = []; - - for ( let charIndex: number = 0; charIndex < 32; charIndex++ ) { - if ( charIndex === 8 || charIndex === 12 || charIndex === 16 || charIndex === 20 ) { - result.push( Char.dash ); - } - - const character: string = Math.floor( Math.random() * 16 ).toString( 16 ); - result.push( character ); - } - - return result.join( Char.empty ); - } - } - - export function getDefaultAnyString( value: any, defaultValue: string ) : string { - return typeof value === "string" ? value : defaultValue; - } - - export function getDefaultString( value: any, defaultValue: string ) : string { - return Is.definedString( value ) ? value : defaultValue; - } - - export function getDefaultBoolean( value: any, defaultValue: boolean ) : boolean { - return Is.definedBoolean( value ) ? value : defaultValue; - } - - export function getDefaultNumber( value: any, defaultValue: number ) : number { - return Is.definedNumber( value ) ? value : defaultValue; - } - - export function getDefaultFunction( value: any, defaultValue: object ) : any { - return Is.definedFunction( value ) ? value : defaultValue; - } - - export function getDefaultArray( value: any, defaultValue: any[] ) : any[] { - return Is.definedArray( value ) ? value : defaultValue; - } - - export function getDefaultObject( value: any, defaultValue: object ) : any { - return Is.definedObject( value ) ? value : defaultValue; - } - - export function getDefaultDate( value: any, defaultValue: Date ) : Date { - return Is.definedDate( value ) ? value : defaultValue; - } - - export function getDefaultStringOrArray( value: any, defaultValue: string[] ) : string[] { - let result: string[] = defaultValue; - - if ( Is.definedString( value ) ) { - const values: string[] = value.toString().split( Char.space ); - - if ( values.length === 0 ) { - value = defaultValue; - } else { - result = values; - } - - } else { - result = getDefaultArray( value, defaultValue ); - } - - return result; - } -} \ No newline at end of file diff --git a/src/ts/data/default.ts b/src/ts/data/default.ts new file mode 100644 index 0000000..fc53ae8 --- /dev/null +++ b/src/ts/data/default.ts @@ -0,0 +1,69 @@ +/** + * Observe.js + * + * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. + * + * @file data.ts + * @version v1.0.1 + * @author Bunoon + * @license MIT License + * @copyright Bunoon 2024 + */ + + +import { Char } from "./enum"; +import { Is } from "./is"; + + +export namespace Default { + export function getAnyString( value: any, defaultValue: string ) : string { + return typeof value === "string" ? value : defaultValue; + } + + export function getString( value: any, defaultValue: string ) : string { + return Is.definedString( value ) ? value : defaultValue; + } + + export function getBoolean( value: any, defaultValue: boolean ) : boolean { + return Is.definedBoolean( value ) ? value : defaultValue; + } + + export function getNumber( value: any, defaultValue: number ) : number { + return Is.definedNumber( value ) ? value : defaultValue; + } + + export function getFunction( value: any, defaultValue: object ) : any { + return Is.definedFunction( value ) ? value : defaultValue; + } + + export function getArray( value: any, defaultValue: any[] ) : any[] { + return Is.definedArray( value ) ? value : defaultValue; + } + + export function getObject( value: any, defaultValue: object ) : any { + return Is.definedObject( value ) ? value : defaultValue; + } + + export function getDate( value: any, defaultValue: Date ) : Date { + return Is.definedDate( value ) ? value : defaultValue; + } + + export function getStringOrArray( value: any, defaultValue: string[] ) : string[] { + let result: string[] = defaultValue; + + if ( Is.definedString( value ) ) { + const values: string[] = value.toString().split( Char.space ); + + if ( values.length === 0 ) { + value = defaultValue; + } else { + result = values; + } + + } else { + result = getArray( value, defaultValue ); + } + + return result; + } +} \ No newline at end of file diff --git a/src/ts/enum.ts b/src/ts/data/enum.ts similarity index 100% rename from src/ts/enum.ts rename to src/ts/data/enum.ts diff --git a/src/ts/is.ts b/src/ts/data/is.ts similarity index 100% rename from src/ts/is.ts rename to src/ts/data/is.ts diff --git a/src/ts/data/str.ts b/src/ts/data/str.ts new file mode 100644 index 0000000..eac7ad3 --- /dev/null +++ b/src/ts/data/str.ts @@ -0,0 +1,32 @@ +/** + * Observe.js + * + * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. + * + * @file str.ts + * @version v1.0.1 + * @author Bunoon + * @license MIT License + * @copyright Bunoon 2024 + */ + + +import { Char } from "./enum"; + + +export namespace Str { + export function newGuid() : string { + const result: string[] = []; + + for ( let charIndex: number = 0; charIndex < 32; charIndex++ ) { + if ( charIndex === 8 || charIndex === 12 || charIndex === 16 || charIndex === 20 ) { + result.push( Char.dash ); + } + + const character: string = Math.floor( Math.random() * 16 ).toString( 16 ); + result.push( character ); + } + + return result.join( Char.empty ); + } +} \ No newline at end of file From 562beb83feb85f6e68643cd419e0a285f6c020f7 Mon Sep 17 00:00:00 2001 From: William Troup Date: Tue, 23 Jul 2024 20:06:33 +0100 Subject: [PATCH 4/7] Moved more code. --- dist/observe.esm.js | 185 +++++++++++++++++++++++---------------- dist/observe.esm.js.map | 2 +- dist/observe.js | 132 ++++++++++++++++------------ dist/observe.js.map | 2 +- dist/observe.min.js | 2 +- src/observe.ts | 75 ++-------------- src/ts/options/config.ts | 39 +++++++++ src/ts/options/watch.ts | 51 +++++++++++ 8 files changed, 285 insertions(+), 203 deletions(-) create mode 100644 src/ts/options/config.ts create mode 100644 src/ts/options/watch.ts diff --git a/dist/observe.esm.js b/dist/observe.esm.js index b3e062b..056b5dd 100644 --- a/dist/observe.esm.js +++ b/dist/observe.esm.js @@ -54,14 +54,14 @@ var init_is = __esm({ return t(e) && typeof e === "function"; } e.definedFunction = i; - function a(e) { + function s(e) { return t(e) && typeof e === "number"; } - e.definedNumber = a; - function s(e) { + e.definedNumber = s; + function a(e) { return n(e) && e instanceof Array; } - e.definedArray = s; + e.definedArray = a; function c(e) { return n(e) && e instanceof Date; } @@ -70,6 +70,29 @@ var init_is = __esm({ } }); +var Str; + +var init_str = __esm({ + "src/ts/data/str.ts"() { + "use strict"; + init_enum(); + (e => { + function t() { + const e = []; + for (let t = 0; t < 32; t++) { + if (t === 8 || t === 12 || t === 16 || t === 20) { + e.push("-"); + } + const n = Math.floor(Math.random() * 16).toString(16); + e.push(n); + } + return e.join(""); + } + e.newGuid = t; + })(Str || (Str = {})); + } +}); + var Default; var init_default = __esm({ @@ -98,14 +121,14 @@ var init_default = __esm({ return Is.definedFunction(e) ? e : t; } e.getFunction = i; - function a(e, t) { + function s(e, t) { return Is.definedArray(e) ? e : t; } - e.getArray = a; - function s(e, t) { + e.getArray = s; + function a(e, t) { return Is.definedObject(e) ? e : t; } - e.getObject = s; + e.getObject = a; function c(e, t) { return Is.definedDate(e) ? e : t; } @@ -120,7 +143,7 @@ var init_default = __esm({ n = r; } } else { - n = a(e, t); + n = s(e, t); } return n; } @@ -129,36 +152,83 @@ var init_default = __esm({ } }); -var Str; +var Config; -var init_str = __esm({ - "src/ts/data/str.ts"() { +var init_config = __esm({ + "src/ts/options/config.ts"() { "use strict"; - init_enum(); + init_default(); (e => { - function t() { - const e = []; - for (let t = 0; t < 32; t++) { - if (t === 8 || t === 12 || t === 16 || t === 20) { - e.push("-"); - } - const n = Math.floor(Math.random() * 16).toString(16); - e.push(n); + let t; + (e => { + function t(e = null) { + let t = Default.getObject(e, {}); + t.safeMode = Default.getBoolean(t.safeMode, true); + t.domElementTypes = Default.getStringOrArray(t.domElementTypes, [ "*" ]); + t = n(t); + return t; } - return e.join(""); - } - e.newGuid = t; - })(Str || (Str = {})); + e.get = t; + function n(e) { + e.text = Default.getObject(e.text, {}); + e.text.objectErrorText = Default.getString(e.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}"); + e.text.attributeNotValidErrorText = Default.getString(e.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object."); + e.text.attributeNotSetErrorText = Default.getString(e.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly."); + return e; + } + })(t = e.Options || (e.Options = {})); + })(Config || (Config = {})); + } +}); + +var Watch; + +var init_watch = __esm({ + "src/ts/options/watch.ts"() { + "use strict"; + init_default(); + (e => { + let t; + (e => { + function t(e) { + let t = Default.getObject(e, {}); + t.timeout = Default.getNumber(t.timeout, 250); + t.starts = Default.getDate(t.starts, null); + t.expires = Default.getDate(t.expires, null); + t.reset = Default.getBoolean(t.reset, false); + t.cancelOnChange = Default.getBoolean(t.cancelOnChange, false); + t.maximumChangesBeforeCanceling = Default.getNumber(t.maximumChangesBeforeCanceling, 0); + t.pauseTimeoutOnChange = Default.getNumber(t.pauseTimeoutOnChange, 0); + t.propertyNames = Default.getArray(t.propertyNames, null); + t.allowCanceling = Default.getBoolean(t.allowCanceling, true); + t.allowPausing = Default.getBoolean(t.allowPausing, true); + t.removeAttribute = Default.getBoolean(t.removeAttribute, true); + t = n(t); + return t; + } + e.get = t; + function n(e) { + e.events = Default.getObject(e.events, {}); + e.events.onChange = Default.getFunction(e.events.onChange, null); + e.events.onPropertyChange = Default.getFunction(e.events.onPropertyChange, null); + e.events.onCancel = Default.getFunction(e.events.onCancel, null); + e.events.onRemove = Default.getFunction(e.events.onRemove, null); + e.events.onStart = Default.getFunction(e.events.onStart, null); + return e; + } + })(t = e.Options || (e.Options = {})); + })(Watch || (Watch = {})); } }); var require_observe = __commonJS({ "src/observe.ts"(exports, module) { init_constant(); - init_default(); init_enum(); init_is(); init_str(); + init_config(); + init_watch(); (() => { let _configuration = {}; const _watches = {}; @@ -184,7 +254,7 @@ var require_observe = __commonJS({ if (Is.definedString(n)) { const r = getObjectFromString(n); if (r.parsed && Is.definedObject(r.object)) { - const t = getWatchOptions(r.object); + const t = Watch.Options.get(r.object); if (!Is.definedString(e.id)) { e.id = Str.newGuid(); } @@ -207,9 +277,9 @@ var require_observe = __commonJS({ let r = null; if (Is.definedObject(e)) { r = Str.newGuid(); - const o = getWatchOptions(t); + const o = Watch.Options.get(t); const i = {}; - let a = null; + let s = null; i.options = o; i.totalChanges = 0; if (Is.definedString(n)) { @@ -218,15 +288,15 @@ var require_observe = __commonJS({ i.domElementId = n; i.cachedObject = e.outerHTML; i.originalObject = e.outerHTML; - a = e.outerHTML; + s = e.outerHTML; } } else { i.cachedObject = JSON.stringify(e); i.originalObject = e; - a = e; + s = e; } if (Is.defined(i.cachedObject)) { - fireCustomTriggerEvent(i.options.events.onStart, a); + fireCustomTriggerEvent(i.options.events.onStart, s); i.timer = setInterval((function() { watchTimer(o, r); }), o.timeout); @@ -260,8 +330,8 @@ var require_observe = __commonJS({ } const o = t.cachedObject; const i = t.originalObject; - const a = !n ? JSON.stringify(i) : i; - if (o !== a) { + const s = !n ? JSON.stringify(i) : i; + if (o !== s) { if (t.options.reset) { if (n) { r.outerHTML = t.cachedObject; @@ -269,13 +339,13 @@ var require_observe = __commonJS({ t.originalObject = getObjectFromString(o).object; } } else { - t.cachedObject = a; + t.cachedObject = s; } if (n) { - fireCustomTriggerEvent(t.options.events.onChange, o, a); + fireCustomTriggerEvent(t.options.events.onChange, o, s); } else { const e = getObjectFromString(o).object; - const n = getObjectFromString(a).object; + const n = getObjectFromString(s).object; if (!Is.definedArray(e) && !Is.definedArray(n)) { compareWatchObject(e, n, t); if (Is.definedFunction(t.options.events.onPropertyChange)) { @@ -361,31 +431,6 @@ var require_observe = __commonJS({ } return n; } - function getWatchOptions(e) { - let t = Default.getObject(e, {}); - t.timeout = Default.getNumber(t.timeout, 250); - t.starts = Default.getDate(t.starts, null); - t.expires = Default.getDate(t.expires, null); - t.reset = Default.getBoolean(t.reset, false); - t.cancelOnChange = Default.getBoolean(t.cancelOnChange, false); - t.maximumChangesBeforeCanceling = Default.getNumber(t.maximumChangesBeforeCanceling, 0); - t.pauseTimeoutOnChange = Default.getNumber(t.pauseTimeoutOnChange, 0); - t.propertyNames = Default.getArray(t.propertyNames, null); - t.allowCanceling = Default.getBoolean(t.allowCanceling, true); - t.allowPausing = Default.getBoolean(t.allowPausing, true); - t.removeAttribute = Default.getBoolean(t.removeAttribute, true); - t = getWatchOptionsCustomTriggers(t); - return t; - } - function getWatchOptionsCustomTriggers(e) { - e.events = Default.getObject(e.events, {}); - e.events.onChange = Default.getFunction(e.events.onChange, null); - e.events.onPropertyChange = Default.getFunction(e.events.onPropertyChange, null); - e.events.onCancel = Default.getFunction(e.events.onCancel, null); - e.events.onRemove = Default.getFunction(e.events.onRemove, null); - e.events.onStart = Default.getFunction(e.events.onStart, null); - return e; - } function fireCustomTriggerEvent(e, ...t) { if (Is.definedFunction(e)) { e.apply(null, [].slice.call(t, 0)); @@ -424,18 +469,6 @@ var require_observe = __commonJS({ } return t; } - function buildDefaultConfiguration(e = null) { - _configuration = Default.getObject(e, {}); - _configuration.safeMode = Default.getBoolean(_configuration.safeMode, true); - _configuration.domElementTypes = Default.getStringOrArray(_configuration.domElementTypes, [ "*" ]); - buildDefaultConfigurationStrings(); - } - function buildDefaultConfigurationStrings() { - _configuration.text = Default.getObject(_configuration.text, {}); - _configuration.text.objectErrorText = Default.getString(_configuration.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}"); - _configuration.text.attributeNotValidErrorText = Default.getString(_configuration.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object."); - _configuration.text.attributeNotSetErrorText = Default.getString(_configuration.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly."); - } const _public = { watch: function(e, t) { return createWatch(e, t); @@ -548,7 +581,7 @@ var require_observe = __commonJS({ } } if (t) { - buildDefaultConfiguration(n); + _configuration = Config.Options.get(n); } } return _public; @@ -558,7 +591,7 @@ var require_observe = __commonJS({ } }; (() => { - buildDefaultConfiguration(); + _configuration = Config.Options.get(); document.addEventListener("DOMContentLoaded", (function() { collectDOMObjects(); })); diff --git a/dist/observe.esm.js.map b/dist/observe.esm.js.map index 59c92ef..1623840 100644 --- a/dist/observe.esm.js.map +++ b/dist/observe.esm.js.map @@ -1 +1 @@ -{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.esm.js"],"names":["__getOwnPropNames","Object","getOwnPropertyNames","__esm","fn","res","__init","__commonJS","cb","mod","__require","exports","Constant","init_constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","init_enum","Is","init_is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Default","init_default","Default2","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","result2","values","split","length","Str","init_str","Str2","newGuid","charIndex","push","character","Math","floor","random","join","require_observe","module","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","domElementTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","slice","call","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","getWatchOptions","id","removeAttribute","createWatch","logError","text","attributeNotValidErrorText","replace","attributeNotSetErrorText","options","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","fireCustomTriggerEvent","events","onStart","timer","setInterval","watchTimer","timeout","currentDateTime","starts","watchObjectForChanges","expires","cancelWatchObject","hasOwnProperty","isDomElement","onRemove","originalObjectJson","reset","onChange","oldValue","newValue","compareWatchObject","onPropertyChange","compareWatchObjectProperties","pauseTimeoutOnChange","pauseWatchObject","cancelOnChange","maximumChangesBeforeCanceling","oldObject","newObject","propertyNames","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","allowCanceling","onCancel","clearInterval","milliseconds","allowPausing","setMilliseconds","getMilliseconds","newOptions","getWatchOptionsCustomTriggers","triggerFunction","args","apply","objectString","result","parse","e1","eval","e2","safeMode","objectErrorText","message","error","console","buildDefaultConfiguration","newConfiguration","buildDefaultConfigurationStrings","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA,IAAIA,oBAAoBC,OAAOC;;AAC/B,IAAIC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iB7B;gCAC1D0C,IAA0B;AAC5B;AACF;wBACA,IAAIA,GAAyB;4BAC3Bd,0BAA0Be;AAC5B;AACF;oBACA,OAAOZ;AACT;gBAMAa,YAAY;oBACV,OAAO;AACT;;YAEF;gBACEhB;gBACAlG,SAASmH,iBAAiB,qBAAoB;oBAC5CzH;AACF;gBACA0H,OAAOD,iBAAiB,aAAY;oBAClC1H,kBAAkB;oBAClBiF;AACF;gBACA,KAAKjI,GAAGG,QAAQwK,OAAOC,WAAW;oBAChCD,OAAOC,WAAWhB;AACpB;AACD,cAZD;AAaD,UA1aD;AA2aF;;;eAEahH","sourcesContent":[null]} \ No newline at end of file +{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.esm.js"],"names":["__getOwnPropNames","Object","getOwnPropertyNames","__esm","fn","res","__init","__commonJS","cb","mod","__require","exports","Constant","init_constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","init_enum","Is","init_is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Str","init_str","Str2","newGuid","result2","charIndex","push","character","Math","floor","random","join","Default","init_default","Default2","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","values","split","length","Config","init_config","Config2","Options","Options2","get","newConfiguration","configuration","safeMode","domElementTypes","getText","text","objectErrorText","attributeNotValidErrorText","attributeNotSetErrorText","Watch","init_watch","Watch2","newOptions","options","timeout","starts","expires","reset","cancelOnChange","maximumChangesBeforeCanceling","pauseTimeoutOnChange","propertyNames","allowCanceling","allowPausing","removeAttribute","getEvents","events","onChange","onPropertyChange","onCancel","onRemove","onStart","require_observe","module","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","slice","call","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","id","createWatch","logError","replace","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","fireCustomTriggerEvent","timer","setInterval","watchTimer","currentDateTime","watchObjectForChanges","cancelWatchObject","hasOwnProperty","isDomElement","originalObjectJson","oldValue","newValue","compareWatchObject","compareWatchObjectProperties","pauseWatchObject","oldObject","newObject","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","clearInterval","milliseconds","setMilliseconds","getMilliseconds","triggerFunction","args","apply","objectString","result","parse","e1","eval","e2","message","error","console","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA,IAAIA,oBAAoBC,OAAOC;;AAC/B,IAAIC,QAAQ,CAACC,GAAIC,MAAQ,SAASC;IAChC,OAAOF,MAAOC,KAAO,GAAGD,EAAGJ,kBAAkBI,GAAI,KAAKA,IAAK,KAAKC;AAClE;;AACA,IAAIE,aAAa,CAACC,GAAIC,MAAQ,SAASC;IACrC,OAAOD,MAAQ,GAAGD,EAAGR,kBAAkBQ,GAAI,MAAMC,IAAM;QAAEE,SAAS,CAAC;OAAKA,SAASF,IAAMA,EAAIE;AAC7F;;AAGA,IAAIC;;AACJ,IAAIC,gBAAgBV,MAAM;IACxB;QACE;QACA,CAAEW;YACAA,EAAUC,4BAA4B;AACvC,UAFD,CAEGH,aAAaA,WAAW,CAAC;AAC9B;;;AAIF,IAAII,YAAYb,MAAM;IACpB;QACE;AACF;;;AAIF,IAAIc;;AACJ,IAAIC,UAAUf,MAAM;IAClB;QACE;QACAa;QACA,CAAEG;YACA,SAASC,EAAQC;gBACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;YACAH,EAAIC,UAAUA;YACd,SAASG,EAAcC;gBACrB,OAAOJ,EAAQI,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BACA,OAAOZ;AACT;gBAMAa,YAAY;oBACV,OAAO;AACT;;YAEF;gBACE7F,iBAAiBxC,OAAOG,QAAQE;gBAChC2C,SAASsF,iBAAiB,qBAAoB;oBAC5C3F;AACF;gBACA4F,OAAOD,iBAAiB,aAAY;oBAClC5F,kBAAkB;oBAClB6D;AACF;gBACA,KAAKnJ,GAAGG,QAAQgL,OAAOC,WAAW;oBAChCD,OAAOC,WAAWhB;AACpB;AACD,cAZD;AAaD,UArYD;AAsYF;;;eAEalF","sourcesContent":[null]} \ No newline at end of file diff --git a/dist/observe.js b/dist/observe.js index 03aacaa..e6f8906 100644 --- a/dist/observe.js +++ b/dist/observe.js @@ -43,6 +43,23 @@ var Is; e.definedDate = s; })(Is || (Is = {})); +var Str; + +(e => { + function t() { + const e = []; + for (let t = 0; t < 32; t++) { + if (t === 8 || t === 12 || t === 16 || t === 20) { + e.push("-"); + } + const n = Math.floor(Math.random() * 16).toString(16); + e.push(n); + } + return e.join(""); + } + e.newGuid = t; +})(Str || (Str = {})); + var Default; (e => { @@ -78,7 +95,7 @@ var Default; return Is.definedDate(e) ? e : t; } e.getDate = s; - function u(e, t) { + function l(e, t) { let n = t; if (Is.definedString(e)) { const r = e.toString().split("space"); @@ -92,25 +109,65 @@ var Default; } return n; } - e.getStringOrArray = u; + e.getStringOrArray = l; })(Default || (Default = {})); -var Str; +var Config; (e => { - function t() { - const e = []; - for (let t = 0; t < 32; t++) { - if (t === 8 || t === 12 || t === 16 || t === 20) { - e.push("-"); - } - const n = Math.floor(Math.random() * 16).toString(16); - e.push(n); + let t; + (e => { + function t(e = null) { + let t = Default.getObject(e, {}); + t.safeMode = Default.getBoolean(t.safeMode, true); + t.domElementTypes = Default.getStringOrArray(t.domElementTypes, [ "*" ]); + t = n(t); + return t; } - return e.join(""); - } - e.newGuid = t; -})(Str || (Str = {})); + e.get = t; + function n(e) { + e.text = Default.getObject(e.text, {}); + e.text.objectErrorText = Default.getString(e.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}"); + e.text.attributeNotValidErrorText = Default.getString(e.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object."); + e.text.attributeNotSetErrorText = Default.getString(e.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly."); + return e; + } + })(t = e.Options || (e.Options = {})); +})(Config || (Config = {})); + +var Watch; + +(e => { + let t; + (e => { + function t(e) { + let t = Default.getObject(e, {}); + t.timeout = Default.getNumber(t.timeout, 250); + t.starts = Default.getDate(t.starts, null); + t.expires = Default.getDate(t.expires, null); + t.reset = Default.getBoolean(t.reset, false); + t.cancelOnChange = Default.getBoolean(t.cancelOnChange, false); + t.maximumChangesBeforeCanceling = Default.getNumber(t.maximumChangesBeforeCanceling, 0); + t.pauseTimeoutOnChange = Default.getNumber(t.pauseTimeoutOnChange, 0); + t.propertyNames = Default.getArray(t.propertyNames, null); + t.allowCanceling = Default.getBoolean(t.allowCanceling, true); + t.allowPausing = Default.getBoolean(t.allowPausing, true); + t.removeAttribute = Default.getBoolean(t.removeAttribute, true); + t = n(t); + return t; + } + e.get = t; + function n(e) { + e.events = Default.getObject(e.events, {}); + e.events.onChange = Default.getFunction(e.events.onChange, null); + e.events.onPropertyChange = Default.getFunction(e.events.onPropertyChange, null); + e.events.onCancel = Default.getFunction(e.events.onCancel, null); + e.events.onRemove = Default.getFunction(e.events.onRemove, null); + e.events.onStart = Default.getFunction(e.events.onStart, null); + return e; + } + })(t = e.Options || (e.Options = {})); +})(Watch || (Watch = {})); (() => { let _configuration = {}; @@ -137,7 +194,7 @@ var Str; if (Is.definedString(n)) { const r = getObjectFromString(n); if (r.parsed && Is.definedObject(r.object)) { - const t = getWatchOptions(r.object); + const t = Watch.Options.get(r.object); if (!Is.definedString(e.id)) { e.id = Str.newGuid(); } @@ -160,7 +217,7 @@ var Str; let r = null; if (Is.definedObject(e)) { r = Str.newGuid(); - const o = getWatchOptions(t); + const o = Watch.Options.get(t); const i = {}; let a = null; i.options = o; @@ -314,31 +371,6 @@ var Str; } return n; } - function getWatchOptions(e) { - let t = Default.getObject(e, {}); - t.timeout = Default.getNumber(t.timeout, 250); - t.starts = Default.getDate(t.starts, null); - t.expires = Default.getDate(t.expires, null); - t.reset = Default.getBoolean(t.reset, false); - t.cancelOnChange = Default.getBoolean(t.cancelOnChange, false); - t.maximumChangesBeforeCanceling = Default.getNumber(t.maximumChangesBeforeCanceling, 0); - t.pauseTimeoutOnChange = Default.getNumber(t.pauseTimeoutOnChange, 0); - t.propertyNames = Default.getArray(t.propertyNames, null); - t.allowCanceling = Default.getBoolean(t.allowCanceling, true); - t.allowPausing = Default.getBoolean(t.allowPausing, true); - t.removeAttribute = Default.getBoolean(t.removeAttribute, true); - t = getWatchOptionsCustomTriggers(t); - return t; - } - function getWatchOptionsCustomTriggers(e) { - e.events = Default.getObject(e.events, {}); - e.events.onChange = Default.getFunction(e.events.onChange, null); - e.events.onPropertyChange = Default.getFunction(e.events.onPropertyChange, null); - e.events.onCancel = Default.getFunction(e.events.onCancel, null); - e.events.onRemove = Default.getFunction(e.events.onRemove, null); - e.events.onStart = Default.getFunction(e.events.onStart, null); - return e; - } function fireCustomTriggerEvent(e, ...t) { if (Is.definedFunction(e)) { e.apply(null, [].slice.call(t, 0)); @@ -377,18 +409,6 @@ var Str; } return t; } - function buildDefaultConfiguration(e = null) { - _configuration = Default.getObject(e, {}); - _configuration.safeMode = Default.getBoolean(_configuration.safeMode, true); - _configuration.domElementTypes = Default.getStringOrArray(_configuration.domElementTypes, [ "*" ]); - buildDefaultConfigurationStrings(); - } - function buildDefaultConfigurationStrings() { - _configuration.text = Default.getObject(_configuration.text, {}); - _configuration.text.objectErrorText = Default.getString(_configuration.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}"); - _configuration.text.attributeNotValidErrorText = Default.getString(_configuration.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object."); - _configuration.text.attributeNotSetErrorText = Default.getString(_configuration.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly."); - } const _public = { watch: function(e, t) { return createWatch(e, t); @@ -501,7 +521,7 @@ var Str; } } if (t) { - buildDefaultConfiguration(n); + _configuration = Config.Options.get(n); } } return _public; @@ -511,7 +531,7 @@ var Str; } }; (() => { - buildDefaultConfiguration(); + _configuration = Config.Options.get(); document.addEventListener("DOMContentLoaded", (function() { collectDOMObjects(); })); diff --git a/dist/observe.js.map b/dist/observe.js.map index 0fc8254..d71770d 100644 --- a/dist/observe.js.map +++ b/dist/observe.js.map @@ -1 +1 @@ -{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.js"],"names":["Constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Default","Default2","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","result2","values","split","length","Str","Str2","newGuid","charIndex","push","character","Math","floor","random","join","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","domElementTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","slice","call","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","getWatchOptions","id","removeAttribute","createWatch","logError","text","attributeNotValidErrorText","replace","attributeNotSetErrorText","options","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","fireCustomTriggerEvent","events","onStart","timer","setInterval","watchTimer","timeout","currentDateTime","starts","watchObjectForChanges","expires","cancelWatchObject","hasOwnProperty","isDomElement","onRemove","originalObjectJson","reset","onChange","oldValue","newValue","compareWatchObject","onPropertyChange","compareWatchObjectProperties","pauseTimeoutOnChange","pauseWatchObject","cancelOnChange","maximumChangesBeforeCanceling","oldObject","newObject","propertyNames","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","allowCanceling","onCancel","clearInterval","milliseconds","allowPausing","setMilliseconds","getMilliseconds","newOptions","getWatchOptionsCustomTriggers","triggerFunction","args","apply","objectString","result","parse","e1","eval","e2","safeMode","objectErrorText","message","error","console","buildDefaultConfiguration","newConfiguration","buildDefaultConfigurationStrings","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA;;AAGA,IAAIA;;AACJ,CAAEC;IACAA,EAAUC,4BAA4B;AACvC,EAFD,CAEGF,aAAaA,WAAW,CAAC;;AAG5B,IAAIG;;AACJ,CAAEC;IACA,SAASC,EAAQC;QACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;IACAH,EAAIC,UAAUA;IACd,SAASG,EAAcC;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAII,gBAAgBA;IACpB,SAASE,EAAeD;QACtB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIM,iBAAiBA;IACrB,SAASC,EAAcF;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIO,gBAAgBA;IACpB,SAASC,EAAgBH;QACvB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIQ,kBAAkBA;IACtB,SAASC,EAAcJ;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIS,gBAAgBA;IACpB,SAASC,EAAaL;QACpB,OAAOD,EAAcC,MAAWA,aAAkBM;AACpD;IACAX,EAAIU,eAAeA;IACnB,SAASE,EAAYP;QACnB,OAAOD,EAAcC,MAAWA,aAAkBQ;AACpD;IACAb,EAAIY,cAAcA;AACnB,EAjCD,CAiCGb,OAAOA,KAAK,CAAC;;AAGhB,IAAIe;;AACJ,CAAEC;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;oBAC9BrE,IAAU;AACZ,uBAAO;oBACL,KAAK,IAAIkD,KAAanC,UAAU;wBAC9B,IAAIA,SAAS0D,eAAevB,MAAc7E,GAAGQ,cAAckC,SAASmC,GAAWD,iBAAiBlC,SAASmC,GAAWD,iBAAiBT,GAAI;4BACvIzB,SAASmC,GAAWF,QAAQqB,SAAS;4BACrCrE,IAAU;4BACV;AACF;AACF;AACF;AACF;YACA,OAAOA;AACT;QACAoI,eAAe;YACb,KAAK,IAAIlF,KAAanC,UAAU;gBAC9B,IAAIA,SAAS0D,eAAevB,IAAY;oBACtCnC,SAASmC,GAAWF,QAAQqB,SAAS;AACvC;AACF;YACA,OAAOuD;AACT;QACAS,wBAAwB;YACtBpH;YACA,OAAO2G;AACT;QAMAU,kBAAkB,SAASZ;YACzB,IAAIrJ,GAAGK,cAAcgJ,IAAmB;gBACtC,IAAIa,IAA0B;gBAC9B,MAAMC,IAA2B1H;gBACjC,KAAK,IAAI+E,KAAgB6B,GAAkB;oBACzC,IAAIA,EAAiBjD,eAAeoB,MAAiB/E,eAAe2D,eAAeoB,MAAiB2C,EAAyB3C,OAAkB6B,EAAiB7B,IAAe;wBAC7K2C,EAAyB3C,KAAgB6B,EAAiB7B;wBAC1D0C,IAA0B;AAC5B;AACF;gBACA,IAAIA,GAAyB;oBAC3Bd,0BAA0Be;AAC5B;AACF;YACA,OAAOZ;AACT;QAMAa,YAAY;YACV,OAAO;AACT;;IAEF;QACEhB;QACAlG,SAASmH,iBAAiB,qBAAoB;YAC5CzH;AACF;QACA0H,OAAOD,iBAAiB,aAAY;YAClC1H,kBAAkB;YAClBiF;AACF;QACA,KAAK5H,GAAGE,QAAQoK,OAAOC,WAAW;YAChCD,OAAOC,WAAWhB;AACpB;AACD,MAZD;AAaD,EA1aD","sourcesContent":[null]} \ No newline at end of file +{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.js"],"names":["Constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Str","Str2","newGuid","result2","charIndex","push","character","Math","floor","random","join","Default","Default2","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","values","split","length","Config","Config2","Options","Options2","get","newConfiguration","configuration","safeMode","domElementTypes","getText","text","objectErrorText","attributeNotValidErrorText","attributeNotSetErrorText","Watch","Watch2","newOptions","options","timeout","starts","expires","reset","cancelOnChange","maximumChangesBeforeCanceling","pauseTimeoutOnChange","propertyNames","allowCanceling","allowPausing","removeAttribute","getEvents","events","onChange","onPropertyChange","onCancel","onRemove","onStart","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","slice","call","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","id","createWatch","logError","replace","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","fireCustomTriggerEvent","timer","setInterval","watchTimer","currentDateTime","watchObjectForChanges","cancelWatchObject","hasOwnProperty","isDomElement","originalObjectJson","oldValue","newValue","compareWatchObject","compareWatchObjectProperties","pauseWatchObject","oldObject","newObject","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","clearInterval","milliseconds","setMilliseconds","getMilliseconds","triggerFunction","args","apply","objectString","result","parse","e1","eval","e2","message","error","console","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA;;AAGA,IAAIA;;AACJ,CAAEC;IACAA,EAAUC,4BAA4B;AACvC,EAFD,CAEGF,aAAaA,WAAW,CAAC;;AAG5B,IAAIG;;A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,IAAU;AACZ,uBAAO;oBACL,KAAK,IAAIwF,KAAa5B,UAAU;wBAC9B,IAAIA,SAAS8C,eAAelB,MAAc1G,GAAGQ,cAAcsE,SAAS4B,GAAWD,iBAAiB3B,SAAS4B,GAAWD,iBAAiBJ,GAAI;4BACvIvB,SAAS4B,GAAWhD,QAAQE,SAAS;4BACrC1C,IAAU;4BACV;AACF;AACF;AACF;AACF;YACA,OAAOA;AACT;QACAmJ,eAAe;YACb,KAAK,IAAI3D,KAAa5B,UAAU;gBAC9B,IAAIA,SAAS8C,eAAelB,IAAY;oBACtC5B,SAAS4B,GAAWhD,QAAQE,SAAS;AACvC;AACF;YACA,OAAOiG;AACT;QACAS,wBAAwB;YACtBtF;YACA,OAAO6E;AACT;QAMAU,kBAAkB,SAASzH;YACzB,IAAI9C,GAAGK,cAAcyC,IAAmB;gBACtC,IAAI0H,IAA0B;gBAC9B,MAAMC,IAA2B5F;gBACjC,KAAK,IAAI2D,KAAgB1F,GAAkB;oBACzC,IAAIA,EAAiB8E,eAAeY,MAAiB3D,eAAe+C,eAAeY,MAAiBiC,EAAyBjC,OAAkB1F,EAAiB0F,IAAe;wBAC7KiC,EAAyBjC,KAAgB1F,EAAiB0F;wBAC1DgC,IAA0B;AAC5B;AACF;gBACA,IAAIA,GAAyB;oBAC3B3F,iBAAiBpC,OAAOE,QAAQE,IAAI4H;AACtC;AACF;YACA,OAAOZ;AACT;QAMAa,YAAY;YACV,OAAO;AACT;;IAEF;QACE7F,iBAAiBpC,OAAOE,QAAQE;QAChCwC,SAASsF,iBAAiB,qBAAoB;YAC5C3F;AACF;QACA4F,OAAOD,iBAAiB,aAAY;YAClC5F,kBAAkB;YAClB6D;AACF;QACA,KAAK5I,GAAGE,QAAQ0K,OAAOC,WAAW;YAChCD,OAAOC,WAAWhB;AACpB;AACD,MAZD;AAaD,EArYD","sourcesContent":[null]} \ No newline at end of file diff --git a/dist/observe.min.js b/dist/observe.min.js index 7e6fbb5..60b6850 100644 --- a/dist/observe.min.js +++ b/dist/observe.min.js @@ -1 +1 @@ -"use strict";var Constant,Is,Default,Str;(Constant||(Constant={})).OBSERVE_JS_ATTRIBUTE_NAME="data-observe-js",(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=function(e){return n(e)&&e instanceof Array},e.definedDate=function(e){return n(e)&&e instanceof Date}})(Is||(Is={})),(e=>{function t(e,t){return Is.definedArray(e)?e:t}e.getAnyString=function(e,t){return"string"==typeof e?e:t},e.getString=function(e,t){return Is.definedString(e)?e:t},e.getBoolean=function(e,t){return Is.definedBoolean(e)?e:t},e.getNumber=function(e,t){return Is.definedNumber(e)?e:t},e.getFunction=function(e,t){return Is.definedFunction(e)?e:t},e.getArray=t,e.getObject=function(e,t){return Is.definedObject(e)?e:t},e.getDate=function(e,t){return Is.definedDate(e)?e:t},e.getStringOrArray=function(e,n){let r=n;if(Is.definedString(e)){const t=e.toString().split("space");0===t.length?e=n:r=t}else r=t(e,n);return r}})(Default||(Default={})),(Str||(Str={})).newGuid=function(){const e=[];for(let t=0;t<32;t++){8!==t&&12!==t&&16!==t&&20!==t||e.push("-");const n=Math.floor(16*Math.random()).toString(16);e.push(n)}return e.join("")},(()=>{let _configuration={};const _watches={};let _watches_Cancel=!1;function collectDOMObjects(){const e=_configuration.domElementTypes,t=e.length;for(let n=0;n=e.starts)&&(watchObjectForChanges(t),Is.definedDate(e.expires)&&n>=e.expires&&cancelWatchObject(t))}function watchObjectForChanges(e){if(_watches.hasOwnProperty(e)){const t=_watches[e],n=Is.definedString(t.domElementId);let r=null;n&&(r=document.getElementById(t.domElementId),Is.defined(r)?t.originalObject=r.outerHTML:(t.originalObject="",fireCustomTriggerEvent(t.options.events.onRemove,t.domElementId)));const o=t.cachedObject,i=t.originalObject,a=n?i:JSON.stringify(i);if(o!==a){if(t.options.reset?n?r.outerHTML=t.cachedObject:t.originalObject=getObjectFromString(o).object:t.cachedObject=a,n)fireCustomTriggerEvent(t.options.events.onChange,o,a);else{const e=getObjectFromString(o).object,n=getObjectFromString(a).object;Is.definedArray(e)||Is.definedArray(n)?fireCustomTriggerEvent(t.options.events.onChange,e,n):(compareWatchObject(e,n,t),Is.definedFunction(t.options.events.onPropertyChange)&&compareWatchObjectProperties(e,n,t))}t.totalChanges++,t.options.pauseTimeoutOnChange>0&&pauseWatchObject(e,t.options.pauseTimeoutOnChange),t.options.cancelOnChange&&cancelWatchObject(e),t.options.maximumChangesBeforeCanceling>0&&t.totalChanges>=t.options.maximumChangesBeforeCanceling&&cancelWatchObject(e)}}}function compareWatchObject(e,t,n){if(Is.definedArray(n.options.propertyNames)){const r=n.options.propertyNames.length;for(let o=0;o-1)&&JSON.stringify(o)!==JSON.stringify(i)&&fireCustomTriggerEvent(n.options.events.onPropertyChange,r,o,i)}}function cancelWatchesForObjects(){for(let e in _watches)_watches.hasOwnProperty(e)&&cancelWatchObject(e)}function cancelWatchObject(e){if(_watches.hasOwnProperty(e)){const t=_watches[e].options;(t.allowCanceling||_watches_Cancel)&&(fireCustomTriggerEvent(t.events.onCancel,e),clearInterval(_watches[e].timer),delete _watches[e])}}function pauseWatchObject(e,t){let n=!1;if(_watches.hasOwnProperty(e)){const r=_watches[e].options;r.allowPausing&&(r.starts=new Date,r.starts.setMilliseconds(r.starts.getMilliseconds()+t),n=!0)}return n}function getWatchOptions(e){let t=Default.getObject(e,{});return t.timeout=Default.getNumber(t.timeout,250),t.starts=Default.getDate(t.starts,null),t.expires=Default.getDate(t.expires,null),t.reset=Default.getBoolean(t.reset,!1),t.cancelOnChange=Default.getBoolean(t.cancelOnChange,!1),t.maximumChangesBeforeCanceling=Default.getNumber(t.maximumChangesBeforeCanceling,0),t.pauseTimeoutOnChange=Default.getNumber(t.pauseTimeoutOnChange,0),t.propertyNames=Default.getArray(t.propertyNames,null),t.allowCanceling=Default.getBoolean(t.allowCanceling,!0),t.allowPausing=Default.getBoolean(t.allowPausing,!0),t.removeAttribute=Default.getBoolean(t.removeAttribute,!0),t=getWatchOptionsCustomTriggers(t),t}function getWatchOptionsCustomTriggers(e){return e.events=Default.getObject(e.events,{}),e.events.onChange=Default.getFunction(e.events.onChange,null),e.events.onPropertyChange=Default.getFunction(e.events.onPropertyChange,null),e.events.onCancel=Default.getFunction(e.events.onCancel,null),e.events.onRemove=Default.getFunction(e.events.onRemove,null),e.events.onStart=Default.getFunction(e.events.onStart,null),e}function fireCustomTriggerEvent(e,...t){Is.definedFunction(e)&&e.apply(null,[].slice.call(t,0))}function getObjectFromString(objectString){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval(`(${objectString})`),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){_configuration.safeMode||(logError(_configuration.text.objectErrorText.replace("{{error_1}}",e1.message).replace("{{error_2}}",e.message)),result.parsed=!1),result.object=null}}return result}function logError(e){let t=!0;return _configuration.safeMode||(console.error(e),t=!1),t}function buildDefaultConfiguration(e=null){_configuration=Default.getObject(e,{}),_configuration.safeMode=Default.getBoolean(_configuration.safeMode,!0),_configuration.domElementTypes=Default.getStringOrArray(_configuration.domElementTypes,["*"]),buildDefaultConfigurationStrings()}function buildDefaultConfigurationStrings(){_configuration.text=Default.getObject(_configuration.text,{}),_configuration.text.objectErrorText=Default.getString(_configuration.text.objectErrorText,"Errors in object: {{error_1}}, {{error_2}}"),_configuration.text.attributeNotValidErrorText=Default.getString(_configuration.text.attributeNotValidErrorText,"The attribute '{{attribute_name}}' is not a valid object."),_configuration.text.attributeNotSetErrorText=Default.getString(_configuration.text.attributeNotSetErrorText,"The attribute '{{attribute_name}}' has not been set correctly.")}const _public={watch:function(e,t){return createWatch(e,t)},cancelWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))cancelWatchObject(e),t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){cancelWatchObject(n),t=!0;break}return t},cancelWatches:function(){return cancelWatchesForObjects(),_public},getWatch:function(e){let t=null;if(Is.definedString(e))if(_watches.hasOwnProperty(e))t=_watches[e];else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){t=_watches[n];break}return t},getWatches:function(){return _watches},pauseWatch:function(e,t){let n=!1;if(Is.definedString(e)&&Is.definedNumber(t))if(_watches.hasOwnProperty(e))n=pauseWatchObject(e,t);else for(let r in _watches)if(_watches.hasOwnProperty(r)&&Is.definedString(_watches[r].domElementId)&&_watches[r].domElementId===e){n=pauseWatchObject(r,t);break}return n},pauseWatches:function(e){if(Is.definedNumber(e))for(let t in _watches)_watches.hasOwnProperty(t)&&pauseWatchObject(t,e);return _public},resumeWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))_watches[e].options.starts=null,t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){_watches[n].options.starts=null,t=!0;break}return t},resumeWatches:function(){for(let e in _watches)_watches.hasOwnProperty(e)&&(_watches[e].options.starts=null);return _public},searchDomForNewWatches:function(){return collectDOMObjects(),_public},setConfiguration:function(e){if(Is.definedObject(e)){let t=!1;const n=_configuration;for(let r in e)e.hasOwnProperty(r)&&_configuration.hasOwnProperty(r)&&n[r]!==e[r]&&(n[r]=e[r],t=!0);t&&buildDefaultConfiguration(n)}return _public},getVersion:function(){return"1.0.1"}};buildDefaultConfiguration(),document.addEventListener("DOMContentLoaded",(function(){collectDOMObjects()})),window.addEventListener("pagehide",(function(){_watches_Cancel=!0,cancelWatchesForObjects()})),Is.defined(window.$observe)||(window.$observe=_public)})(); \ No newline at end of file +"use strict";var Constant,Is,Str,Default,Config,Watch;(Constant||(Constant={})).OBSERVE_JS_ATTRIBUTE_NAME="data-observe-js",(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=function(e){return n(e)&&e instanceof Array},e.definedDate=function(e){return n(e)&&e instanceof Date}})(Is||(Is={})),(Str||(Str={})).newGuid=function(){const e=[];for(let t=0;t<32;t++){8!==t&&12!==t&&16!==t&&20!==t||e.push("-");const n=Math.floor(16*Math.random()).toString(16);e.push(n)}return e.join("")},(e=>{function t(e,t){return Is.definedArray(e)?e:t}e.getAnyString=function(e,t){return"string"==typeof e?e:t},e.getString=function(e,t){return Is.definedString(e)?e:t},e.getBoolean=function(e,t){return Is.definedBoolean(e)?e:t},e.getNumber=function(e,t){return Is.definedNumber(e)?e:t},e.getFunction=function(e,t){return Is.definedFunction(e)?e:t},e.getArray=t,e.getObject=function(e,t){return Is.definedObject(e)?e:t},e.getDate=function(e,t){return Is.definedDate(e)?e:t},e.getStringOrArray=function(e,n){let r=n;if(Is.definedString(e)){const t=e.toString().split("space");0===t.length?e=n:r=t}else r=t(e,n);return r}})(Default||(Default={})),(e=>{let t;(t=e.Options||(e.Options={})).get=function(e=null){let t=Default.getObject(e,{});return t.safeMode=Default.getBoolean(t.safeMode,!0),t.domElementTypes=Default.getStringOrArray(t.domElementTypes,["*"]),t=function(e){return e.text=Default.getObject(e.text,{}),e.text.objectErrorText=Default.getString(e.text.objectErrorText,"Errors in object: {{error_1}}, {{error_2}}"),e.text.attributeNotValidErrorText=Default.getString(e.text.attributeNotValidErrorText,"The attribute '{{attribute_name}}' is not a valid object."),e.text.attributeNotSetErrorText=Default.getString(e.text.attributeNotSetErrorText,"The attribute '{{attribute_name}}' has not been set correctly."),e}(t),t}})(Config||(Config={})),(e=>{let t;(t=e.Options||(e.Options={})).get=function(e){let t=Default.getObject(e,{});return t.timeout=Default.getNumber(t.timeout,250),t.starts=Default.getDate(t.starts,null),t.expires=Default.getDate(t.expires,null),t.reset=Default.getBoolean(t.reset,!1),t.cancelOnChange=Default.getBoolean(t.cancelOnChange,!1),t.maximumChangesBeforeCanceling=Default.getNumber(t.maximumChangesBeforeCanceling,0),t.pauseTimeoutOnChange=Default.getNumber(t.pauseTimeoutOnChange,0),t.propertyNames=Default.getArray(t.propertyNames,null),t.allowCanceling=Default.getBoolean(t.allowCanceling,!0),t.allowPausing=Default.getBoolean(t.allowPausing,!0),t.removeAttribute=Default.getBoolean(t.removeAttribute,!0),t=function(e){return e.events=Default.getObject(e.events,{}),e.events.onChange=Default.getFunction(e.events.onChange,null),e.events.onPropertyChange=Default.getFunction(e.events.onPropertyChange,null),e.events.onCancel=Default.getFunction(e.events.onCancel,null),e.events.onRemove=Default.getFunction(e.events.onRemove,null),e.events.onStart=Default.getFunction(e.events.onStart,null),e}(t),t}})(Watch||(Watch={})),(()=>{let _configuration={};const _watches={};let _watches_Cancel=!1;function collectDOMObjects(){const e=_configuration.domElementTypes,t=e.length;for(let n=0;n=e.starts)&&(watchObjectForChanges(t),Is.definedDate(e.expires)&&n>=e.expires&&cancelWatchObject(t))}function watchObjectForChanges(e){if(_watches.hasOwnProperty(e)){const t=_watches[e],n=Is.definedString(t.domElementId);let r=null;n&&(r=document.getElementById(t.domElementId),Is.defined(r)?t.originalObject=r.outerHTML:(t.originalObject="",fireCustomTriggerEvent(t.options.events.onRemove,t.domElementId)));const o=t.cachedObject,i=t.originalObject,a=n?i:JSON.stringify(i);if(o!==a){if(t.options.reset?n?r.outerHTML=t.cachedObject:t.originalObject=getObjectFromString(o).object:t.cachedObject=a,n)fireCustomTriggerEvent(t.options.events.onChange,o,a);else{const e=getObjectFromString(o).object,n=getObjectFromString(a).object;Is.definedArray(e)||Is.definedArray(n)?fireCustomTriggerEvent(t.options.events.onChange,e,n):(compareWatchObject(e,n,t),Is.definedFunction(t.options.events.onPropertyChange)&&compareWatchObjectProperties(e,n,t))}t.totalChanges++,t.options.pauseTimeoutOnChange>0&&pauseWatchObject(e,t.options.pauseTimeoutOnChange),t.options.cancelOnChange&&cancelWatchObject(e),t.options.maximumChangesBeforeCanceling>0&&t.totalChanges>=t.options.maximumChangesBeforeCanceling&&cancelWatchObject(e)}}}function compareWatchObject(e,t,n){if(Is.definedArray(n.options.propertyNames)){const r=n.options.propertyNames.length;for(let o=0;o-1)&&JSON.stringify(o)!==JSON.stringify(i)&&fireCustomTriggerEvent(n.options.events.onPropertyChange,r,o,i)}}function cancelWatchesForObjects(){for(let e in _watches)_watches.hasOwnProperty(e)&&cancelWatchObject(e)}function cancelWatchObject(e){if(_watches.hasOwnProperty(e)){const t=_watches[e].options;(t.allowCanceling||_watches_Cancel)&&(fireCustomTriggerEvent(t.events.onCancel,e),clearInterval(_watches[e].timer),delete _watches[e])}}function pauseWatchObject(e,t){let n=!1;if(_watches.hasOwnProperty(e)){const r=_watches[e].options;r.allowPausing&&(r.starts=new Date,r.starts.setMilliseconds(r.starts.getMilliseconds()+t),n=!0)}return n}function fireCustomTriggerEvent(e,...t){Is.definedFunction(e)&&e.apply(null,[].slice.call(t,0))}function getObjectFromString(objectString){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval(`(${objectString})`),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){_configuration.safeMode||(logError(_configuration.text.objectErrorText.replace("{{error_1}}",e1.message).replace("{{error_2}}",e.message)),result.parsed=!1),result.object=null}}return result}function logError(e){let t=!0;return _configuration.safeMode||(console.error(e),t=!1),t}const _public={watch:function(e,t){return createWatch(e,t)},cancelWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))cancelWatchObject(e),t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){cancelWatchObject(n),t=!0;break}return t},cancelWatches:function(){return cancelWatchesForObjects(),_public},getWatch:function(e){let t=null;if(Is.definedString(e))if(_watches.hasOwnProperty(e))t=_watches[e];else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){t=_watches[n];break}return t},getWatches:function(){return _watches},pauseWatch:function(e,t){let n=!1;if(Is.definedString(e)&&Is.definedNumber(t))if(_watches.hasOwnProperty(e))n=pauseWatchObject(e,t);else for(let r in _watches)if(_watches.hasOwnProperty(r)&&Is.definedString(_watches[r].domElementId)&&_watches[r].domElementId===e){n=pauseWatchObject(r,t);break}return n},pauseWatches:function(e){if(Is.definedNumber(e))for(let t in _watches)_watches.hasOwnProperty(t)&&pauseWatchObject(t,e);return _public},resumeWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))_watches[e].options.starts=null,t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){_watches[n].options.starts=null,t=!0;break}return t},resumeWatches:function(){for(let e in _watches)_watches.hasOwnProperty(e)&&(_watches[e].options.starts=null);return _public},searchDomForNewWatches:function(){return collectDOMObjects(),_public},setConfiguration:function(e){if(Is.definedObject(e)){let t=!1;const n=_configuration;for(let r in e)e.hasOwnProperty(r)&&_configuration.hasOwnProperty(r)&&n[r]!==e[r]&&(n[r]=e[r],t=!0);t&&(_configuration=Config.Options.get(n))}return _public},getVersion:function(){return"1.0.1"}};_configuration=Config.Options.get(),document.addEventListener("DOMContentLoaded",(function(){collectDOMObjects()})),window.addEventListener("pagehide",(function(){_watches_Cancel=!0,cancelWatchesForObjects()})),Is.defined(window.$observe)||(window.$observe=_public)})(); \ No newline at end of file diff --git a/src/observe.ts b/src/observe.ts index 555b5f4..3186bf0 100644 --- a/src/observe.ts +++ b/src/observe.ts @@ -12,18 +12,17 @@ import { - type WatchOptionEvents, type WatchOptions, type Configuration, - type ObserveWatch, - type ConfigurationText } from "./ts/type"; + type ObserveWatch } from "./ts/type"; import { type PublicApi } from "./ts/api"; import { Constant } from "./ts/constant"; -import { Default } from "./ts/data/default"; import { Char } from "./ts/data/enum"; import { Is } from "./ts/data/is"; import { Str } from "./ts/data/str"; +import { Config } from "./ts/options/config"; +import { Watch } from "./ts/options/watch"; type StringToJson = { @@ -74,7 +73,7 @@ type StringToJson = { const watchOptionsJson: StringToJson = getObjectFromString( bindingOptionsData ); if ( watchOptionsJson.parsed && Is.definedObject( watchOptionsJson.object ) ) { - const watchOptions: WatchOptions = getWatchOptions( watchOptionsJson.object ); + const watchOptions: WatchOptions = Watch.Options.get( watchOptionsJson.object ); if ( !Is.definedString( element.id ) ) { element.id = Str.newGuid(); @@ -113,7 +112,7 @@ type StringToJson = { if ( Is.definedObject( object ) ) { storageId = Str.newGuid(); - const watchOptions: WatchOptions = getWatchOptions( options ); + const watchOptions: WatchOptions = Watch.Options.get( options ); const watch: ObserveWatch = {} as ObserveWatch; let startWatchObject: any = null; @@ -315,44 +314,6 @@ type StringToJson = { } - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * Watch Options - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - function getWatchOptions( newOptions: any ) : WatchOptions { - let options: WatchOptions = Default.getObject( newOptions, {} as WatchOptions ); - - options.timeout = Default.getNumber( options.timeout, 250 ); - options.starts = Default.getDate( options.starts, null! ); - options.expires = Default.getDate( options.expires, null! ); - options.reset = Default.getBoolean( options.reset, false ); - options.cancelOnChange = Default.getBoolean( options.cancelOnChange, false ); - options.maximumChangesBeforeCanceling = Default.getNumber( options.maximumChangesBeforeCanceling, 0 ); - options.pauseTimeoutOnChange = Default.getNumber( options.pauseTimeoutOnChange, 0 ); - options.propertyNames = Default.getArray( options.propertyNames, null! ); - options.allowCanceling = Default.getBoolean( options.allowCanceling, true ); - options.allowPausing = Default.getBoolean( options.allowPausing, true ); - options.removeAttribute = Default.getBoolean( options.removeAttribute, true ); - - options = getWatchOptionsCustomTriggers( options ); - - return options; - } - - function getWatchOptionsCustomTriggers( options: WatchOptions ) : WatchOptions { - options.events = Default.getObject( options.events, {} as WatchOptionEvents ); - options.events!.onChange = Default.getFunction( options.events!.onChange, null! ); - options.events!.onPropertyChange = Default.getFunction( options.events!.onPropertyChange, null! ); - options.events!.onCancel = Default.getFunction( options.events!.onCancel, null! ); - options.events!.onRemove = Default.getFunction( options.events!.onRemove, null! ); - options.events!.onStart = Default.getFunction( options.events!.onStart, null! ); - - return options; - } - - /* * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- * Triggering Custom Events @@ -416,28 +377,6 @@ type StringToJson = { } - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * Public API Functions: Helpers: Configuration - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - function buildDefaultConfiguration( newConfiguration: any = null ) : void { - _configuration = Default.getObject( newConfiguration, {} as Configuration ); - _configuration.safeMode = Default.getBoolean( _configuration.safeMode, true ); - _configuration.domElementTypes = Default.getStringOrArray( _configuration.domElementTypes, [ "*" ] ); - - buildDefaultConfigurationStrings(); - } - - function buildDefaultConfigurationStrings() : void { - _configuration.text = Default.getObject( _configuration.text, {} as ConfigurationText ); - _configuration.text!.objectErrorText = Default.getString( _configuration.text!.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}" ); - _configuration.text!.attributeNotValidErrorText = Default.getString( _configuration.text!.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object." ); - _configuration.text!.attributeNotSetErrorText = Default.getString( _configuration.text!.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly." ); - } - - /* * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- * Public API Functions: @@ -599,7 +538,7 @@ type StringToJson = { } if ( configurationHasChanged ) { - buildDefaultConfiguration( newInternalConfiguration ); + _configuration = Config.Options.get( newInternalConfiguration ); } } @@ -626,7 +565,7 @@ type StringToJson = { */ ( () => { - buildDefaultConfiguration(); + _configuration = Config.Options.get(); document.addEventListener( "DOMContentLoaded", function() { collectDOMObjects(); diff --git a/src/ts/options/config.ts b/src/ts/options/config.ts new file mode 100644 index 0000000..e1da82a --- /dev/null +++ b/src/ts/options/config.ts @@ -0,0 +1,39 @@ +/** + * Observe.js + * + * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. + * + * @file config.ts + * @version v1.0.1 + * @author Bunoon + * @license MIT License + * @copyright Bunoon 2024 + */ + + +import { type Configuration, type ConfigurationText } from "../type"; +import { Default } from "../data/default"; + + +export namespace Config { + export namespace Options { + export function get( newConfiguration: any = null ) : Configuration { + let configuration: Configuration = Default.getObject( newConfiguration, {} as Configuration ); + configuration.safeMode = Default.getBoolean( configuration.safeMode, true ); + configuration.domElementTypes = Default.getStringOrArray( configuration.domElementTypes, [ "*" ] ); + + configuration = getText( configuration ); + + return configuration; + } + + function getText( configuration: Configuration ) : Configuration { + configuration.text = Default.getObject( configuration.text, {} as ConfigurationText ); + configuration.text!.objectErrorText = Default.getString( configuration.text!.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}" ); + configuration.text!.attributeNotValidErrorText = Default.getString( configuration.text!.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object." ); + configuration.text!.attributeNotSetErrorText = Default.getString( configuration.text!.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly." ); + + return configuration; + } + } +} \ No newline at end of file diff --git a/src/ts/options/watch.ts b/src/ts/options/watch.ts new file mode 100644 index 0000000..24d3977 --- /dev/null +++ b/src/ts/options/watch.ts @@ -0,0 +1,51 @@ +/** + * Observe.js + * + * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. + * + * @file watch.ts + * @version v1.0.1 + * @author Bunoon + * @license MIT License + * @copyright Bunoon 2024 + */ + + +import { type WatchOptionEvents, type WatchOptions } from "../type"; +import { Default } from "../data/default"; + + +export namespace Watch { + export namespace Options { + export function get( newOptions: any ) : WatchOptions { + let options: WatchOptions = Default.getObject( newOptions, {} as WatchOptions ); + + options.timeout = Default.getNumber( options.timeout, 250 ); + options.starts = Default.getDate( options.starts, null! ); + options.expires = Default.getDate( options.expires, null! ); + options.reset = Default.getBoolean( options.reset, false ); + options.cancelOnChange = Default.getBoolean( options.cancelOnChange, false ); + options.maximumChangesBeforeCanceling = Default.getNumber( options.maximumChangesBeforeCanceling, 0 ); + options.pauseTimeoutOnChange = Default.getNumber( options.pauseTimeoutOnChange, 0 ); + options.propertyNames = Default.getArray( options.propertyNames, null! ); + options.allowCanceling = Default.getBoolean( options.allowCanceling, true ); + options.allowPausing = Default.getBoolean( options.allowPausing, true ); + options.removeAttribute = Default.getBoolean( options.removeAttribute, true ); + + options = getEvents( options ); + + return options; + } + + function getEvents( options: WatchOptions ) : WatchOptions { + options.events = Default.getObject( options.events, {} as WatchOptionEvents ); + options.events!.onChange = Default.getFunction( options.events!.onChange, null! ); + options.events!.onPropertyChange = Default.getFunction( options.events!.onPropertyChange, null! ); + options.events!.onCancel = Default.getFunction( options.events!.onCancel, null! ); + options.events!.onRemove = Default.getFunction( options.events!.onRemove, null! ); + options.events!.onStart = Default.getFunction( options.events!.onStart, null! ); + + return options; + } + } +} \ No newline at end of file From 99838a22681d193d31d3edbd1ad30cba5cca5078 Mon Sep 17 00:00:00 2001 From: William Troup Date: Tue, 23 Jul 2024 20:08:42 +0100 Subject: [PATCH 5/7] Moved more code. --- dist/observe.esm.js | 39 ++++++++++++++++++++++++++------------- dist/observe.esm.js.map | 2 +- dist/observe.js | 32 +++++++++++++++++++------------- dist/observe.js.map | 2 +- dist/observe.min.js | 2 +- src/observe.ts | 30 +++++++++--------------------- src/ts/area/trigger.ts | 23 +++++++++++++++++++++++ src/ts/data/default.ts | 2 +- 8 files changed, 81 insertions(+), 51 deletions(-) create mode 100644 src/ts/area/trigger.ts diff --git a/dist/observe.esm.js b/dist/observe.esm.js index 056b5dd..52ebf9b 100644 --- a/dist/observe.esm.js +++ b/dist/observe.esm.js @@ -221,6 +221,23 @@ var init_watch = __esm({ } }); +var Trigger; + +var init_trigger = __esm({ + "src/ts/area/trigger.ts"() { + "use strict"; + init_is(); + (e => { + function t(e, ...t) { + if (Is.definedFunction(e)) { + e.apply(null, [].slice.call(t, 0)); + } + } + e.customEvent = t; + })(Trigger || (Trigger = {})); + } +}); + var require_observe = __commonJS({ "src/observe.ts"(exports, module) { init_constant(); @@ -229,6 +246,7 @@ var require_observe = __commonJS({ init_str(); init_config(); init_watch(); + init_trigger(); (() => { let _configuration = {}; const _watches = {}; @@ -296,7 +314,7 @@ var require_observe = __commonJS({ s = e; } if (Is.defined(i.cachedObject)) { - fireCustomTriggerEvent(i.options.events.onStart, s); + Trigger.customEvent(i.options.events.onStart, s); i.timer = setInterval((function() { watchTimer(o, r); }), o.timeout); @@ -325,7 +343,7 @@ var require_observe = __commonJS({ t.originalObject = r.outerHTML; } else { t.originalObject = ""; - fireCustomTriggerEvent(t.options.events.onRemove, t.domElementId); + Trigger.customEvent(t.options.events.onRemove, t.domElementId); } } const o = t.cachedObject; @@ -342,7 +360,7 @@ var require_observe = __commonJS({ t.cachedObject = s; } if (n) { - fireCustomTriggerEvent(t.options.events.onChange, o, s); + Trigger.customEvent(t.options.events.onChange, o, s); } else { const e = getObjectFromString(o).object; const n = getObjectFromString(s).object; @@ -352,7 +370,7 @@ var require_observe = __commonJS({ compareWatchObjectProperties(e, n, t); } } else { - fireCustomTriggerEvent(t.options.events.onChange, e, n); + Trigger.customEvent(t.options.events.onChange, e, n); } } t.totalChanges++; @@ -374,12 +392,12 @@ var require_observe = __commonJS({ for (let o = 0; o < r; o++) { const r = n.options.propertyNames[o]; if (e[r] !== t[r]) { - fireCustomTriggerEvent(n.options.events.onChange, e, t); + Trigger.customEvent(n.options.events.onChange, e, t); break; } } } else { - fireCustomTriggerEvent(n.options.events.onChange, e, t); + Trigger.customEvent(n.options.events.onChange, e, t); } } function compareWatchObjectProperties(e, t, n) { @@ -395,7 +413,7 @@ var require_observe = __commonJS({ } else { if (!Is.definedArray(n.options.propertyNames) || n.options.propertyNames.indexOf(r) > -1) { if (JSON.stringify(o) !== JSON.stringify(i)) { - fireCustomTriggerEvent(n.options.events.onPropertyChange, r, o, i); + Trigger.customEvent(n.options.events.onPropertyChange, r, o, i); } } } @@ -413,7 +431,7 @@ var require_observe = __commonJS({ if (_watches.hasOwnProperty(e)) { const t = _watches[e].options; if (t.allowCanceling || _watches_Cancel) { - fireCustomTriggerEvent(t.events.onCancel, e); + Trigger.customEvent(t.events.onCancel, e); clearInterval(_watches[e].timer); delete _watches[e]; } @@ -431,11 +449,6 @@ var require_observe = __commonJS({ } return n; } - function fireCustomTriggerEvent(e, ...t) { - if (Is.definedFunction(e)) { - e.apply(null, [].slice.call(t, 0)); - } - } function getObjectFromString(objectString) { const result = { parsed: true, diff --git a/dist/observe.esm.js.map b/dist/observe.esm.js.map index 1623840..06939de 100644 --- a/dist/observe.esm.js.map +++ b/dist/observe.esm.js.map @@ -1 +1 @@ -{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.esm.js"],"names":["__getOwnPropNames","Object","getOwnPropertyNames","__esm","fn","res","__init","__commonJS","cb","mod","__require","exports","Constant","init_constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","init_enum","Is","init_is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Str","init_str","Str2","newGuid","result2","charIndex","push","character","Math","floor","random","join","Default","init_default","Default2","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","values","split","length","Config","init_config","Config2","Options","Options2","get","newConfiguration","configuration","safeMode","domElementTypes","getText","text","objectErrorText","attributeNotValidErrorText","attributeNotSetErrorText","Watch","init_watch","Watch2","newOptions","options","timeout","starts","expires","reset","cancelOnChange","maximumChangesBeforeCanceling","pauseTimeoutOnChange","propertyNames","allowCanceling","allowPausing","removeAttribute","getEvents","events","onChange","onPropertyChange","onCancel","onRemove","onStart","require_observe","module","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","slice","call","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","id","createWatch","logError","replace","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","fireCustomTriggerEvent","timer","setInterval","watchTimer","currentDateTime","watchObjectForChanges","cancelWatchObject","hasOwnProperty","isDomElement","originalObjectJson","oldValue","newValue","compareWatchObject","compareWatchObjectProperties","pauseWatchObject","oldObject","newObject","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","clearInterval","milliseconds","setMilliseconds","getMilliseconds","triggerFunction","args","apply","objectString","result","parse","e1","eval","e2","message","error","console","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA,IAAIA,oBAAoBC,OAAOC;;AAC/B,IAAIC,QAAQ,CAACC,GAAIC,MAAQ,SAASC;IAChC,OAAOF,MAAOC,KAAO,GAAGD,EAAGJ,kBAAkBI,GAAI,KAAKA,IAAK,KAAKC;AAClE;;AACA,IAAIE,aAAa,CAACC,GAAIC,MAAQ,SAASC;IACrC,OAAOD,MAAQ,GAAGD,EAAGR,kBAAkBQ,GAAI,MAAMC,IAAM;QAAEE,SAAS,CAAC;OAAKA,SAASF,IAAMA,EAAIE;AAC7F;;AAGA,IAAIC;;AACJ,IAAIC,gBAAgBV,MAAM;IACxB;QACE;QACA,CAAEW;YACAA,EAAUC,4BAA4B;AACvC,UAFD,CAEGH,aAAaA,WAAW,CAAC;AAC9B;;;AAIF,IAAII,YAA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A,EAAiBiF,eAAeY,MAAiB3D,eAAe+C,eAAeY,MAAiBiC,EAAyBjC,OAAkB7F,EAAiB6F,IAAe;gCAC7KiC,EAAyBjC,KAAgB7F,EAAiB6F;gCAC1DgC,IAA0B;AAC5B;AACF;wBACA,IAAIA,GAAyB;4BAC3B3F,iBAAiBxC,OAAOG,QAAQE,IAAI+H;AACtC;AACF;oBACA,OAAOZ;AACT;gBAMAa,YAAY;oBACV,OAAO;AACT;;YAEF;gBACE7F,iBAAiBxC,OAAOG,QAAQE;gBAChC2C,SAASsF,iBAAiB,qBAAoB;oBAC5C3F;AACF;gBACA4F,OAAOD,iBAAiB,aAAY;oBAClC5F,kBAAkB;oBAClB6D;AACF;gBACA,KAAKnJ,GAAGG,QAAQgL,OAAOC,WAAW;oBAChCD,OAAOC,WAAWhB;AACpB;AACD,cAZD;AAaD,UArYD;AAsYF;;;eAEalF","sourcesContent":[null]} \ No newline at end of file +{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.esm.js"],"names":["__getOwnPropNames","Object","getOwnPropertyNames","__esm","fn","res","__init","__commonJS","cb","mod","__require","exports","Constant","init_constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","init_enum","Is","init_is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Str","init_str","Str2","newGuid","result2","charIndex","push","character","Math","floor","random","join","Default","init_default","Default2","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","values","split","length","Config","init_config","Config2","Options","Options2","get","newConfiguration","configuration","safeMode","domElementTypes","getText","text","objectErrorText","attributeNotValidErrorText","attributeNotSetErrorText","Watch","init_watch","Watch2","newOptions","options","timeout","starts","expires","reset","cancelOnChange","maximumChangesBeforeCanceling","pauseTimeoutOnChange","propertyNames","allowCanceling","allowPausing","removeAttribute","getEvents","events","onChange","onPropertyChange","onCancel","onRemove","onStart","Trigger","init_trigger","Trigger2","customEvent","triggerFunction","args","apply","slice","call","require_observe","module","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","id","createWatch","logError","replace","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","timer","setInterval","watchTimer","currentDateTime","watchObjectForChanges","cancelWatchObject","hasOwnProperty","isDomElement","originalObjectJson","oldValue","newValue","compareWatchObject","compareWatchObjectProperties","pauseWatchObject","oldObject","newObject","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","clearInterval","milliseconds","setMilliseconds","getMilliseconds","objectString","result","parse","e1","eval","e2","message","error","console","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA,IAAIA,oBAAoBC,OAAOC;;AAC/B,IAAIC,QAAQ,CAACC,GAAIC,MAAQ,SAASC;IAChC,OAAOF,MAAOC,KAAO,GAAGD,EAAGJ,kBAAkBI,GAAI,KAAKA,IAAK,KAAKC;AAClE;;AACA,IAAIE,aAAa,CAACC,GAAIC,MAAQ,SAASC;IACrC,OAAOD,MAAQ,GAAGD,EAAGR,kBAAkBQ,GAAI,MAAMC,IAAM;QAAEE,SAAS,CAAC;OAAKA,SAASF,IAAMA,EAAIE;AAC7F;;AAGA,IAAIC;;AACJ,IAAIC,gBAAgBV,MAAM;IACxB;QACE;QACA,CAAEW;YACAA,EAAUC,4BAA4B;AACvC,UAFD,CAEGH,aAAaA,WAAW,CAAC;AAC9B;;;AAIF,IAAII,YAAYb,MAAM;IACpB;QACE;AACF;;;AAIF,IAAIc;;AACJ,IAAI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AGM,cAAc4C,IAAmB;wBACtC,IAAIgI,IAA0B;wBAC9B,MAAMC,IAA2BtF;wBACjC,KAAK,IAAIwD,KAAgBnG,GAAkB;4BACzC,IAAIA,EAAiBuF,eAAeY,MAAiBxD,eAAe4C,eAAeY,MAAiB8B,EAAyB9B,OAAkBnG,EAAiBmG,IAAe;gCAC7K8B,EAAyB9B,KAAgBnG,EAAiBmG;gCAC1D6B,IAA0B;AAC5B;AACF;wBACA,IAAIA,GAAyB;4BAC3BrF,iBAAiBjD,OAAOG,QAAQE,IAAIkI;AACtC;AACF;oBACA,OAAOZ;AACT;gBAMAa,YAAY;oBACV,OAAO;AACT;;YAEF;gBACEvF,iBAAiBjD,OAAOG,QAAQE;gBAChCoD,SAASgF,iBAAiB,qBAAoB;oBAC5CrF;AACF;gBACAsF,OAAOD,iBAAiB,aAAY;oBAClCtF,kBAAkB;oBAClB0D;AACF;gBACA,KAAKzJ,GAAGG,QAAQmL,OAAOC,WAAW;oBAChCD,OAAOC,WAAWhB;AACpB;AACD,cAZD;AAaD,UAhYD;AAiYF;;;eAEa5E","sourcesContent":[null]} \ No newline at end of file diff --git a/dist/observe.js b/dist/observe.js index e6f8906..d90d645 100644 --- a/dist/observe.js +++ b/dist/observe.js @@ -169,6 +169,17 @@ var Watch; })(t = e.Options || (e.Options = {})); })(Watch || (Watch = {})); +var Trigger; + +(e => { + function t(e, ...t) { + if (Is.definedFunction(e)) { + e.apply(null, [].slice.call(t, 0)); + } + } + e.customEvent = t; +})(Trigger || (Trigger = {})); + (() => { let _configuration = {}; const _watches = {}; @@ -236,7 +247,7 @@ var Watch; a = e; } if (Is.defined(i.cachedObject)) { - fireCustomTriggerEvent(i.options.events.onStart, a); + Trigger.customEvent(i.options.events.onStart, a); i.timer = setInterval((function() { watchTimer(o, r); }), o.timeout); @@ -265,7 +276,7 @@ var Watch; t.originalObject = r.outerHTML; } else { t.originalObject = ""; - fireCustomTriggerEvent(t.options.events.onRemove, t.domElementId); + Trigger.customEvent(t.options.events.onRemove, t.domElementId); } } const o = t.cachedObject; @@ -282,7 +293,7 @@ var Watch; t.cachedObject = a; } if (n) { - fireCustomTriggerEvent(t.options.events.onChange, o, a); + Trigger.customEvent(t.options.events.onChange, o, a); } else { const e = getObjectFromString(o).object; const n = getObjectFromString(a).object; @@ -292,7 +303,7 @@ var Watch; compareWatchObjectProperties(e, n, t); } } else { - fireCustomTriggerEvent(t.options.events.onChange, e, n); + Trigger.customEvent(t.options.events.onChange, e, n); } } t.totalChanges++; @@ -314,12 +325,12 @@ var Watch; for (let o = 0; o < r; o++) { const r = n.options.propertyNames[o]; if (e[r] !== t[r]) { - fireCustomTriggerEvent(n.options.events.onChange, e, t); + Trigger.customEvent(n.options.events.onChange, e, t); break; } } } else { - fireCustomTriggerEvent(n.options.events.onChange, e, t); + Trigger.customEvent(n.options.events.onChange, e, t); } } function compareWatchObjectProperties(e, t, n) { @@ -335,7 +346,7 @@ var Watch; } else { if (!Is.definedArray(n.options.propertyNames) || n.options.propertyNames.indexOf(r) > -1) { if (JSON.stringify(o) !== JSON.stringify(i)) { - fireCustomTriggerEvent(n.options.events.onPropertyChange, r, o, i); + Trigger.customEvent(n.options.events.onPropertyChange, r, o, i); } } } @@ -353,7 +364,7 @@ var Watch; if (_watches.hasOwnProperty(e)) { const t = _watches[e].options; if (t.allowCanceling || _watches_Cancel) { - fireCustomTriggerEvent(t.events.onCancel, e); + Trigger.customEvent(t.events.onCancel, e); clearInterval(_watches[e].timer); delete _watches[e]; } @@ -371,11 +382,6 @@ var Watch; } return n; } - function fireCustomTriggerEvent(e, ...t) { - if (Is.definedFunction(e)) { - e.apply(null, [].slice.call(t, 0)); - } - } function getObjectFromString(objectString) { const result = { parsed: true, diff --git a/dist/observe.js.map b/dist/observe.js.map index d71770d..dec18e4 100644 --- a/dist/observe.js.map +++ b/dist/observe.js.map @@ -1 +1 @@ -{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.js"],"names":["Constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Str","Str2","newGuid","result2","charIndex","push","character","Math","floor","random","join","Default","Default2","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","values","split","length","Config","Config2","Options","Options2","get","newConfiguration","configuration","safeMode","domElementTypes","getText","text","objectErrorText","attributeNotValidErrorText","attributeNotSetErrorText","Watch","Watch2","newOptions","options","timeout","starts","expires","reset","cancelOnChange","maximumChangesBeforeCanceling","pauseTimeoutOnChange","propertyNames","allowCanceling","allowPausing","removeAttribute","getEvents","events","onChange","onPropertyChange","onCancel","onRemove","onStart","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","slice","call","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","id","createWatch","logError","replace","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","fireCustomTriggerEvent","timer","setInterval","watchTimer","currentDateTime","watchObjectForChanges","cancelWatchObject","hasOwnProperty","isDomElement","originalObjectJson","oldValue","newValue","compareWatchObject","compareWatchObjectProperties","pauseWatchObject","oldObject","newObject","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","clearInterval","milliseconds","setMilliseconds","getMilliseconds","triggerFunction","args","apply","objectString","result","parse","e1","eval","e2","message","error","console","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA;;AAGA,IAAIA;;AACJ,CAAEC;IACAA,EAAUC,4BAA4B;AACvC,EAFD,CAEGF,aAA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B,GAAI3C,QAAQE,SAAS;oBAC9B1C,IAAU;AACZ,uBAAO;oBACL,KAAK,IAAIwF,KAAa5B,UAAU;wBAC9B,IAAIA,SAAS8C,eAAelB,MAAc1G,GAAGQ,cAAcsE,SAAS4B,GAAWD,iBAAiB3B,SAAS4B,GAAWD,iBAAiBJ,GAAI;4BACvIvB,SAAS4B,GAAWhD,QAAQE,SAAS;4BACrC1C,IAAU;4BACV;AACF;AACF;AACF;AACF;YACA,OAAOA;AACT;QACAmJ,eAAe;YACb,KAAK,IAAI3D,KAAa5B,UAAU;gBAC9B,IAAIA,SAAS8C,eAAelB,IAAY;oBACtC5B,SAAS4B,GAAWhD,QAAQE,SAAS;AACvC;AACF;YACA,OAAOiG;AACT;QACAS,wBAAwB;YACtBtF;YACA,OAAO6E;AACT;QAMAU,kBAAkB,SAASzH;YACzB,IAAI9C,GAAGK,cAAcyC,IAAmB;gBACtC,IAAI0H,IAA0B;gBAC9B,MAAMC,IAA2B5F;gBACjC,KAAK,IAAI2D,KAAgB1F,GAAkB;oBACzC,IAAIA,EAAiB8E,eAAeY,MAAiB3D,eAAe+C,eAAeY,MAAiBiC,EAAyBjC,OAAkB1F,EAAiB0F,IAAe;wBAC7KiC,EAAyBjC,KAAgB1F,EAAiB0F;wBAC1DgC,IAA0B;AAC5B;AACF;gBACA,IAAIA,GAAyB;oBAC3B3F,iBAAiBpC,OAAOE,QAAQE,IAAI4H;AACtC;AACF;YACA,OAAOZ;AACT;QAMAa,YAAY;YACV,OAAO;AACT;;IAEF;QACE7F,iBAAiBpC,OAAOE,QAAQE;QAChCwC,SAASsF,iBAAiB,qBAAoB;YAC5C3F;AACF;QACA4F,OAAOD,iBAAiB,aAAY;YAClC5F,kBAAkB;YAClB6D;AACF;QACA,KAAK5I,GAAGE,QAAQ0K,OAAOC,WAAW;YAChCD,OAAOC,WAAWhB;AACpB;AACD,MAZD;AAaD,EArYD","sourcesContent":[null]} \ No newline at end of file +{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.js"],"names":["Constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Str","Str2","newGuid","result2","charIndex","push","character","Math","floor","random","join","Default","Default2","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","values","split","length","Config","Config2","Options","Options2","get","newConfiguration","configuration","safeMode","domElementTypes","getText","text","objectErrorText","attributeNotValidErrorText","attributeNotSetErrorText","Watch","Watch2","newOptions","options","timeout","starts","expires","reset","cancelOnChange","maximumChangesBeforeCanceling","pauseTimeoutOnChange","propertyNames","allowCanceling","allowPausing","removeAttribute","getEvents","events","onChange","onPropertyChange","onCancel","onRemove","onStart","Trigger","Trigger2","customEvent","triggerFunction","args","apply","slice","call","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","id","createWatch","logError","replace","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","timer","setInterval","watchTimer","currentDateTime","watchObjectForChanges","cancelWatchObject","hasOwnProperty","isDomElement","originalObjectJson","oldValue","newValue","compareWatchObject","compareWatchObjectProperties","pauseWatchObject","oldObject","newObject","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","clearInterval","milliseconds","setMilliseconds","getMilliseconds","objectString","result","parse","e1","eval","e2","message","error","console","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA;;AAGA,IAAIA;;AACJ,CA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,kBAAkB;YAClB0D;AACF;QACA,KAAKjJ,GAAGE,QAAQ4K,OAAOC,WAAW;YAChCD,OAAOC,WAAWhB;AACpB;AACD,MAZD;AAaD,EAhYD","sourcesContent":[null]} \ No newline at end of file diff --git a/dist/observe.min.js b/dist/observe.min.js index 60b6850..ca108ab 100644 --- a/dist/observe.min.js +++ b/dist/observe.min.js @@ -1 +1 @@ -"use strict";var Constant,Is,Str,Default,Config,Watch;(Constant||(Constant={})).OBSERVE_JS_ATTRIBUTE_NAME="data-observe-js",(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=function(e){return n(e)&&e instanceof Array},e.definedDate=function(e){return n(e)&&e instanceof Date}})(Is||(Is={})),(Str||(Str={})).newGuid=function(){const e=[];for(let t=0;t<32;t++){8!==t&&12!==t&&16!==t&&20!==t||e.push("-");const n=Math.floor(16*Math.random()).toString(16);e.push(n)}return e.join("")},(e=>{function t(e,t){return Is.definedArray(e)?e:t}e.getAnyString=function(e,t){return"string"==typeof e?e:t},e.getString=function(e,t){return Is.definedString(e)?e:t},e.getBoolean=function(e,t){return Is.definedBoolean(e)?e:t},e.getNumber=function(e,t){return Is.definedNumber(e)?e:t},e.getFunction=function(e,t){return Is.definedFunction(e)?e:t},e.getArray=t,e.getObject=function(e,t){return Is.definedObject(e)?e:t},e.getDate=function(e,t){return Is.definedDate(e)?e:t},e.getStringOrArray=function(e,n){let r=n;if(Is.definedString(e)){const t=e.toString().split("space");0===t.length?e=n:r=t}else r=t(e,n);return r}})(Default||(Default={})),(e=>{let t;(t=e.Options||(e.Options={})).get=function(e=null){let t=Default.getObject(e,{});return t.safeMode=Default.getBoolean(t.safeMode,!0),t.domElementTypes=Default.getStringOrArray(t.domElementTypes,["*"]),t=function(e){return e.text=Default.getObject(e.text,{}),e.text.objectErrorText=Default.getString(e.text.objectErrorText,"Errors in object: {{error_1}}, {{error_2}}"),e.text.attributeNotValidErrorText=Default.getString(e.text.attributeNotValidErrorText,"The attribute '{{attribute_name}}' is not a valid object."),e.text.attributeNotSetErrorText=Default.getString(e.text.attributeNotSetErrorText,"The attribute '{{attribute_name}}' has not been set correctly."),e}(t),t}})(Config||(Config={})),(e=>{let t;(t=e.Options||(e.Options={})).get=function(e){let t=Default.getObject(e,{});return t.timeout=Default.getNumber(t.timeout,250),t.starts=Default.getDate(t.starts,null),t.expires=Default.getDate(t.expires,null),t.reset=Default.getBoolean(t.reset,!1),t.cancelOnChange=Default.getBoolean(t.cancelOnChange,!1),t.maximumChangesBeforeCanceling=Default.getNumber(t.maximumChangesBeforeCanceling,0),t.pauseTimeoutOnChange=Default.getNumber(t.pauseTimeoutOnChange,0),t.propertyNames=Default.getArray(t.propertyNames,null),t.allowCanceling=Default.getBoolean(t.allowCanceling,!0),t.allowPausing=Default.getBoolean(t.allowPausing,!0),t.removeAttribute=Default.getBoolean(t.removeAttribute,!0),t=function(e){return e.events=Default.getObject(e.events,{}),e.events.onChange=Default.getFunction(e.events.onChange,null),e.events.onPropertyChange=Default.getFunction(e.events.onPropertyChange,null),e.events.onCancel=Default.getFunction(e.events.onCancel,null),e.events.onRemove=Default.getFunction(e.events.onRemove,null),e.events.onStart=Default.getFunction(e.events.onStart,null),e}(t),t}})(Watch||(Watch={})),(()=>{let _configuration={};const _watches={};let _watches_Cancel=!1;function collectDOMObjects(){const e=_configuration.domElementTypes,t=e.length;for(let n=0;n=e.starts)&&(watchObjectForChanges(t),Is.definedDate(e.expires)&&n>=e.expires&&cancelWatchObject(t))}function watchObjectForChanges(e){if(_watches.hasOwnProperty(e)){const t=_watches[e],n=Is.definedString(t.domElementId);let r=null;n&&(r=document.getElementById(t.domElementId),Is.defined(r)?t.originalObject=r.outerHTML:(t.originalObject="",fireCustomTriggerEvent(t.options.events.onRemove,t.domElementId)));const o=t.cachedObject,i=t.originalObject,a=n?i:JSON.stringify(i);if(o!==a){if(t.options.reset?n?r.outerHTML=t.cachedObject:t.originalObject=getObjectFromString(o).object:t.cachedObject=a,n)fireCustomTriggerEvent(t.options.events.onChange,o,a);else{const e=getObjectFromString(o).object,n=getObjectFromString(a).object;Is.definedArray(e)||Is.definedArray(n)?fireCustomTriggerEvent(t.options.events.onChange,e,n):(compareWatchObject(e,n,t),Is.definedFunction(t.options.events.onPropertyChange)&&compareWatchObjectProperties(e,n,t))}t.totalChanges++,t.options.pauseTimeoutOnChange>0&&pauseWatchObject(e,t.options.pauseTimeoutOnChange),t.options.cancelOnChange&&cancelWatchObject(e),t.options.maximumChangesBeforeCanceling>0&&t.totalChanges>=t.options.maximumChangesBeforeCanceling&&cancelWatchObject(e)}}}function compareWatchObject(e,t,n){if(Is.definedArray(n.options.propertyNames)){const r=n.options.propertyNames.length;for(let o=0;o-1)&&JSON.stringify(o)!==JSON.stringify(i)&&fireCustomTriggerEvent(n.options.events.onPropertyChange,r,o,i)}}function cancelWatchesForObjects(){for(let e in _watches)_watches.hasOwnProperty(e)&&cancelWatchObject(e)}function cancelWatchObject(e){if(_watches.hasOwnProperty(e)){const t=_watches[e].options;(t.allowCanceling||_watches_Cancel)&&(fireCustomTriggerEvent(t.events.onCancel,e),clearInterval(_watches[e].timer),delete _watches[e])}}function pauseWatchObject(e,t){let n=!1;if(_watches.hasOwnProperty(e)){const r=_watches[e].options;r.allowPausing&&(r.starts=new Date,r.starts.setMilliseconds(r.starts.getMilliseconds()+t),n=!0)}return n}function fireCustomTriggerEvent(e,...t){Is.definedFunction(e)&&e.apply(null,[].slice.call(t,0))}function getObjectFromString(objectString){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval(`(${objectString})`),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){_configuration.safeMode||(logError(_configuration.text.objectErrorText.replace("{{error_1}}",e1.message).replace("{{error_2}}",e.message)),result.parsed=!1),result.object=null}}return result}function logError(e){let t=!0;return _configuration.safeMode||(console.error(e),t=!1),t}const _public={watch:function(e,t){return createWatch(e,t)},cancelWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))cancelWatchObject(e),t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){cancelWatchObject(n),t=!0;break}return t},cancelWatches:function(){return cancelWatchesForObjects(),_public},getWatch:function(e){let t=null;if(Is.definedString(e))if(_watches.hasOwnProperty(e))t=_watches[e];else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){t=_watches[n];break}return t},getWatches:function(){return _watches},pauseWatch:function(e,t){let n=!1;if(Is.definedString(e)&&Is.definedNumber(t))if(_watches.hasOwnProperty(e))n=pauseWatchObject(e,t);else for(let r in _watches)if(_watches.hasOwnProperty(r)&&Is.definedString(_watches[r].domElementId)&&_watches[r].domElementId===e){n=pauseWatchObject(r,t);break}return n},pauseWatches:function(e){if(Is.definedNumber(e))for(let t in _watches)_watches.hasOwnProperty(t)&&pauseWatchObject(t,e);return _public},resumeWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))_watches[e].options.starts=null,t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){_watches[n].options.starts=null,t=!0;break}return t},resumeWatches:function(){for(let e in _watches)_watches.hasOwnProperty(e)&&(_watches[e].options.starts=null);return _public},searchDomForNewWatches:function(){return collectDOMObjects(),_public},setConfiguration:function(e){if(Is.definedObject(e)){let t=!1;const n=_configuration;for(let r in e)e.hasOwnProperty(r)&&_configuration.hasOwnProperty(r)&&n[r]!==e[r]&&(n[r]=e[r],t=!0);t&&(_configuration=Config.Options.get(n))}return _public},getVersion:function(){return"1.0.1"}};_configuration=Config.Options.get(),document.addEventListener("DOMContentLoaded",(function(){collectDOMObjects()})),window.addEventListener("pagehide",(function(){_watches_Cancel=!0,cancelWatchesForObjects()})),Is.defined(window.$observe)||(window.$observe=_public)})(); \ No newline at end of file +"use strict";var Constant,Is,Str,Default,Config,Watch,Trigger;(Constant||(Constant={})).OBSERVE_JS_ATTRIBUTE_NAME="data-observe-js",(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=function(e){return n(e)&&e instanceof Array},e.definedDate=function(e){return n(e)&&e instanceof Date}})(Is||(Is={})),(Str||(Str={})).newGuid=function(){const e=[];for(let t=0;t<32;t++){8!==t&&12!==t&&16!==t&&20!==t||e.push("-");const n=Math.floor(16*Math.random()).toString(16);e.push(n)}return e.join("")},(e=>{function t(e,t){return Is.definedArray(e)?e:t}e.getAnyString=function(e,t){return"string"==typeof e?e:t},e.getString=function(e,t){return Is.definedString(e)?e:t},e.getBoolean=function(e,t){return Is.definedBoolean(e)?e:t},e.getNumber=function(e,t){return Is.definedNumber(e)?e:t},e.getFunction=function(e,t){return Is.definedFunction(e)?e:t},e.getArray=t,e.getObject=function(e,t){return Is.definedObject(e)?e:t},e.getDate=function(e,t){return Is.definedDate(e)?e:t},e.getStringOrArray=function(e,n){let r=n;if(Is.definedString(e)){const t=e.toString().split("space");0===t.length?e=n:r=t}else r=t(e,n);return r}})(Default||(Default={})),(e=>{let t;(t=e.Options||(e.Options={})).get=function(e=null){let t=Default.getObject(e,{});return t.safeMode=Default.getBoolean(t.safeMode,!0),t.domElementTypes=Default.getStringOrArray(t.domElementTypes,["*"]),t=function(e){return e.text=Default.getObject(e.text,{}),e.text.objectErrorText=Default.getString(e.text.objectErrorText,"Errors in object: {{error_1}}, {{error_2}}"),e.text.attributeNotValidErrorText=Default.getString(e.text.attributeNotValidErrorText,"The attribute '{{attribute_name}}' is not a valid object."),e.text.attributeNotSetErrorText=Default.getString(e.text.attributeNotSetErrorText,"The attribute '{{attribute_name}}' has not been set correctly."),e}(t),t}})(Config||(Config={})),(e=>{let t;(t=e.Options||(e.Options={})).get=function(e){let t=Default.getObject(e,{});return t.timeout=Default.getNumber(t.timeout,250),t.starts=Default.getDate(t.starts,null),t.expires=Default.getDate(t.expires,null),t.reset=Default.getBoolean(t.reset,!1),t.cancelOnChange=Default.getBoolean(t.cancelOnChange,!1),t.maximumChangesBeforeCanceling=Default.getNumber(t.maximumChangesBeforeCanceling,0),t.pauseTimeoutOnChange=Default.getNumber(t.pauseTimeoutOnChange,0),t.propertyNames=Default.getArray(t.propertyNames,null),t.allowCanceling=Default.getBoolean(t.allowCanceling,!0),t.allowPausing=Default.getBoolean(t.allowPausing,!0),t.removeAttribute=Default.getBoolean(t.removeAttribute,!0),t=function(e){return e.events=Default.getObject(e.events,{}),e.events.onChange=Default.getFunction(e.events.onChange,null),e.events.onPropertyChange=Default.getFunction(e.events.onPropertyChange,null),e.events.onCancel=Default.getFunction(e.events.onCancel,null),e.events.onRemove=Default.getFunction(e.events.onRemove,null),e.events.onStart=Default.getFunction(e.events.onStart,null),e}(t),t}})(Watch||(Watch={})),(Trigger||(Trigger={})).customEvent=function(e,...t){Is.definedFunction(e)&&e.apply(null,[].slice.call(t,0))},(()=>{let _configuration={};const _watches={};let _watches_Cancel=!1;function collectDOMObjects(){const e=_configuration.domElementTypes,t=e.length;for(let n=0;n=e.starts)&&(watchObjectForChanges(t),Is.definedDate(e.expires)&&n>=e.expires&&cancelWatchObject(t))}function watchObjectForChanges(e){if(_watches.hasOwnProperty(e)){const t=_watches[e],n=Is.definedString(t.domElementId);let r=null;n&&(r=document.getElementById(t.domElementId),Is.defined(r)?t.originalObject=r.outerHTML:(t.originalObject="",Trigger.customEvent(t.options.events.onRemove,t.domElementId)));const o=t.cachedObject,c=t.originalObject,a=n?c:JSON.stringify(c);if(o!==a){if(t.options.reset?n?r.outerHTML=t.cachedObject:t.originalObject=getObjectFromString(o).object:t.cachedObject=a,n)Trigger.customEvent(t.options.events.onChange,o,a);else{const e=getObjectFromString(o).object,n=getObjectFromString(a).object;Is.definedArray(e)||Is.definedArray(n)?Trigger.customEvent(t.options.events.onChange,e,n):(compareWatchObject(e,n,t),Is.definedFunction(t.options.events.onPropertyChange)&&compareWatchObjectProperties(e,n,t))}t.totalChanges++,t.options.pauseTimeoutOnChange>0&&pauseWatchObject(e,t.options.pauseTimeoutOnChange),t.options.cancelOnChange&&cancelWatchObject(e),t.options.maximumChangesBeforeCanceling>0&&t.totalChanges>=t.options.maximumChangesBeforeCanceling&&cancelWatchObject(e)}}}function compareWatchObject(e,t,n){if(Is.definedArray(n.options.propertyNames)){const r=n.options.propertyNames.length;for(let o=0;o-1)&&JSON.stringify(o)!==JSON.stringify(c)&&Trigger.customEvent(n.options.events.onPropertyChange,r,o,c)}}function cancelWatchesForObjects(){for(let e in _watches)_watches.hasOwnProperty(e)&&cancelWatchObject(e)}function cancelWatchObject(e){if(_watches.hasOwnProperty(e)){const t=_watches[e].options;(t.allowCanceling||_watches_Cancel)&&(Trigger.customEvent(t.events.onCancel,e),clearInterval(_watches[e].timer),delete _watches[e])}}function pauseWatchObject(e,t){let n=!1;if(_watches.hasOwnProperty(e)){const r=_watches[e].options;r.allowPausing&&(r.starts=new Date,r.starts.setMilliseconds(r.starts.getMilliseconds()+t),n=!0)}return n}function getObjectFromString(objectString){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval(`(${objectString})`),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){_configuration.safeMode||(logError(_configuration.text.objectErrorText.replace("{{error_1}}",e1.message).replace("{{error_2}}",e.message)),result.parsed=!1),result.object=null}}return result}function logError(e){let t=!0;return _configuration.safeMode||(console.error(e),t=!1),t}const _public={watch:function(e,t){return createWatch(e,t)},cancelWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))cancelWatchObject(e),t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){cancelWatchObject(n),t=!0;break}return t},cancelWatches:function(){return cancelWatchesForObjects(),_public},getWatch:function(e){let t=null;if(Is.definedString(e))if(_watches.hasOwnProperty(e))t=_watches[e];else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){t=_watches[n];break}return t},getWatches:function(){return _watches},pauseWatch:function(e,t){let n=!1;if(Is.definedString(e)&&Is.definedNumber(t))if(_watches.hasOwnProperty(e))n=pauseWatchObject(e,t);else for(let r in _watches)if(_watches.hasOwnProperty(r)&&Is.definedString(_watches[r].domElementId)&&_watches[r].domElementId===e){n=pauseWatchObject(r,t);break}return n},pauseWatches:function(e){if(Is.definedNumber(e))for(let t in _watches)_watches.hasOwnProperty(t)&&pauseWatchObject(t,e);return _public},resumeWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))_watches[e].options.starts=null,t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){_watches[n].options.starts=null,t=!0;break}return t},resumeWatches:function(){for(let e in _watches)_watches.hasOwnProperty(e)&&(_watches[e].options.starts=null);return _public},searchDomForNewWatches:function(){return collectDOMObjects(),_public},setConfiguration:function(e){if(Is.definedObject(e)){let t=!1;const n=_configuration;for(let r in e)e.hasOwnProperty(r)&&_configuration.hasOwnProperty(r)&&n[r]!==e[r]&&(n[r]=e[r],t=!0);t&&(_configuration=Config.Options.get(n))}return _public},getVersion:function(){return"1.0.1"}};_configuration=Config.Options.get(),document.addEventListener("DOMContentLoaded",(function(){collectDOMObjects()})),window.addEventListener("pagehide",(function(){_watches_Cancel=!0,cancelWatchesForObjects()})),Is.defined(window.$observe)||(window.$observe=_public)})(); \ No newline at end of file diff --git a/src/observe.ts b/src/observe.ts index 3186bf0..3832930 100644 --- a/src/observe.ts +++ b/src/observe.ts @@ -23,6 +23,7 @@ import { Is } from "./ts/data/is"; import { Str } from "./ts/data/str"; import { Config } from "./ts/options/config"; import { Watch } from "./ts/options/watch"; +import { Trigger } from "./ts/area/trigger"; type StringToJson = { @@ -138,7 +139,7 @@ type StringToJson = { } if ( Is.defined( watch.cachedObject ) ) { - fireCustomTriggerEvent( watch.options.events!.onStart!, startWatchObject ); + Trigger.customEvent( watch.options.events!.onStart!, startWatchObject ); watch.timer = setInterval( function() { watchTimer( watchOptions, storageId ); @@ -177,7 +178,7 @@ type StringToJson = { } else { watch.originalObject = Char.empty; - fireCustomTriggerEvent( watch.options.events!.onRemove!, watch.domElementId ); + Trigger.customEvent( watch.options.events!.onRemove!, watch.domElementId ); } } @@ -198,7 +199,7 @@ type StringToJson = { } if ( isDomElement ) { - fireCustomTriggerEvent( watch.options.events!.onChange!, cachedObject, originalObjectJson ); + Trigger.customEvent( watch.options.events!.onChange!, cachedObject, originalObjectJson ); } else { const oldValue: any = getObjectFromString( cachedObject ).object; @@ -212,7 +213,7 @@ type StringToJson = { } } else { - fireCustomTriggerEvent( watch.options.events!.onChange!, oldValue, newValue ); + Trigger.customEvent( watch.options.events!.onChange!, oldValue, newValue ); } } @@ -241,13 +242,13 @@ type StringToJson = { const propertyName: string = watch.options.propertyNames![ propertyNameIndex ]; if ( oldObject[ propertyName ] !== newObject[ propertyName ] ) { - fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject ); + Trigger.customEvent( watch.options.events!.onChange!, oldObject, newObject ); break; } } } else { - fireCustomTriggerEvent( watch.options.events!.onChange!, oldObject, newObject ); + Trigger.customEvent( watch.options.events!.onChange!, oldObject, newObject ); } } @@ -267,7 +268,7 @@ type StringToJson = { if ( !Is.definedArray( watch.options.propertyNames ) || watch.options.propertyNames!.indexOf( propertyName ) > -1 ) { if ( JSON.stringify( propertyOldValue ) !== JSON.stringify( propertyNewValue ) ) { - fireCustomTriggerEvent( watch.options.events!.onPropertyChange!, propertyName, propertyOldValue, propertyNewValue ); + Trigger.customEvent( watch.options.events!.onPropertyChange!, propertyName, propertyOldValue, propertyNewValue ); } } } @@ -288,7 +289,7 @@ type StringToJson = { const watchOptions: WatchOptions = _watches[ storageId ].options; if ( watchOptions.allowCanceling || _watches_Cancel ) { - fireCustomTriggerEvent( watchOptions.events!.onCancel!, storageId ); + Trigger.customEvent( watchOptions.events!.onCancel!, storageId ); clearInterval( _watches[ storageId ].timer ); delete _watches[ storageId ]; @@ -314,19 +315,6 @@ type StringToJson = { } - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * Triggering Custom Events - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - function fireCustomTriggerEvent( triggerFunction: Function, ...args : any[] ) : void { - if ( Is.definedFunction( triggerFunction ) ) { - triggerFunction.apply( null, [].slice.call( args, 0 ) ); - } - } - - /* * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- * Default Parameter/Option Handling diff --git a/src/ts/area/trigger.ts b/src/ts/area/trigger.ts new file mode 100644 index 0000000..647e617 --- /dev/null +++ b/src/ts/area/trigger.ts @@ -0,0 +1,23 @@ +/** + * Observe.js + * + * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. + * + * @file trigger.ts + * @version v1.0.1 + * @author Bunoon + * @license MIT License + * @copyright Bunoon 2024 + */ + + +import { Is } from "../data/is"; + + +export namespace Trigger { + export function customEvent( triggerFunction: Function, ...args : any[] ) : void { + if ( Is.definedFunction( triggerFunction ) ) { + triggerFunction.apply( null, [].slice.call( args, 0 ) ); + } + } +} \ No newline at end of file diff --git a/src/ts/data/default.ts b/src/ts/data/default.ts index fc53ae8..d636ba7 100644 --- a/src/ts/data/default.ts +++ b/src/ts/data/default.ts @@ -3,7 +3,7 @@ * * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. * - * @file data.ts + * @file default.ts * @version v1.0.1 * @author Bunoon * @license MIT License From d46bb14969fd81569fa85e66e163271af28c5ed9 Mon Sep 17 00:00:00 2001 From: William Troup Date: Tue, 23 Jul 2024 20:10:38 +0100 Subject: [PATCH 6/7] Removed the dead JS code. --- docs/CHANGE_LOG.md | 1 + src/_old/observe.js | 857 -------------------------------------------- 2 files changed, 1 insertion(+), 857 deletions(-) delete mode 100644 src/_old/observe.js diff --git a/docs/CHANGE_LOG.md b/docs/CHANGE_LOG.md index 97ba494..4798f50 100644 --- a/docs/CHANGE_LOG.md +++ b/docs/CHANGE_LOG.md @@ -3,6 +3,7 @@ ## Version 1.0.1: - Updated to the latest NPM packages. - Organized all of the .ts files into separate folders. +- Removed the dead JS code.
diff --git a/src/_old/observe.js b/src/_old/observe.js deleted file mode 100644 index 8df704f..0000000 --- a/src/_old/observe.js +++ /dev/null @@ -1,857 +0,0 @@ -/** - * Observe.js - * - * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements. - * - * @file observe.js - * @version v1.0.1 - * @author Bunoon - * @license MIT License - * @copyright Bunoon 2024 - */ - - -( function() { - "use strict"; - - var // Variables: Constructor Parameters - _parameter_Document = null, - _parameter_Window = null, - _parameter_Math = null, - _parameter_Json = null, - - // Variables: Public Scope - _public = {}, - - // Variables: Strings - _string = { - empty: "" - }, - - // Variables: Watches - _watches = {}, - _watches_Cancel = false, - - // Variables: Configuration - _configuration = {}, - - // Variables: Attribute Names - _attribute_Name_Watch_Options = "data-observe-js"; - - - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * Observable DOM Object Creation / Handling - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - function collectDOMObjects() { - var tagTypes = _configuration.domElementTypes, - tagTypesLength = tagTypes.length; - - for ( var tagTypeIndex = 0; tagTypeIndex < tagTypesLength; tagTypeIndex++ ) { - var domElements = _parameter_Document.getElementsByTagName( tagTypes[ tagTypeIndex ] ), - elements = [].slice.call( domElements ), - elementsLength = elements.length; - - for ( var elementIndex = 0; elementIndex < elementsLength; elementIndex++ ) { - if ( !collectDOMObject( elements[ elementIndex ] ) ) { - break; - } - } - } - } - - function collectDOMObject( element ) { - var result = true; - - if ( isDefined( element ) && element.hasAttribute( _attribute_Name_Watch_Options ) ) { - var bindingOptionsData = element.getAttribute( _attribute_Name_Watch_Options ); - - if ( isDefinedString( bindingOptionsData ) ) { - var bindingOptions = getObjectFromString( bindingOptionsData ); - - if ( bindingOptions.parsed && isDefinedObject( bindingOptions.result ) ) { - bindingOptions = getWatchOptions( bindingOptions.result ); - - if ( !isDefinedString( element.id ) ) { - element.id = newGuid(); - } - - if ( bindingOptions.removeAttribute ) { - element.removeAttribute( _attribute_Name_Watch_Options ); - } - - createWatch( element, bindingOptions, element.id ); - - } else { - logError( _configuration.attributeNotValidErrorText.replace( "{{attribute_name}}", _attribute_Name_Watch_Options ) ); - result = false; - } - - } else { - logError( _configuration.attributeNotSetErrorText.replace( "{{attribute_name}}", _attribute_Name_Watch_Options ) ); - result = false; - } - } - - return result; - } - - - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * Watch Object Creation / Handling - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - function createWatch( object, options, domElementId ) { - var storageId = null; - - if ( isDefinedObject( object ) ) { - storageId = newGuid(); - - var watchOptions = getWatchOptions( options ), - watch = {}, - startWatchObject; - - watch.options = watchOptions; - watch.totalChanges = 0; - - if ( isDefinedString( domElementId ) ) { - var domElement = _parameter_Document.getElementById( domElementId ); - - if ( isDefined( domElement ) ) { - watch.domElementId = domElementId; - watch.cachedObject = domElement.outerHTML; - watch.originalObject = domElement.outerHTML; - - startWatchObject = domElement.outerHTML; - } - - } else { - watch.cachedObject = _parameter_Json.stringify( object ); - watch.originalObject = object; - - startWatchObject = object; - } - - if ( isDefined( watch.cachedObject ) ) { - fireCustomTrigger( watch.options.onStart, startWatchObject ); - - watch.timer = setInterval( function() { - watchTimer( watchOptions, storageId ); - }, watchOptions.timeout ); - - _watches[ storageId ] = watch; - } - } - - return storageId; - } - - function watchTimer( watchOptions, storageId ) { - var currentDateTime = new Date(); - - if ( !isDefinedDate( watchOptions.starts ) || currentDateTime >= watchOptions.starts ) { - watchObjectForChanges( storageId ); - - if ( isDefinedDate( watchOptions.expires ) && currentDateTime >= watchOptions.expires ) { - cancelWatchObject( storageId ); - } - } - } - - function watchObjectForChanges( storageId ) { - if ( _watches.hasOwnProperty( storageId ) ) { - var watch = _watches[ storageId ], - isDomElement = isDefinedString( watch.domElementId ), - domElement = null; - - if ( isDomElement ) { - domElement = _parameter_Document.getElementById( watch.domElementId ); - - if ( isDefined( domElement ) ) { - watch.originalObject = domElement.outerHTML; - } else { - watch.originalObject = _string.empty; - - fireCustomTrigger( watch.options.onRemove, watch.domElementId ); - } - } - - var cachedObject = watch.cachedObject, - originalObject = watch.originalObject, - originalObjectJson = !isDomElement ? _parameter_Json.stringify( originalObject ) : originalObject; - - if ( cachedObject !== originalObjectJson ) { - if ( watch.options.reset ) { - if ( isDomElement ) { - domElement.outerHTML = watch.cachedObject; - } else { - watch.originalObject = getObjectFromString( cachedObject ).result; - } - - } else { - watch.cachedObject = originalObjectJson; - } - - if ( isDomElement ) { - fireCustomTrigger( watch.options.onChange, cachedObject, originalObjectJson ); - } else { - - var oldValue = getObjectFromString( cachedObject ).result, - newValue = getObjectFromString( originalObjectJson ).result; - - if ( !isDefinedArray( oldValue ) && !isDefinedArray( newValue ) ) { - compareWatchObject( oldValue, newValue, watch ); - - if ( isDefinedFunction( watch.options.onPropertyChange ) ) { - compareWatchObjectProperties( oldValue, newValue, watch ); - } - - } else { - fireCustomTrigger( watch.options.onChange, oldValue, newValue ); - } - } - - watch.totalChanges++; - - if ( watch.options.pauseTimeoutOnChange > 0 ) { - pauseWatchObject( storageId, watch.options.pauseTimeoutOnChange ); - } - - if ( watch.options.cancelOnChange ) { - cancelWatchObject( storageId ); - } - - if ( watch.options.maximumChangesBeforeCanceling > 0 && watch.totalChanges >= watch.options.maximumChangesBeforeCanceling ) { - cancelWatchObject( storageId ); - } - } - } - } - - function compareWatchObject( oldObject, newObject, watch ) { - if ( isDefinedArray( watch.options.propertyNames ) ) { - var propertyNamesLength = watch.options.propertyNames.length; - - for ( var propertyNameIndex = 0; propertyNameIndex < propertyNamesLength; propertyNameIndex++ ) { - var propertyName = watch.options.propertyNames[ propertyNameIndex ]; - - if ( oldObject[ propertyName ] !== newObject[ propertyName ] ) { - fireCustomTrigger( watch.options.onChange, oldObject, newObject ); - break; - } - } - - } else { - fireCustomTrigger( watch.options.onChange, oldObject, newObject ); - } - } - - function compareWatchObjectProperties( oldObject, newObject, watch ) { - for ( var propertyName in oldObject ) { - if ( oldObject.hasOwnProperty( propertyName ) ) { - var propertyOldValue = oldObject[ propertyName ], - propertyNewValue = null; - - if ( newObject.hasOwnProperty( propertyName ) ) { - propertyNewValue = newObject[ propertyName ]; - } - - if ( isDefinedObject( propertyOldValue ) && isDefinedObject( propertyNewValue ) ) { - compareWatchObjectProperties( propertyOldValue, propertyNewValue, watch.options ); - } else { - - if ( !isDefinedArray( watch.options.propertyNames ) || watch.options.propertyNames.indexOf( propertyName ) > -1 ) { - if ( _parameter_Json.stringify( propertyOldValue ) !== _parameter_Json.stringify( propertyNewValue ) ) { - fireCustomTrigger( watch.options.onPropertyChange, propertyName, propertyOldValue, propertyNewValue ); - } - } - } - } - } - } - - function cancelWatchesForObjects() { - for ( var storageId in _watches ) { - if ( _watches.hasOwnProperty( storageId ) ) { - cancelWatchObject( storageId ); - } - } - } - - function cancelWatchObject( storageId ) { - if ( _watches.hasOwnProperty( storageId ) ) { - var watchOptions = _watches[ storageId ].options; - - if ( watchOptions.allowCanceling || _watches_Cancel ) { - fireCustomTrigger( watchOptions.onCancel, storageId ); - clearInterval( _watches[ storageId ].timer ); - - delete _watches[ storageId ]; - } - } - } - - function pauseWatchObject( storageId, milliseconds ) { - var result = false; - - if ( _watches.hasOwnProperty( storageId ) ) { - var watchOptions = _watches[ storageId ].options; - - if ( watchOptions.allowPausing ) { - watchOptions.starts = new Date(); - watchOptions.starts.setMilliseconds( watchOptions.starts.getMilliseconds() + milliseconds ); - - result = true; - } - } - - return result; - } - - - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * Watch Options - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - function getWatchOptions( newOptions ) { - var options = getDefaultObject( newOptions, {} ); - - options.timeout = getDefaultNumber( options.timeout, 250 ); - options.starts = getDefaultDate( options.starts, null ); - options.expires = getDefaultDate( options.expires, null ); - options.reset = getDefaultBoolean( options.reset, false ); - options.cancelOnChange = getDefaultBoolean( options.cancelOnChange, false ); - options.maximumChangesBeforeCanceling = getDefaultNumber( options.maximumChangesBeforeCanceling, 0 ); - options.pauseTimeoutOnChange = getDefaultNumber( options.pauseTimeoutOnChange, 0 ); - options.propertyNames = getDefaultArray( options.propertyNames, null ); - options.allowCanceling = getDefaultBoolean( options.allowCanceling, true ); - options.allowPausing = getDefaultBoolean( options.allowPausing, true ); - options.removeAttribute = getDefaultBoolean( options.removeAttribute, true ); - - options = getWatchOptionsCustomTriggers( options ); - - return options; - } - - function getWatchOptionsCustomTriggers( options ) { - options.onChange = getDefaultFunction( options.onChange, null ); - options.onPropertyChange = getDefaultFunction( options.onPropertyChange, null ); - options.onCancel = getDefaultFunction( options.onCancel, null ); - options.onRemove = getDefaultFunction( options.onRemove, null ); - options.onStart = getDefaultFunction( options.onStart, null ); - - return options; - } - - - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * Triggering Custom Events - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - function fireCustomTrigger( triggerFunction ) { - if ( isDefinedFunction( triggerFunction ) ) { - triggerFunction.apply( null, [].slice.call( arguments, 1 ) ); - } - } - - - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * String Handling - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - function newGuid() { - var result = []; - - for ( var charIndex = 0; charIndex < 32; charIndex++ ) { - if ( charIndex === 8 || charIndex === 12 || charIndex === 16 || charIndex === 20 ) { - result.push( "-" ); - } - - var character = _parameter_Math.floor( _parameter_Math.random() * 16 ).toString( 16 ); - result.push( character ); - } - - return result.join( _string.empty ); - } - - - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * Validation - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - function isDefined( value ) { - return value !== null && value !== undefined && value !== _string.empty; - } - - function isDefinedObject( object ) { - return isDefined( object ) && typeof object === "object"; - } - - function isDefinedBoolean( object ) { - return isDefined( object ) && typeof object === "boolean"; - } - - function isDefinedString( object ) { - return isDefined( object ) && typeof object === "string"; - } - - function isDefinedFunction( object ) { - return isDefined( object ) && typeof object === "function"; - } - - function isDefinedNumber( object ) { - return isDefined( object ) && typeof object === "number"; - } - - function isDefinedArray( object ) { - return isDefinedObject( object ) && object instanceof Array; - } - - function isDefinedDate( object ) { - return isDefinedObject( object ) && object instanceof Date; - } - - - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * Default Parameter/Option Handling - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - function getDefaultBoolean( value, defaultValue ) { - return isDefinedBoolean( value ) ? value : defaultValue; - } - - function getDefaultFunction( value, defaultValue ) { - return isDefinedFunction( value ) ? value : defaultValue; - } - - function getDefaultNumber( value, defaultValue ) { - return isDefinedNumber( value ) ? value : defaultValue; - } - - function getDefaultString( value, defaultValue ) { - return isDefinedString( value ) ? value : defaultValue; - } - - function getDefaultDate( value, defaultValue ) { - return isDefinedDate( value ) ? value : defaultValue; - } - - function getDefaultArray( value, defaultValue ) { - return isDefinedArray( value ) ? value : defaultValue; - } - - function getDefaultObject( value, defaultValue ) { - return isDefinedObject( value ) ? value : defaultValue; - } - - function getDefaultStringOrArray( value, defaultValue ) { - if ( isDefinedString( value ) ) { - value = value.split( _string.space ); - - if ( value.length === 0 ) { - value = defaultValue; - } - - } else { - value = getDefaultArray( value, defaultValue ); - } - - return value; - } - - function getObjectFromString( objectString ) { - var parsed = true, - result = null; - - try { - if ( isDefinedString( objectString ) ) { - result = _parameter_Json.parse( objectString ); - } - - } catch ( e1 ) { - - try { - result = eval( "(" + objectString + ")" ); - - if ( isDefinedFunction( result ) ) { - result = result(); - } - - } catch ( e2 ) { - parsed = logError( _configuration.objectErrorText.replace( "{{error_1}}", e1.message ).replace( "{{error_2}}", e2.message ) ); - result = null; - } - } - - return { - parsed: parsed, - result: result - }; - } - - function logError( error ) { - var result = true; - - if ( !_configuration.safeMode ) { - console.error( error ); - result = false; - } - - return result; - } - - - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * Public Functions: Watching Objects - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - /** - * watch(). - * - * Adds an object that should be watched for changes. - * - * @public - * - * @param {Object} object The object that should be watched. - * @param {Object} options All the options that should be used. - * - * @returns {string} The ID that object watch is stored under. - */ - _public.watch = function( object, options ) { - return createWatch( object, options ); - }; - - /** - * cancelWatch(). - * - * Cancels the watching of an object for changes. - * - * @public - * - * @param {string} id The Id of the object being watched, or DOM element ID being watched. - * - * @returns {boolean} States if the object being watched has been cancelled. - */ - _public.cancelWatch = function( id ) { - var result = false; - - if ( isDefinedString( id ) ) { - if ( _watches.hasOwnProperty( id ) ) { - cancelWatchObject( id ); - - result = true; - } else { - - for ( var storageId in _watches ) { - if ( _watches.hasOwnProperty( storageId ) && isDefinedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) { - cancelWatchObject( storageId ); - - result = true; - break; - } - } - } - } - - return result; - }; - - /** - * cancelWatches(). - * - * Cancels all the watches currently running, or paused. - * - * @public - * - * @returns {Object} The Observe.js class instance. - */ - _public.cancelWatches = function() { - cancelWatchesForObjects(); - - return _public; - }; - - /** - * getWatch(). - * - * Returns the properties for a running, or paused, watch. - * - * @public - * - * @param {string} id The Id of the object being watched, or DOM element ID being watched. - * - * @returns {Object} The watch properties for an object (null if not found). - */ - _public.getWatch = function( id ) { - var result = null; - - if ( isDefinedString( id ) ) { - if ( _watches.hasOwnProperty( id ) ) { - result = _watches[ id ]; - } else { - - for ( var storageId in _watches ) { - if ( _watches.hasOwnProperty( storageId ) && isDefinedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) { - result = _watches[ storageId ]; - break; - } - } - } - } - - return result; - }; - - /** - * getWatches(). - * - * Returns all the watches currently running, or paused. - * - * @public - * - * @returns {Object} The object of watches currently running, or paused. - */ - _public.getWatches = function() { - return _watches; - }; - - /** - * pauseWatch(). - * - * Pauses the watching of an object for changes for a specific number of milliseconds. - * - * @public - * - * @param {string} id The Id of the object being watched, or DOM element ID being watched. - * @param {number} milliseconds The milliseconds to pause the watch for. - * - * @returns {boolean} States if the object being watched has been paused. - */ - _public.pauseWatch = function( id, milliseconds ) { - var result = false; - - if ( isDefinedString( id ) && isDefinedNumber( milliseconds ) ) { - if ( _watches.hasOwnProperty( id ) ) { - result = pauseWatchObject( id, milliseconds ); - } else { - - for ( var storageId in _watches ) { - if ( _watches.hasOwnProperty( storageId ) && isDefinedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) { - result = pauseWatchObject( storageId, milliseconds ); - break; - } - } - } - } - - return result; - }; - - /** - * pauseWatches(). - * - * Pauses all the watches for a specific number of milliseconds. - * - * @public - * - * @param {number} milliseconds The milliseconds to pause the watches for. - * - * @returns {Object} The Observe.js class instance. - */ - _public.pauseWatches = function( milliseconds ) { - if ( isDefinedNumber( milliseconds ) ) { - for ( var storageId in _watches ) { - if ( _watches.hasOwnProperty( storageId ) ) { - pauseWatchObject( storageId, milliseconds ); - } - } - } - - return _public; - }; - - /** - * resumeWatch(). - * - * Resumes the watching of an object for changes after it was paused. - * - * @public - * - * @param {string} id The Id of the object being watched, or DOM element ID being watched. - * - * @returns {boolean} States if the watching of an object has been resumed - */ - _public.resumeWatch = function( id ) { - var result = false; - - if ( isDefinedString( id ) ) { - if ( _watches.hasOwnProperty( id ) ) { - _watches[ id ].options.starts = null; - result = true; - } else { - - for ( var storageId in _watches ) { - if ( _watches.hasOwnProperty( storageId ) && isDefinedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) { - _watches[ storageId ].options.starts = null; - result = true; - break; - } - } - } - } - - return result; - }; - - /** - * resumeWatches(). - * - * Resumes all the watches that are currently paused. - * - * @public - * - * @returns {Object} The Observe.js class instance. - */ - _public.resumeWatches = function() { - for ( var storageId in _watches ) { - if ( _watches.hasOwnProperty( storageId ) ) { - _watches[ storageId ].options.starts = null; - } - } - - return _public; - }; - - /** - * searchDomForNewWatches(). - * - * Searches the DOM for new elements to watch, and adds them. - * - * @public - * - * @returns {Object} The Observe.js class instance. - */ - _public.searchDomForNewWatches = function() { - collectDOMObjects(); - - return _public; - }; - - - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * Public Functions: Configuration - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - /** - * setConfiguration(). - * - * Sets the specific configuration options that should be used. - * - * @public - * - * @param {Options} newConfiguration All the configuration options that should be set (refer to "Configuration/Options" documentation for properties). - * - * @returns {Object} The Observe.js class instance. - */ - _public.setConfiguration = function( newConfiguration ) { - if ( isDefinedObject( newConfiguration ) ) { - var configurationHasChanged = false; - - for ( var propertyName in newConfiguration ) { - if ( newConfiguration.hasOwnProperty( propertyName ) && _configuration.hasOwnProperty( propertyName ) && _configuration[ propertyName ] !== newConfiguration[ propertyName ] ) { - _configuration[ propertyName ] = newConfiguration[ propertyName ]; - configurationHasChanged = true; - } - } - - if ( configurationHasChanged ) { - buildDefaultConfiguration( _configuration ); - } - } - - return _public; - }; - - function buildDefaultConfiguration( newConfiguration ) { - _configuration = !isDefinedObject( newConfiguration ) ? {} : newConfiguration; - _configuration.safeMode = getDefaultBoolean( _configuration.safeMode, true ); - _configuration.domElementTypes = getDefaultStringOrArray( _configuration.domElementTypes, [ "*" ] ); - - buildDefaultConfigurationStrings(); - } - - function buildDefaultConfigurationStrings() { - _configuration.objectErrorText = getDefaultString( _configuration.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}" ); - _configuration.attributeNotValidErrorText = getDefaultString( _configuration.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object." ); - _configuration.attributeNotSetErrorText = getDefaultString( _configuration.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly." ); - } - - - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * Public Functions: Additional Data - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - /** - * getVersion(). - * - * Returns the version of Observe.js. - * - * @public - * - * @returns {string} The version number. - */ - _public.getVersion = function() { - return "1.0.1"; - }; - - - /* - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - * Initialize Observe.js - * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - */ - - ( function ( documentObject, windowObject, mathObject, jsonObject ) { - _parameter_Document = documentObject; - _parameter_Window = windowObject; - _parameter_Math = mathObject; - _parameter_Json = jsonObject; - - buildDefaultConfiguration(); - - _parameter_Document.addEventListener( "DOMContentLoaded", function() { - collectDOMObjects(); - } ); - - _parameter_Window.addEventListener( "pagehide", function() { - _watches_Cancel = true; - - cancelWatchesForObjects(); - } ); - - if ( !isDefined( _parameter_Window.$observe ) ) { - _parameter_Window.$observe = _public; - } - - } ) ( document, window, Math, JSON ); -} )(); \ No newline at end of file From 645aff83b06467287652bbd23d8622e6a7789362 Mon Sep 17 00:00:00 2001 From: William Troup Date: Tue, 23 Jul 2024 20:11:33 +0100 Subject: [PATCH 7/7] Minor clean up. --- src/ts/type.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/type.ts b/src/ts/type.ts index 1c0b22e..6ed30e2 100644 --- a/src/ts/type.ts +++ b/src/ts/type.ts @@ -44,7 +44,7 @@ export type WatchOptionEvents = { onCancel?: Function; onRemove?: Function; onStart?: Function; -} +}; export type ObserveWatch = { options: WatchOptions;