From 3ecab7043e8fcb8fb0a7b38854930ce4bff9ec29 Mon Sep 17 00:00:00 2001 From: William Troup Date: Wed, 10 Jul 2024 20:55:15 +0100 Subject: [PATCH 1/3] Updated to v1.1.1. --- README.md | 10 +++++----- README_NUGET.md | 10 +++++----- dist/peek.esm.js | 2 +- dist/peek.esm.js.map | 2 +- dist/peek.js | 2 +- dist/peek.js.css | 2 +- dist/peek.js.map | 2 +- dist/peek.min.js | 2 +- docs/CHANGE_LOG.md | 2 +- package-lock.json | 6 +++--- package.json | 2 +- peek.js.nuspec | 2 +- src/peek.js.scss | 2 +- src/peek.ts | 4 ++-- src/ts/api.ts | 2 +- src/ts/constant.ts | 2 +- src/ts/data.ts | 2 +- src/ts/dom.ts | 2 +- src/ts/enum.ts | 2 +- src/ts/is.ts | 2 +- src/ts/type.ts | 2 +- 21 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index b42b894..cb1f584 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ Peek.js [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Peek.js%2C%20a%20free%20JavaScript%json%20converter&url=https://github.com/williamtroup/Peek.js&hashtags=javascript,element,property,viewer) -[![npm](https://img.shields.io/badge/npmjs-v1.1.0-blue)](https://www.npmjs.com/package/jpeek.js) -[![nuget](https://img.shields.io/badge/nuget-v1.1.0-purple)](https://www.nuget.org/packages/Peek.js/) +[![npm](https://img.shields.io/badge/npmjs-v1.1.1-blue)](https://www.npmjs.com/package/jpeek.js) +[![nuget](https://img.shields.io/badge/nuget-v1.1.1-purple)](https://www.nuget.org/packages/Peek.js/) [![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Peek.js/blob/main/LICENSE.txt) [![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Peek.js/discussions) [![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://william-troup.com/) >

🐛 A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.

->

v1.1.0

+>

v1.1.1


![Peek.js - CSS Mode](docs/images/css-mode.png) @@ -59,8 +59,8 @@ npm install jpeek.js You can also use the following CDN links: ```markdown -https://cdn.jsdelivr.net/gh/williamtroup/Peek.js@1.1.0/dist/peek.min.js -https://cdn.jsdelivr.net/gh/williamtroup/Peek.js@1.1.0/dist/peek.js.min.css +https://cdn.jsdelivr.net/gh/williamtroup/Peek.js@1.1.1/dist/peek.min.js +https://cdn.jsdelivr.net/gh/williamtroup/Peek.js@1.1.1/dist/peek.js.min.css ```

diff --git a/README_NUGET.md b/README_NUGET.md index 45f2ed3..26bd7ac 100644 --- a/README_NUGET.md +++ b/README_NUGET.md @@ -1,8 +1,8 @@ -# Peek.js v1.1.0 +# Peek.js v1.1.1 [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Peek.js%2C%20a%20free%20JavaScript%json%20converter&url=https://github.com/williamtroup/Peek.js&hashtags=javascript,element,property,viewer) -[![npm](https://img.shields.io/badge/npmjs-v1.1.0-blue)](https://www.npmjs.com/package/jpeek.js) -[![nuget](https://img.shields.io/badge/nuget-v1.1.0-purple)](https://www.nuget.org/packages/Peek.js/) +[![npm](https://img.shields.io/badge/npmjs-v1.1.1-blue)](https://www.npmjs.com/package/jpeek.js) +[![nuget](https://img.shields.io/badge/nuget-v1.1.1-purple)](https://www.nuget.org/packages/Peek.js/) [![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Peek.js/blob/main/LICENSE.txt) [![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Peek.js/discussions) [![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://william-troup.com/) @@ -43,8 +43,8 @@ npm install jpeek.js You can also use the following CDN links: ```markdown -https://cdn.jsdelivr.net/gh/williamtroup/Peek.js@1.1.0/dist/peek.min.js -https://cdn.jsdelivr.net/gh/williamtroup/Peek.js@1.1.0/dist/peek.js.min.css +https://cdn.jsdelivr.net/gh/williamtroup/Peek.js@1.1.1/dist/peek.min.js +https://cdn.jsdelivr.net/gh/williamtroup/Peek.js@1.1.1/dist/peek.js.min.css ``` diff --git a/dist/peek.esm.js b/dist/peek.esm.js index 706ea88..bd1a408 100644 --- a/dist/peek.esm.js +++ b/dist/peek.esm.js @@ -367,7 +367,7 @@ var o; return L; }, getVersion: function() { - return "1.1.0"; + return "1.1.1"; } }; (() => { diff --git a/dist/peek.esm.js.map b/dist/peek.esm.js.map index 2b6247a..2d83bad 100644 --- a/dist/peek.esm.js.map +++ b/dist/peek.esm.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/ts/is.ts","../src/ts/constant.ts","../src/ts/dom.ts","../src/ts/data.ts","../src/peek.ts"],"names":["Is","Constant","DomElement","Data"],"mappings":";AAgBO,IAAU;AAAA,CAAV,CAAUA,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,KAAK,OAAO,WAAW;AAAA,EAClD;AAFO,EAAAA,IAAS;AAIT,WAAS,aAAc,QAAwB;AAClD,WAAO,cA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mC;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;AACpD,sBAAY;AAEZ,cAAK,GAAG,cAAe,wBAAyB,GAAI;AAChD,0BAAc;AAAA,UAClB;AAAA,QACJ;AAAA,MACJ;AAEA,aAAO;AAAA,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,YAAY,WAAoB;AAC5B,aAAO;AAAA,IACX;AAAA,EACJ;AASA,GAAE,MAAM;AACJ,8BAA0B;AAE1B,aAAS,iBAAkB,oBAAoB,MAAM;AACjD,kBAAY;AAAA,IAChB,CAAE;AAEF,QAAK,CAAC,GAAG,QAAS,OAAO,KAAM,GAAI;AAC/B,aAAO,QAAQ;AAAA,IACnB;AAAA,EACJ,GAAI;AACR,GAAI","sourcesContent":["/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file is.ts\n * @version v1.1.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 export function invalidOptionArray( array: any, minimumLength: number = 1 ) : boolean {\n return !definedArray( array ) || array.length < minimumLength;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file constant.ts\n * @version v1.1.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const PEEK_JS_IGNORE_STATE_ATTRIBUTE = \"data-peek-js-ignore-state\";\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file dom.ts\n * @version v1.1.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Constant } from \"./constant\";\nimport { Char, IgnoreState } from \"./enum\";\nimport { Is } from \"./is\";\nimport { type Position } from \"./type\";\n\n\nexport namespace DomElement {\n export function create( container: HTMLElement, type: string, className: string = Char.empty ) : HTMLElement {\n const nodeType: string = type.toLowerCase();\n const isText: boolean = nodeType === \"text\";\n\n let result: any = isText ? document.createTextNode( Char.empty ) : document.createElement( nodeType );\n\n result.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n if ( Is.defined( className ) ) {\n result.className = className;\n }\n\n container.appendChild( result );\n\n return result;\n }\n\n export function createWithHTML( container: HTMLElement, type: string, className: string, html: string ) : HTMLElement {\n const element: HTMLElement = create( container, type, className );\n element.innerHTML = html;\n element.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n return element;\n }\n\n export function cancelBubble( e: Event ) {\n e.preventDefault();\n e.cancelBubble = true;\n }\n\n export function getScrollPosition() : Position {\n const documentElement: HTMLElement = document.documentElement;\n\n const result: Position = {\n left: documentElement.scrollLeft - ( documentElement.clientLeft || 0 ),\n top: documentElement.scrollTop - ( documentElement.clientTop || 0 )\n } as Position;\n\n return result;\n }\n\n export function showElementAtMousePosition( e: any, element: HTMLElement ) {\n if ( element.style.display !== \"block\" ) {\n let left: number = e.pageX;\n let top: number = e.pageY;\n const scrollPosition: Position = getScrollPosition();\n \n element.style.display = \"block\";\n \n if ( left + element.offsetWidth > window.innerWidth ) {\n left -= element.offsetWidth;\n } else {\n left++;\n }\n \n if ( top + element.offsetHeight > window.innerHeight ) {\n top -= element.offsetHeight;\n } else {\n top++;\n }\n \n if ( left < scrollPosition.left ) {\n left = e.pageX + 1;\n }\n \n if ( top < scrollPosition.top ) {\n top = e.pageY + 1;\n }\n \n element.style.left = left + \"px\";\n element.style.top = top + \"px\";\n }\n }\n\n export function getOffset( element: HTMLElement ) : Position {\n const result: Position = {\n left: 0,\n top: 0\n } as Position;\n\n while ( element && !isNaN( element.offsetLeft ) && !isNaN( element.offsetTop ) ) {\n result.left += element.offsetLeft - element.scrollLeft;\n result.top += element.offsetTop - element.scrollTop;\n\n element = element.offsetParent as HTMLElement;\n }\n\n return result;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file data.ts\n * @version v1.1.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 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 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 getDefaultStringOrArray( value: any, defaultValue: any[] ) : any[] {\n let result: any[] = 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 * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file peek.ts\n * @version v1.1.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Position, type Configuration, type Options } from \"./ts/type\";\nimport { PublicApi } from \"./ts/api\";\nimport { Is } from \"./ts/is\";\nimport { DomElement } from \"./ts/dom\";\nimport { Data } from \"./ts/data\";\nimport { Char, IgnoreState, KeyCode, Mode, Value } from \"./ts/enum\";\nimport { Constant } from \"./ts/constant\";\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Dialog\n let _dialog: HTMLElement = null!;\n let _dialog_Title: HTMLElement = null!;\n let _dialog_Contents: HTMLElement = null!;\n let _dialog_Buttons: HTMLElement = null!;\n let _dialog_Timer: number = 0;\n\n // Variables: Current Process:\n let _current_Process_Options: Options = null!;\n let _current_Process_Elements: HTMLElement[] = [];\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialog() : void {\n if ( Is.definedObject( _dialog ) ) {\n closeDialog();\n\n document.body.removeChild( _dialog );\n _dialog = null!;\n }\n\n _dialog = DomElement.create( document.body, \"div\", \"peek-js\" );\n _dialog.onmousemove = DomElement.cancelBubble;\n\n _dialog_Title = DomElement.create( _dialog, \"div\", \"dialog-title-bar\" );\n _dialog_Contents = DomElement.create( _dialog, \"div\", \"dialog-contents\" );\n _dialog_Buttons = DomElement.create( _dialog, \"div\", \"dialog-buttons\" );\n\n const closeButton: HTMLElement = DomElement.createWithHTML( _dialog_Buttons, \"button\", \"close\", _configuration.closeText! );\n\n closeButton.onclick = () => {\n closeDialog();\n };\n }\n\n function setDialogText() : void {\n let title: string = _current_Process_Options.titleText!;\n\n if ( !Is.definedString( title ) ) {\n if ( _current_Process_Options.mode === Mode.css ) {\n title = _configuration.cssPropertiesText!;\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n title = _configuration.attributesText!;\n } else if ( _current_Process_Options.mode === Mode.size ) {\n title = _configuration.sizeText!;\n }\n }\n\n _dialog_Title.innerHTML = title;\n }\n\n function closeDialog() {\n _dialog.style.display = \"none\";\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog Content\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialogContent( element: HTMLElement ) : void {\n _dialog_Contents.innerHTML = Char.empty;\n _dialog_Contents.scrollTop = 0;\n\n if ( _current_Process_Options.mode === Mode.css ) {\n buildCssProperties( element );\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n buildAttributeProperties( element );\n } else if ( _current_Process_Options.mode === Mode.size ) {\n buildSizeProperties( element );\n }\n }\n\n function buildCssProperties( element: HTMLElement ) : void {\n const computedStyles: CSSStyleDeclaration = getComputedStyle( element );\n const computedStylesLength: number = computedStyles.length;\n\n for( let styleIndex: number = 0; styleIndex < computedStylesLength; styleIndex++ ) {\n buildPropertyRow( element, computedStyles[ styleIndex ], computedStyles.getPropertyValue( computedStyles[ styleIndex ] ) );\n }\n }\n\n function buildAttributeProperties( element: HTMLElement ) : void {\n if ( element.hasAttributes() ) {\n for ( let attribute of element.attributes ) {\n buildPropertyRow( element, attribute.name, attribute.value );\n }\n\n } else {\n _dialog_Contents.innerHTML = _configuration.noAttributesAvailableText!;\n }\n }\n\n function buildSizeProperties( element: HTMLElement ) : void {\n const offset: Position = DomElement.getOffset( element );\n\n buildPropertyRow( element, \"left\", offset.left.toString() + \"px\", false );\n buildPropertyRow( element, \"top\", offset.top.toString() + \"px\", false );\n buildPropertyRow( element, \"width\", element.offsetWidth.toString() + \"px\", false );\n buildPropertyRow( element, \"height\", element.offsetHeight.toString() + \"px\", false );\n }\n\n function buildPropertyRow( element: HTMLElement, propertyNameText: string, propertyValueText: string, allowEditing: boolean = true ) : void {\n if ( _current_Process_Options.showOnly!.length === 0 || _current_Process_Options.showOnly!.indexOf( propertyNameText ) > Value.notFound ) {\n const property: HTMLElement = DomElement.create( _dialog_Contents, \"div\", \"property-row\" );\n\n DomElement.createWithHTML( property, \"div\", \"property-name\", propertyNameText );\n \n const propertyValue: HTMLElement = DomElement.create( property, \"div\", \"property-value\" );\n const propertyValueInput: HTMLInputElement = DomElement.create( propertyValue, \"input\" ) as HTMLInputElement;\n \n propertyValueInput.type = \"text\";\n propertyValueInput.value = propertyValueText;\n\n if ( !_current_Process_Options.allowEditing || !allowEditing ) {\n propertyValueInput.readOnly = true;\n } else {\n propertyValueInput.onkeyup = ( e: KeyboardEvent ) => {\n onPropertyValueKeyUp( e, propertyNameText, propertyValueInput, element );\n }\n }\n }\n }\n\n function onPropertyValueKeyUp( e: KeyboardEvent, propertyName: string, input: HTMLInputElement, element: HTMLElement ) {\n if ( e.code === KeyCode.enter ) {\n element.style.setProperty( propertyName, input.value );\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Node Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildNodeEvents() : void {\n const tagTypes: string[] = _current_Process_Options.nodeType 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 buildNodeEvent( elements[ elementIndex ] );\n }\n }\n\n window.addEventListener( \"mousemove\", closeDialog );\n }\n\n function buildNodeEvent( element: HTMLElement ) : void {\n const attributeValue: string = element.getAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE )!;\n\n if ( !Is.definedString( attributeValue ) ?? attributeValue !== IgnoreState.ignore ) {\n element.addEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n \n _current_Process_Elements.push( element );\n }\n }\n\n function removeNodeEvents() : void {\n const currentProcessElementsLength: number = _current_Process_Elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < currentProcessElementsLength; elementIndex++ ) {\n var element: HTMLElement = _current_Process_Elements[ elementIndex ];\n\n element.removeEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n }\n\n _current_Process_Elements = [] as HTMLElement[];\n\n window.removeEventListener( \"mousemove\", closeDialog );\n\n closeDialog();\n }\n\n function onNodeMouseOver( e: MouseEvent, element: HTMLElement ) {\n DomElement.cancelBubble( e );\n \n if ( _dialog_Timer !== 0 ) {\n clearTimeout( _dialog_Timer );\n _dialog_Timer = 0;\n }\n\n _dialog_Timer = setTimeout( () => {\n buildDialogContent( element );\n\n DomElement.showElementAtMousePosition( e, _dialog );\n }, _configuration.dialogDisplayDelay );\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildOptions( newOptions: any ) : Options {\n let options: Options = Data.getDefaultObject( newOptions, {} as Options );\n options.nodeType = Data.getDefaultStringOrArray( options.nodeType, [] );\n options.mode = Data.getDefaultNumber( options.mode, Mode.css );\n options.titleText = Data.getDefaultString( options.titleText, Char.empty );\n options.showOnly = Data.getDefaultStringOrArray( options.showOnly, [] );\n options.allowEditing = Data.getDefaultBoolean( options.allowEditing, false );\n\n return options;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: Configuration = null! ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.dialogDisplayDelay = Data.getDefaultNumber( _configuration.dialogDisplayDelay, 1000 );\n\n buildDefaultStringConfiguration();\n }\n\n function buildDefaultStringConfiguration() : void {\n _configuration.cssPropertiesText = Data.getDefaultAnyString( _configuration.cssPropertiesText, \"CSS Properties\" );\n _configuration.attributesText = Data.getDefaultAnyString( _configuration.attributesText, \"Attributes\" );\n _configuration.sizeText = Data.getDefaultAnyString( _configuration.sizeText, \"Size\" );\n _configuration.noAttributesAvailableText = Data.getDefaultAnyString( _configuration.noAttributesAvailableText, \"No attributes are available.\" );\n _configuration.closeText = Data.getDefaultAnyString( _configuration.closeText, \"Close\" );\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: Running\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n start: function ( options: Options ): PublicApi {\n if ( !Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = buildOptions( options );\n\n setDialogText();\n buildNodeEvents();\n }\n\n return _public;\n },\n\n stop: function (): PublicApi {\n if ( Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = null!;\n\n removeNodeEvents();\n }\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 buildDialog();\n\n if ( Is.definedObject( _current_Process_Options ) ) {\n setDialogText();\n }\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.1.0\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Heat.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", () => {\n buildDialog();\n } );\n\n if ( !Is.defined( window.$peek ) ) {\n window.$peek = _public;\n }\n } )();\n} )();"]} \ No newline at end of file +{"version":3,"sources":["../src/ts/is.ts","../src/ts/constant.ts","../src/ts/dom.ts","../src/ts/data.ts","../src/peek.ts"],"names":["Is","Constant","DomElement","Data"],"mappings":";AAgBO,IAAU;AAAA,CAAV,CAAUA,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,WA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AAAA;AAAA;AAAA,IAOvB,OAAO,SAAW,SAA8B;AAC5C,UAAK,CAAC,GAAG,cAAe,wBAAyB,GAAI;AACjD,mCAA2B,aAAc,OAAQ;AAEjD,sBAAc;AACd,wBAAgB;AAAA,MACpB;AAEA,aAAO;AAAA,IACX;AAAA,IAEA,MAAM,WAAuB;AACzB,UAAK,GAAG,cAAe,wBAAyB,GAAI;AAChD,mCAA2B;AAE3B,yBAAiB;AAAA,MACrB;AAEA,aAAO;AAAA,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,kBAAkB,SAAW,kBAAmC;AAC5D,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;AACpD,sBAAY;AAEZ,cAAK,GAAG,cAAe,wBAAyB,GAAI;AAChD,0BAAc;AAAA,UAClB;AAAA,QACJ;AAAA,MACJ;AAEA,aAAO;AAAA,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,YAAY,WAAoB;AAC5B,aAAO;AAAA,IACX;AAAA,EACJ;AASA,GAAE,MAAM;AACJ,8BAA0B;AAE1B,aAAS,iBAAkB,oBAAoB,MAAM;AACjD,kBAAY;AAAA,IAChB,CAAE;AAEF,QAAK,CAAC,GAAG,QAAS,OAAO,KAAM,GAAI;AAC/B,aAAO,QAAQ;AAAA,IACnB;AAAA,EACJ,GAAI;AACR,GAAI","sourcesContent":["/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file is.ts\n * @version v1.1.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 export function invalidOptionArray( array: any, minimumLength: number = 1 ) : boolean {\n return !definedArray( array ) || array.length < minimumLength;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file constant.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const PEEK_JS_IGNORE_STATE_ATTRIBUTE = \"data-peek-js-ignore-state\";\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file dom.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Constant } from \"./constant\";\nimport { Char, IgnoreState } from \"./enum\";\nimport { Is } from \"./is\";\nimport { type Position } from \"./type\";\n\n\nexport namespace DomElement {\n export function create( container: HTMLElement, type: string, className: string = Char.empty ) : HTMLElement {\n const nodeType: string = type.toLowerCase();\n const isText: boolean = nodeType === \"text\";\n\n let result: any = isText ? document.createTextNode( Char.empty ) : document.createElement( nodeType );\n\n result.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n if ( Is.defined( className ) ) {\n result.className = className;\n }\n\n container.appendChild( result );\n\n return result;\n }\n\n export function createWithHTML( container: HTMLElement, type: string, className: string, html: string ) : HTMLElement {\n const element: HTMLElement = create( container, type, className );\n element.innerHTML = html;\n element.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n return element;\n }\n\n export function cancelBubble( e: Event ) {\n e.preventDefault();\n e.cancelBubble = true;\n }\n\n export function getScrollPosition() : Position {\n const documentElement: HTMLElement = document.documentElement;\n\n const result: Position = {\n left: documentElement.scrollLeft - ( documentElement.clientLeft || 0 ),\n top: documentElement.scrollTop - ( documentElement.clientTop || 0 )\n } as Position;\n\n return result;\n }\n\n export function showElementAtMousePosition( e: any, element: HTMLElement ) {\n if ( element.style.display !== \"block\" ) {\n let left: number = e.pageX;\n let top: number = e.pageY;\n const scrollPosition: Position = getScrollPosition();\n \n element.style.display = \"block\";\n \n if ( left + element.offsetWidth > window.innerWidth ) {\n left -= element.offsetWidth;\n } else {\n left++;\n }\n \n if ( top + element.offsetHeight > window.innerHeight ) {\n top -= element.offsetHeight;\n } else {\n top++;\n }\n \n if ( left < scrollPosition.left ) {\n left = e.pageX + 1;\n }\n \n if ( top < scrollPosition.top ) {\n top = e.pageY + 1;\n }\n \n element.style.left = left + \"px\";\n element.style.top = top + \"px\";\n }\n }\n\n export function getOffset( element: HTMLElement ) : Position {\n const result: Position = {\n left: 0,\n top: 0\n } as Position;\n\n while ( element && !isNaN( element.offsetLeft ) && !isNaN( element.offsetTop ) ) {\n result.left += element.offsetLeft - element.scrollLeft;\n result.top += element.offsetTop - element.scrollTop;\n\n element = element.offsetParent as HTMLElement;\n }\n\n return result;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file data.ts\n * @version v1.1.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 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 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 getDefaultStringOrArray( value: any, defaultValue: any[] ) : any[] {\n let result: any[] = 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 * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file peek.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Position, type Configuration, type Options } from \"./ts/type\";\nimport { PublicApi } from \"./ts/api\";\nimport { Is } from \"./ts/is\";\nimport { DomElement } from \"./ts/dom\";\nimport { Data } from \"./ts/data\";\nimport { Char, IgnoreState, KeyCode, Mode, Value } from \"./ts/enum\";\nimport { Constant } from \"./ts/constant\";\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Dialog\n let _dialog: HTMLElement = null!;\n let _dialog_Title: HTMLElement = null!;\n let _dialog_Contents: HTMLElement = null!;\n let _dialog_Buttons: HTMLElement = null!;\n let _dialog_Timer: number = 0;\n\n // Variables: Current Process:\n let _current_Process_Options: Options = null!;\n let _current_Process_Elements: HTMLElement[] = [];\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialog() : void {\n if ( Is.definedObject( _dialog ) ) {\n closeDialog();\n\n document.body.removeChild( _dialog );\n _dialog = null!;\n }\n\n _dialog = DomElement.create( document.body, \"div\", \"peek-js\" );\n _dialog.onmousemove = DomElement.cancelBubble;\n\n _dialog_Title = DomElement.create( _dialog, \"div\", \"dialog-title-bar\" );\n _dialog_Contents = DomElement.create( _dialog, \"div\", \"dialog-contents\" );\n _dialog_Buttons = DomElement.create( _dialog, \"div\", \"dialog-buttons\" );\n\n const closeButton: HTMLElement = DomElement.createWithHTML( _dialog_Buttons, \"button\", \"close\", _configuration.closeText! );\n\n closeButton.onclick = () => {\n closeDialog();\n };\n }\n\n function setDialogText() : void {\n let title: string = _current_Process_Options.titleText!;\n\n if ( !Is.definedString( title ) ) {\n if ( _current_Process_Options.mode === Mode.css ) {\n title = _configuration.cssPropertiesText!;\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n title = _configuration.attributesText!;\n } else if ( _current_Process_Options.mode === Mode.size ) {\n title = _configuration.sizeText!;\n }\n }\n\n _dialog_Title.innerHTML = title;\n }\n\n function closeDialog() {\n _dialog.style.display = \"none\";\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog Content\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialogContent( element: HTMLElement ) : void {\n _dialog_Contents.innerHTML = Char.empty;\n _dialog_Contents.scrollTop = 0;\n\n if ( _current_Process_Options.mode === Mode.css ) {\n buildCssProperties( element );\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n buildAttributeProperties( element );\n } else if ( _current_Process_Options.mode === Mode.size ) {\n buildSizeProperties( element );\n }\n }\n\n function buildCssProperties( element: HTMLElement ) : void {\n const computedStyles: CSSStyleDeclaration = getComputedStyle( element );\n const computedStylesLength: number = computedStyles.length;\n\n for( let styleIndex: number = 0; styleIndex < computedStylesLength; styleIndex++ ) {\n buildPropertyRow( element, computedStyles[ styleIndex ], computedStyles.getPropertyValue( computedStyles[ styleIndex ] ) );\n }\n }\n\n function buildAttributeProperties( element: HTMLElement ) : void {\n if ( element.hasAttributes() ) {\n for ( let attribute of element.attributes ) {\n buildPropertyRow( element, attribute.name, attribute.value );\n }\n\n } else {\n _dialog_Contents.innerHTML = _configuration.noAttributesAvailableText!;\n }\n }\n\n function buildSizeProperties( element: HTMLElement ) : void {\n const offset: Position = DomElement.getOffset( element );\n\n buildPropertyRow( element, \"left\", offset.left.toString() + \"px\", false );\n buildPropertyRow( element, \"top\", offset.top.toString() + \"px\", false );\n buildPropertyRow( element, \"width\", element.offsetWidth.toString() + \"px\", false );\n buildPropertyRow( element, \"height\", element.offsetHeight.toString() + \"px\", false );\n }\n\n function buildPropertyRow( element: HTMLElement, propertyNameText: string, propertyValueText: string, allowEditing: boolean = true ) : void {\n if ( _current_Process_Options.showOnly!.length === 0 || _current_Process_Options.showOnly!.indexOf( propertyNameText ) > Value.notFound ) {\n const property: HTMLElement = DomElement.create( _dialog_Contents, \"div\", \"property-row\" );\n\n DomElement.createWithHTML( property, \"div\", \"property-name\", propertyNameText );\n \n const propertyValue: HTMLElement = DomElement.create( property, \"div\", \"property-value\" );\n const propertyValueInput: HTMLInputElement = DomElement.create( propertyValue, \"input\" ) as HTMLInputElement;\n \n propertyValueInput.type = \"text\";\n propertyValueInput.value = propertyValueText;\n\n if ( !_current_Process_Options.allowEditing || !allowEditing ) {\n propertyValueInput.readOnly = true;\n } else {\n propertyValueInput.onkeyup = ( e: KeyboardEvent ) => {\n onPropertyValueKeyUp( e, propertyNameText, propertyValueInput, element );\n }\n }\n }\n }\n\n function onPropertyValueKeyUp( e: KeyboardEvent, propertyName: string, input: HTMLInputElement, element: HTMLElement ) {\n if ( e.code === KeyCode.enter ) {\n element.style.setProperty( propertyName, input.value );\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Node Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildNodeEvents() : void {\n const tagTypes: string[] = _current_Process_Options.nodeType 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 buildNodeEvent( elements[ elementIndex ] );\n }\n }\n\n window.addEventListener( \"mousemove\", closeDialog );\n }\n\n function buildNodeEvent( element: HTMLElement ) : void {\n const attributeValue: string = element.getAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE )!;\n\n if ( !Is.definedString( attributeValue ) ?? attributeValue !== IgnoreState.ignore ) {\n element.addEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n \n _current_Process_Elements.push( element );\n }\n }\n\n function removeNodeEvents() : void {\n const currentProcessElementsLength: number = _current_Process_Elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < currentProcessElementsLength; elementIndex++ ) {\n var element: HTMLElement = _current_Process_Elements[ elementIndex ];\n\n element.removeEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n }\n\n _current_Process_Elements = [] as HTMLElement[];\n\n window.removeEventListener( \"mousemove\", closeDialog );\n\n closeDialog();\n }\n\n function onNodeMouseOver( e: MouseEvent, element: HTMLElement ) {\n DomElement.cancelBubble( e );\n \n if ( _dialog_Timer !== 0 ) {\n clearTimeout( _dialog_Timer );\n _dialog_Timer = 0;\n }\n\n _dialog_Timer = setTimeout( () => {\n buildDialogContent( element );\n\n DomElement.showElementAtMousePosition( e, _dialog );\n }, _configuration.dialogDisplayDelay );\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildOptions( newOptions: any ) : Options {\n let options: Options = Data.getDefaultObject( newOptions, {} as Options );\n options.nodeType = Data.getDefaultStringOrArray( options.nodeType, [] );\n options.mode = Data.getDefaultNumber( options.mode, Mode.css );\n options.titleText = Data.getDefaultString( options.titleText, Char.empty );\n options.showOnly = Data.getDefaultStringOrArray( options.showOnly, [] );\n options.allowEditing = Data.getDefaultBoolean( options.allowEditing, false );\n\n return options;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: Configuration = null! ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.dialogDisplayDelay = Data.getDefaultNumber( _configuration.dialogDisplayDelay, 1000 );\n\n buildDefaultStringConfiguration();\n }\n\n function buildDefaultStringConfiguration() : void {\n _configuration.cssPropertiesText = Data.getDefaultAnyString( _configuration.cssPropertiesText, \"CSS Properties\" );\n _configuration.attributesText = Data.getDefaultAnyString( _configuration.attributesText, \"Attributes\" );\n _configuration.sizeText = Data.getDefaultAnyString( _configuration.sizeText, \"Size\" );\n _configuration.noAttributesAvailableText = Data.getDefaultAnyString( _configuration.noAttributesAvailableText, \"No attributes are available.\" );\n _configuration.closeText = Data.getDefaultAnyString( _configuration.closeText, \"Close\" );\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: Running\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n start: function ( options: Options ): PublicApi {\n if ( !Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = buildOptions( options );\n\n setDialogText();\n buildNodeEvents();\n }\n\n return _public;\n },\n\n stop: function (): PublicApi {\n if ( Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = null!;\n\n removeNodeEvents();\n }\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 buildDialog();\n\n if ( Is.definedObject( _current_Process_Options ) ) {\n setDialogText();\n }\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.1.1\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Heat.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", () => {\n buildDialog();\n } );\n\n if ( !Is.defined( window.$peek ) ) {\n window.$peek = _public;\n }\n } )();\n} )();"]} \ No newline at end of file diff --git a/dist/peek.js b/dist/peek.js index 7436090..5ed4824 100644 --- a/dist/peek.js +++ b/dist/peek.js @@ -369,7 +369,7 @@ var o; return L; }, getVersion: function() { - return "1.1.0"; + return "1.1.1"; } }; (() => { diff --git a/dist/peek.js.css b/dist/peek.js.css index 0f18239..c9d483c 100644 --- a/dist/peek.js.css +++ b/dist/peek.js.css @@ -1,5 +1,5 @@ /* - * Peek.js Library v1.1.0 + * Peek.js Library v1.1.1 * * Copyright 2024 Bunoon * Released under the MIT License diff --git a/dist/peek.js.map b/dist/peek.js.map index 27567ce..6c630bc 100644 --- a/dist/peek.js.map +++ b/dist/peek.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/ts/is.ts","../src/ts/constant.ts","../src/ts/dom.ts","../src/ts/data.ts","../src/peek.ts"],"names":["Is","Constant","DomElement","Data"],"mappings":";;;AAgBO,IAAU;AAAA,CAAV,CAAUA,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,KAAK,OAAO,WAAW;AAAA,EAClD;AAFO,EAAAA,IAA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AAG,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;AACpD,sBAAY;AAEZ,cAAK,GAAG,cAAe,wBAAyB,GAAI;AAChD,0BAAc;AAAA,UAClB;AAAA,QACJ;AAAA,MACJ;AAEA,aAAO;AAAA,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,YAAY,WAAoB;AAC5B,aAAO;AAAA,IACX;AAAA,EACJ;AASA,GAAE,MAAM;AACJ,8BAA0B;AAE1B,aAAS,iBAAkB,oBAAoB,MAAM;AACjD,kBAAY;AAAA,IAChB,CAAE;AAEF,QAAK,CAAC,GAAG,QAAS,OAAO,KAAM,GAAI;AAC/B,aAAO,QAAQ;AAAA,IACnB;AAAA,EACJ,GAAI;AACR,GAAI","sourcesContent":["/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file is.ts\n * @version v1.1.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 export function invalidOptionArray( array: any, minimumLength: number = 1 ) : boolean {\n return !definedArray( array ) || array.length < minimumLength;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file constant.ts\n * @version v1.1.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const PEEK_JS_IGNORE_STATE_ATTRIBUTE = \"data-peek-js-ignore-state\";\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file dom.ts\n * @version v1.1.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Constant } from \"./constant\";\nimport { Char, IgnoreState } from \"./enum\";\nimport { Is } from \"./is\";\nimport { type Position } from \"./type\";\n\n\nexport namespace DomElement {\n export function create( container: HTMLElement, type: string, className: string = Char.empty ) : HTMLElement {\n const nodeType: string = type.toLowerCase();\n const isText: boolean = nodeType === \"text\";\n\n let result: any = isText ? document.createTextNode( Char.empty ) : document.createElement( nodeType );\n\n result.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n if ( Is.defined( className ) ) {\n result.className = className;\n }\n\n container.appendChild( result );\n\n return result;\n }\n\n export function createWithHTML( container: HTMLElement, type: string, className: string, html: string ) : HTMLElement {\n const element: HTMLElement = create( container, type, className );\n element.innerHTML = html;\n element.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n return element;\n }\n\n export function cancelBubble( e: Event ) {\n e.preventDefault();\n e.cancelBubble = true;\n }\n\n export function getScrollPosition() : Position {\n const documentElement: HTMLElement = document.documentElement;\n\n const result: Position = {\n left: documentElement.scrollLeft - ( documentElement.clientLeft || 0 ),\n top: documentElement.scrollTop - ( documentElement.clientTop || 0 )\n } as Position;\n\n return result;\n }\n\n export function showElementAtMousePosition( e: any, element: HTMLElement ) {\n if ( element.style.display !== \"block\" ) {\n let left: number = e.pageX;\n let top: number = e.pageY;\n const scrollPosition: Position = getScrollPosition();\n \n element.style.display = \"block\";\n \n if ( left + element.offsetWidth > window.innerWidth ) {\n left -= element.offsetWidth;\n } else {\n left++;\n }\n \n if ( top + element.offsetHeight > window.innerHeight ) {\n top -= element.offsetHeight;\n } else {\n top++;\n }\n \n if ( left < scrollPosition.left ) {\n left = e.pageX + 1;\n }\n \n if ( top < scrollPosition.top ) {\n top = e.pageY + 1;\n }\n \n element.style.left = left + \"px\";\n element.style.top = top + \"px\";\n }\n }\n\n export function getOffset( element: HTMLElement ) : Position {\n const result: Position = {\n left: 0,\n top: 0\n } as Position;\n\n while ( element && !isNaN( element.offsetLeft ) && !isNaN( element.offsetTop ) ) {\n result.left += element.offsetLeft - element.scrollLeft;\n result.top += element.offsetTop - element.scrollTop;\n\n element = element.offsetParent as HTMLElement;\n }\n\n return result;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file data.ts\n * @version v1.1.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 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 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 getDefaultStringOrArray( value: any, defaultValue: any[] ) : any[] {\n let result: any[] = 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 * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file peek.ts\n * @version v1.1.0\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Position, type Configuration, type Options } from \"./ts/type\";\nimport { PublicApi } from \"./ts/api\";\nimport { Is } from \"./ts/is\";\nimport { DomElement } from \"./ts/dom\";\nimport { Data } from \"./ts/data\";\nimport { Char, IgnoreState, KeyCode, Mode, Value } from \"./ts/enum\";\nimport { Constant } from \"./ts/constant\";\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Dialog\n let _dialog: HTMLElement = null!;\n let _dialog_Title: HTMLElement = null!;\n let _dialog_Contents: HTMLElement = null!;\n let _dialog_Buttons: HTMLElement = null!;\n let _dialog_Timer: number = 0;\n\n // Variables: Current Process:\n let _current_Process_Options: Options = null!;\n let _current_Process_Elements: HTMLElement[] = [];\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialog() : void {\n if ( Is.definedObject( _dialog ) ) {\n closeDialog();\n\n document.body.removeChild( _dialog );\n _dialog = null!;\n }\n\n _dialog = DomElement.create( document.body, \"div\", \"peek-js\" );\n _dialog.onmousemove = DomElement.cancelBubble;\n\n _dialog_Title = DomElement.create( _dialog, \"div\", \"dialog-title-bar\" );\n _dialog_Contents = DomElement.create( _dialog, \"div\", \"dialog-contents\" );\n _dialog_Buttons = DomElement.create( _dialog, \"div\", \"dialog-buttons\" );\n\n const closeButton: HTMLElement = DomElement.createWithHTML( _dialog_Buttons, \"button\", \"close\", _configuration.closeText! );\n\n closeButton.onclick = () => {\n closeDialog();\n };\n }\n\n function setDialogText() : void {\n let title: string = _current_Process_Options.titleText!;\n\n if ( !Is.definedString( title ) ) {\n if ( _current_Process_Options.mode === Mode.css ) {\n title = _configuration.cssPropertiesText!;\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n title = _configuration.attributesText!;\n } else if ( _current_Process_Options.mode === Mode.size ) {\n title = _configuration.sizeText!;\n }\n }\n\n _dialog_Title.innerHTML = title;\n }\n\n function closeDialog() {\n _dialog.style.display = \"none\";\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog Content\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialogContent( element: HTMLElement ) : void {\n _dialog_Contents.innerHTML = Char.empty;\n _dialog_Contents.scrollTop = 0;\n\n if ( _current_Process_Options.mode === Mode.css ) {\n buildCssProperties( element );\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n buildAttributeProperties( element );\n } else if ( _current_Process_Options.mode === Mode.size ) {\n buildSizeProperties( element );\n }\n }\n\n function buildCssProperties( element: HTMLElement ) : void {\n const computedStyles: CSSStyleDeclaration = getComputedStyle( element );\n const computedStylesLength: number = computedStyles.length;\n\n for( let styleIndex: number = 0; styleIndex < computedStylesLength; styleIndex++ ) {\n buildPropertyRow( element, computedStyles[ styleIndex ], computedStyles.getPropertyValue( computedStyles[ styleIndex ] ) );\n }\n }\n\n function buildAttributeProperties( element: HTMLElement ) : void {\n if ( element.hasAttributes() ) {\n for ( let attribute of element.attributes ) {\n buildPropertyRow( element, attribute.name, attribute.value );\n }\n\n } else {\n _dialog_Contents.innerHTML = _configuration.noAttributesAvailableText!;\n }\n }\n\n function buildSizeProperties( element: HTMLElement ) : void {\n const offset: Position = DomElement.getOffset( element );\n\n buildPropertyRow( element, \"left\", offset.left.toString() + \"px\", false );\n buildPropertyRow( element, \"top\", offset.top.toString() + \"px\", false );\n buildPropertyRow( element, \"width\", element.offsetWidth.toString() + \"px\", false );\n buildPropertyRow( element, \"height\", element.offsetHeight.toString() + \"px\", false );\n }\n\n function buildPropertyRow( element: HTMLElement, propertyNameText: string, propertyValueText: string, allowEditing: boolean = true ) : void {\n if ( _current_Process_Options.showOnly!.length === 0 || _current_Process_Options.showOnly!.indexOf( propertyNameText ) > Value.notFound ) {\n const property: HTMLElement = DomElement.create( _dialog_Contents, \"div\", \"property-row\" );\n\n DomElement.createWithHTML( property, \"div\", \"property-name\", propertyNameText );\n \n const propertyValue: HTMLElement = DomElement.create( property, \"div\", \"property-value\" );\n const propertyValueInput: HTMLInputElement = DomElement.create( propertyValue, \"input\" ) as HTMLInputElement;\n \n propertyValueInput.type = \"text\";\n propertyValueInput.value = propertyValueText;\n\n if ( !_current_Process_Options.allowEditing || !allowEditing ) {\n propertyValueInput.readOnly = true;\n } else {\n propertyValueInput.onkeyup = ( e: KeyboardEvent ) => {\n onPropertyValueKeyUp( e, propertyNameText, propertyValueInput, element );\n }\n }\n }\n }\n\n function onPropertyValueKeyUp( e: KeyboardEvent, propertyName: string, input: HTMLInputElement, element: HTMLElement ) {\n if ( e.code === KeyCode.enter ) {\n element.style.setProperty( propertyName, input.value );\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Node Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildNodeEvents() : void {\n const tagTypes: string[] = _current_Process_Options.nodeType 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 buildNodeEvent( elements[ elementIndex ] );\n }\n }\n\n window.addEventListener( \"mousemove\", closeDialog );\n }\n\n function buildNodeEvent( element: HTMLElement ) : void {\n const attributeValue: string = element.getAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE )!;\n\n if ( !Is.definedString( attributeValue ) ?? attributeValue !== IgnoreState.ignore ) {\n element.addEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n \n _current_Process_Elements.push( element );\n }\n }\n\n function removeNodeEvents() : void {\n const currentProcessElementsLength: number = _current_Process_Elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < currentProcessElementsLength; elementIndex++ ) {\n var element: HTMLElement = _current_Process_Elements[ elementIndex ];\n\n element.removeEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n }\n\n _current_Process_Elements = [] as HTMLElement[];\n\n window.removeEventListener( \"mousemove\", closeDialog );\n\n closeDialog();\n }\n\n function onNodeMouseOver( e: MouseEvent, element: HTMLElement ) {\n DomElement.cancelBubble( e );\n \n if ( _dialog_Timer !== 0 ) {\n clearTimeout( _dialog_Timer );\n _dialog_Timer = 0;\n }\n\n _dialog_Timer = setTimeout( () => {\n buildDialogContent( element );\n\n DomElement.showElementAtMousePosition( e, _dialog );\n }, _configuration.dialogDisplayDelay );\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildOptions( newOptions: any ) : Options {\n let options: Options = Data.getDefaultObject( newOptions, {} as Options );\n options.nodeType = Data.getDefaultStringOrArray( options.nodeType, [] );\n options.mode = Data.getDefaultNumber( options.mode, Mode.css );\n options.titleText = Data.getDefaultString( options.titleText, Char.empty );\n options.showOnly = Data.getDefaultStringOrArray( options.showOnly, [] );\n options.allowEditing = Data.getDefaultBoolean( options.allowEditing, false );\n\n return options;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: Configuration = null! ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.dialogDisplayDelay = Data.getDefaultNumber( _configuration.dialogDisplayDelay, 1000 );\n\n buildDefaultStringConfiguration();\n }\n\n function buildDefaultStringConfiguration() : void {\n _configuration.cssPropertiesText = Data.getDefaultAnyString( _configuration.cssPropertiesText, \"CSS Properties\" );\n _configuration.attributesText = Data.getDefaultAnyString( _configuration.attributesText, \"Attributes\" );\n _configuration.sizeText = Data.getDefaultAnyString( _configuration.sizeText, \"Size\" );\n _configuration.noAttributesAvailableText = Data.getDefaultAnyString( _configuration.noAttributesAvailableText, \"No attributes are available.\" );\n _configuration.closeText = Data.getDefaultAnyString( _configuration.closeText, \"Close\" );\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: Running\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n start: function ( options: Options ): PublicApi {\n if ( !Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = buildOptions( options );\n\n setDialogText();\n buildNodeEvents();\n }\n\n return _public;\n },\n\n stop: function (): PublicApi {\n if ( Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = null!;\n\n removeNodeEvents();\n }\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 buildDialog();\n\n if ( Is.definedObject( _current_Process_Options ) ) {\n setDialogText();\n }\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.1.0\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Heat.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", () => {\n buildDialog();\n } );\n\n if ( !Is.defined( window.$peek ) ) {\n window.$peek = _public;\n }\n } )();\n} )();"]} \ No newline at end of file +{"version":3,"sources":["../src/ts/is.ts","../src/ts/constant.ts","../src/ts/dom.ts","../src/ts/data.ts","../src/peek.ts"],"names":["Is","Constant","DomElement","Data"],"mappings":";;;AAgBO,IAAU;AAAA,CAAV,CAAUA,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,W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a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file is.ts\n * @version v1.1.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 export function invalidOptionArray( array: any, minimumLength: number = 1 ) : boolean {\n return !definedArray( array ) || array.length < minimumLength;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file constant.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const PEEK_JS_IGNORE_STATE_ATTRIBUTE = \"data-peek-js-ignore-state\";\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file dom.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Constant } from \"./constant\";\nimport { Char, IgnoreState } from \"./enum\";\nimport { Is } from \"./is\";\nimport { type Position } from \"./type\";\n\n\nexport namespace DomElement {\n export function create( container: HTMLElement, type: string, className: string = Char.empty ) : HTMLElement {\n const nodeType: string = type.toLowerCase();\n const isText: boolean = nodeType === \"text\";\n\n let result: any = isText ? document.createTextNode( Char.empty ) : document.createElement( nodeType );\n\n result.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n if ( Is.defined( className ) ) {\n result.className = className;\n }\n\n container.appendChild( result );\n\n return result;\n }\n\n export function createWithHTML( container: HTMLElement, type: string, className: string, html: string ) : HTMLElement {\n const element: HTMLElement = create( container, type, className );\n element.innerHTML = html;\n element.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n return element;\n }\n\n export function cancelBubble( e: Event ) {\n e.preventDefault();\n e.cancelBubble = true;\n }\n\n export function getScrollPosition() : Position {\n const documentElement: HTMLElement = document.documentElement;\n\n const result: Position = {\n left: documentElement.scrollLeft - ( documentElement.clientLeft || 0 ),\n top: documentElement.scrollTop - ( documentElement.clientTop || 0 )\n } as Position;\n\n return result;\n }\n\n export function showElementAtMousePosition( e: any, element: HTMLElement ) {\n if ( element.style.display !== \"block\" ) {\n let left: number = e.pageX;\n let top: number = e.pageY;\n const scrollPosition: Position = getScrollPosition();\n \n element.style.display = \"block\";\n \n if ( left + element.offsetWidth > window.innerWidth ) {\n left -= element.offsetWidth;\n } else {\n left++;\n }\n \n if ( top + element.offsetHeight > window.innerHeight ) {\n top -= element.offsetHeight;\n } else {\n top++;\n }\n \n if ( left < scrollPosition.left ) {\n left = e.pageX + 1;\n }\n \n if ( top < scrollPosition.top ) {\n top = e.pageY + 1;\n }\n \n element.style.left = left + \"px\";\n element.style.top = top + \"px\";\n }\n }\n\n export function getOffset( element: HTMLElement ) : Position {\n const result: Position = {\n left: 0,\n top: 0\n } as Position;\n\n while ( element && !isNaN( element.offsetLeft ) && !isNaN( element.offsetTop ) ) {\n result.left += element.offsetLeft - element.scrollLeft;\n result.top += element.offsetTop - element.scrollTop;\n\n element = element.offsetParent as HTMLElement;\n }\n\n return result;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file data.ts\n * @version v1.1.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 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 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 getDefaultStringOrArray( value: any, defaultValue: any[] ) : any[] {\n let result: any[] = 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 * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file peek.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Position, type Configuration, type Options } from \"./ts/type\";\nimport { PublicApi } from \"./ts/api\";\nimport { Is } from \"./ts/is\";\nimport { DomElement } from \"./ts/dom\";\nimport { Data } from \"./ts/data\";\nimport { Char, IgnoreState, KeyCode, Mode, Value } from \"./ts/enum\";\nimport { Constant } from \"./ts/constant\";\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Dialog\n let _dialog: HTMLElement = null!;\n let _dialog_Title: HTMLElement = null!;\n let _dialog_Contents: HTMLElement = null!;\n let _dialog_Buttons: HTMLElement = null!;\n let _dialog_Timer: number = 0;\n\n // Variables: Current Process:\n let _current_Process_Options: Options = null!;\n let _current_Process_Elements: HTMLElement[] = [];\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialog() : void {\n if ( Is.definedObject( _dialog ) ) {\n closeDialog();\n\n document.body.removeChild( _dialog );\n _dialog = null!;\n }\n\n _dialog = DomElement.create( document.body, \"div\", \"peek-js\" );\n _dialog.onmousemove = DomElement.cancelBubble;\n\n _dialog_Title = DomElement.create( _dialog, \"div\", \"dialog-title-bar\" );\n _dialog_Contents = DomElement.create( _dialog, \"div\", \"dialog-contents\" );\n _dialog_Buttons = DomElement.create( _dialog, \"div\", \"dialog-buttons\" );\n\n const closeButton: HTMLElement = DomElement.createWithHTML( _dialog_Buttons, \"button\", \"close\", _configuration.closeText! );\n\n closeButton.onclick = () => {\n closeDialog();\n };\n }\n\n function setDialogText() : void {\n let title: string = _current_Process_Options.titleText!;\n\n if ( !Is.definedString( title ) ) {\n if ( _current_Process_Options.mode === Mode.css ) {\n title = _configuration.cssPropertiesText!;\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n title = _configuration.attributesText!;\n } else if ( _current_Process_Options.mode === Mode.size ) {\n title = _configuration.sizeText!;\n }\n }\n\n _dialog_Title.innerHTML = title;\n }\n\n function closeDialog() {\n _dialog.style.display = \"none\";\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog Content\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialogContent( element: HTMLElement ) : void {\n _dialog_Contents.innerHTML = Char.empty;\n _dialog_Contents.scrollTop = 0;\n\n if ( _current_Process_Options.mode === Mode.css ) {\n buildCssProperties( element );\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n buildAttributeProperties( element );\n } else if ( _current_Process_Options.mode === Mode.size ) {\n buildSizeProperties( element );\n }\n }\n\n function buildCssProperties( element: HTMLElement ) : void {\n const computedStyles: CSSStyleDeclaration = getComputedStyle( element );\n const computedStylesLength: number = computedStyles.length;\n\n for( let styleIndex: number = 0; styleIndex < computedStylesLength; styleIndex++ ) {\n buildPropertyRow( element, computedStyles[ styleIndex ], computedStyles.getPropertyValue( computedStyles[ styleIndex ] ) );\n }\n }\n\n function buildAttributeProperties( element: HTMLElement ) : void {\n if ( element.hasAttributes() ) {\n for ( let attribute of element.attributes ) {\n buildPropertyRow( element, attribute.name, attribute.value );\n }\n\n } else {\n _dialog_Contents.innerHTML = _configuration.noAttributesAvailableText!;\n }\n }\n\n function buildSizeProperties( element: HTMLElement ) : void {\n const offset: Position = DomElement.getOffset( element );\n\n buildPropertyRow( element, \"left\", offset.left.toString() + \"px\", false );\n buildPropertyRow( element, \"top\", offset.top.toString() + \"px\", false );\n buildPropertyRow( element, \"width\", element.offsetWidth.toString() + \"px\", false );\n buildPropertyRow( element, \"height\", element.offsetHeight.toString() + \"px\", false );\n }\n\n function buildPropertyRow( element: HTMLElement, propertyNameText: string, propertyValueText: string, allowEditing: boolean = true ) : void {\n if ( _current_Process_Options.showOnly!.length === 0 || _current_Process_Options.showOnly!.indexOf( propertyNameText ) > Value.notFound ) {\n const property: HTMLElement = DomElement.create( _dialog_Contents, \"div\", \"property-row\" );\n\n DomElement.createWithHTML( property, \"div\", \"property-name\", propertyNameText );\n \n const propertyValue: HTMLElement = DomElement.create( property, \"div\", \"property-value\" );\n const propertyValueInput: HTMLInputElement = DomElement.create( propertyValue, \"input\" ) as HTMLInputElement;\n \n propertyValueInput.type = \"text\";\n propertyValueInput.value = propertyValueText;\n\n if ( !_current_Process_Options.allowEditing || !allowEditing ) {\n propertyValueInput.readOnly = true;\n } else {\n propertyValueInput.onkeyup = ( e: KeyboardEvent ) => {\n onPropertyValueKeyUp( e, propertyNameText, propertyValueInput, element );\n }\n }\n }\n }\n\n function onPropertyValueKeyUp( e: KeyboardEvent, propertyName: string, input: HTMLInputElement, element: HTMLElement ) {\n if ( e.code === KeyCode.enter ) {\n element.style.setProperty( propertyName, input.value );\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Node Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildNodeEvents() : void {\n const tagTypes: string[] = _current_Process_Options.nodeType 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 buildNodeEvent( elements[ elementIndex ] );\n }\n }\n\n window.addEventListener( \"mousemove\", closeDialog );\n }\n\n function buildNodeEvent( element: HTMLElement ) : void {\n const attributeValue: string = element.getAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE )!;\n\n if ( !Is.definedString( attributeValue ) ?? attributeValue !== IgnoreState.ignore ) {\n element.addEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n \n _current_Process_Elements.push( element );\n }\n }\n\n function removeNodeEvents() : void {\n const currentProcessElementsLength: number = _current_Process_Elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < currentProcessElementsLength; elementIndex++ ) {\n var element: HTMLElement = _current_Process_Elements[ elementIndex ];\n\n element.removeEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n }\n\n _current_Process_Elements = [] as HTMLElement[];\n\n window.removeEventListener( \"mousemove\", closeDialog );\n\n closeDialog();\n }\n\n function onNodeMouseOver( e: MouseEvent, element: HTMLElement ) {\n DomElement.cancelBubble( e );\n \n if ( _dialog_Timer !== 0 ) {\n clearTimeout( _dialog_Timer );\n _dialog_Timer = 0;\n }\n\n _dialog_Timer = setTimeout( () => {\n buildDialogContent( element );\n\n DomElement.showElementAtMousePosition( e, _dialog );\n }, _configuration.dialogDisplayDelay );\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildOptions( newOptions: any ) : Options {\n let options: Options = Data.getDefaultObject( newOptions, {} as Options );\n options.nodeType = Data.getDefaultStringOrArray( options.nodeType, [] );\n options.mode = Data.getDefaultNumber( options.mode, Mode.css );\n options.titleText = Data.getDefaultString( options.titleText, Char.empty );\n options.showOnly = Data.getDefaultStringOrArray( options.showOnly, [] );\n options.allowEditing = Data.getDefaultBoolean( options.allowEditing, false );\n\n return options;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: Configuration = null! ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.dialogDisplayDelay = Data.getDefaultNumber( _configuration.dialogDisplayDelay, 1000 );\n\n buildDefaultStringConfiguration();\n }\n\n function buildDefaultStringConfiguration() : void {\n _configuration.cssPropertiesText = Data.getDefaultAnyString( _configuration.cssPropertiesText, \"CSS Properties\" );\n _configuration.attributesText = Data.getDefaultAnyString( _configuration.attributesText, \"Attributes\" );\n _configuration.sizeText = Data.getDefaultAnyString( _configuration.sizeText, \"Size\" );\n _configuration.noAttributesAvailableText = Data.getDefaultAnyString( _configuration.noAttributesAvailableText, \"No attributes are available.\" );\n _configuration.closeText = Data.getDefaultAnyString( _configuration.closeText, \"Close\" );\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: Running\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n start: function ( options: Options ): PublicApi {\n if ( !Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = buildOptions( options );\n\n setDialogText();\n buildNodeEvents();\n }\n\n return _public;\n },\n\n stop: function (): PublicApi {\n if ( Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = null!;\n\n removeNodeEvents();\n }\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 buildDialog();\n\n if ( Is.definedObject( _current_Process_Options ) ) {\n setDialogText();\n }\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.1.1\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Heat.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", () => {\n buildDialog();\n } );\n\n if ( !Is.defined( window.$peek ) ) {\n window.$peek = _public;\n }\n } )();\n} )();"]} \ No newline at end of file diff --git a/dist/peek.min.js b/dist/peek.min.js index 54d4622..5ecc9ed 100644 --- a/dist/peek.min.js +++ b/dist/peek.min.js @@ -1 +1 @@ -"use strict";var e,t,n,o;(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}function o(e){return n(e)&&e instanceof Array}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=o,e.definedDate=function(e){return n(e)&&e instanceof Date},e.invalidOptionArray=function(e,t=1){return!o(e)||e.length{function o(n,o,i=""){const r=o.toLowerCase();let l="text"===r?document.createTextNode(""):document.createElement(r);return l.setAttribute(t.PEEK_JS_IGNORE_STATE_ATTRIBUTE,"ignore"),e.defined(i)&&(l.className=i),n.appendChild(l),l}function i(){const e=document.documentElement;return{left:e.scrollLeft-(e.clientLeft||0),top:e.scrollTop-(e.clientTop||0)}}n.create=o,n.createWithHTML=function(e,n,i,r){const l=o(e,n,i);return l.innerHTML=r,l.setAttribute(t.PEEK_JS_IGNORE_STATE_ATTRIBUTE,"ignore"),l},n.cancelBubble=function(e){e.preventDefault(),e.cancelBubble=!0},n.getScrollPosition=i,n.showElementAtMousePosition=function(e,t){if("block"!==t.style.display){let n=e.pageX,o=e.pageY;const r=i();t.style.display="block",n+t.offsetWidth>window.innerWidth?n-=t.offsetWidth:n++,o+t.offsetHeight>window.innerHeight?o-=t.offsetHeight:o++,n{function n(t,n){return e.definedArray(t)?t:n}t.getDefaultAnyString=function(e,t){return"string"==typeof e?e:t},t.getDefaultString=function(t,n){return e.definedString(t)?t:n},t.getDefaultBoolean=function(t,n){return e.definedBoolean(t)?t:n},t.getDefaultNumber=function(t,n){return e.definedNumber(t)?t:n},t.getDefaultArray=n,t.getDefaultObject=function(t,n){return e.definedObject(t)?t:n},t.getDefaultStringOrArray=function(t,o){let i=o;if(e.definedString(t)){const e=t.toString().split(" ");0===e.length?t=o:i=e}else i=n(t,o);return i}})(o||(o={})),(()=>{let i={},r=null,l=null,u=null,f=null,s=0,a=null,c=[];function d(){e.definedObject(r)&&(p(),document.body.removeChild(r),r=null),r=n.create(document.body,"div","peek-js"),r.onmousemove=n.cancelBubble,l=n.create(r,"div","dialog-title-bar"),u=n.create(r,"div","dialog-contents"),f=n.create(r,"div","dialog-buttons");n.createWithHTML(f,"button","close",i.closeText).onclick=()=>{p()}}function g(){let t=a.titleText;e.definedString(t)||(1===a.mode?t=i.cssPropertiesText:2===a.mode?t=i.attributesText:3===a.mode&&(t=i.sizeText)),l.innerHTML=t}function p(){r.style.display="none"}function T(e){u.innerHTML="",u.scrollTop=0,1===a.mode?function(e){const t=getComputedStyle(e),n=t.length;for(let o=0;o-1){const r=n.create(u,"div","property-row");n.createWithHTML(r,"div","property-name",t);const l=n.create(r,"div","property-value"),f=n.create(l,"input");f.type="text",f.value=o,a.allowEditing&&i?f.onkeyup=n=>{!function(e,t,n,o){"Enter"===e.code&&o.style.setProperty(t,n.value)}(n,t,f,e)}:f.readOnly=!0}}function b(n){const o=n.getAttribute(t.PEEK_JS_IGNORE_STATE_ATTRIBUTE);e.definedString(o)||(n.addEventListener("mousemove",(e=>{m(e,n)})),c.push(n))}function m(e,t){n.cancelBubble(e),0!==s&&(clearTimeout(s),s=0),s=setTimeout((()=>{T(t),n.showElementAtMousePosition(e,r)}),i.dialogDisplayDelay)}function A(e=null){i=o.getDefaultObject(e,{}),i.dialogDisplayDelay=o.getDefaultNumber(i.dialogDisplayDelay,1e3),i.cssPropertiesText=o.getDefaultAnyString(i.cssPropertiesText,"CSS Properties"),i.attributesText=o.getDefaultAnyString(i.attributesText,"Attributes"),i.sizeText=o.getDefaultAnyString(i.sizeText,"Size"),i.noAttributesAvailableText=o.getDefaultAnyString(i.noAttributesAvailableText,"No attributes are available."),i.closeText=o.getDefaultAnyString(i.closeText,"Close")}const S={start:function(t){return e.definedObject(a)||(a=function(e){let t=o.getDefaultObject(e,{});return t.nodeType=o.getDefaultStringOrArray(t.nodeType,[]),t.mode=o.getDefaultNumber(t.mode,1),t.titleText=o.getDefaultString(t.titleText,""),t.showOnly=o.getDefaultStringOrArray(t.showOnly,[]),t.allowEditing=o.getDefaultBoolean(t.allowEditing,!1),t}(t),g(),function(){const e=a.nodeType,t=e.length;for(let n=0;n{m(e,t)}))}c=[],window.removeEventListener("mousemove",p),p()}()),S},setConfiguration:function(t){if(e.definedObject(t)){let n=!1;const o=i;for(let e in t)t.hasOwnProperty(e)&&i.hasOwnProperty(e)&&o[e]!==t[e]&&(o[e]=t[e],n=!0);n&&(A(o),d(),e.definedObject(a)&&g())}return S},getVersion:function(){return"1.1.0"}};A(),document.addEventListener("DOMContentLoaded",(()=>{d()})),e.defined(window.$peek)||(window.$peek=S)})(); \ No newline at end of file +"use strict";var e,t,n,o;(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}function o(e){return n(e)&&e instanceof Array}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=o,e.definedDate=function(e){return n(e)&&e instanceof Date},e.invalidOptionArray=function(e,t=1){return!o(e)||e.length{function o(n,o,i=""){const r=o.toLowerCase();let l="text"===r?document.createTextNode(""):document.createElement(r);return l.setAttribute(t.PEEK_JS_IGNORE_STATE_ATTRIBUTE,"ignore"),e.defined(i)&&(l.className=i),n.appendChild(l),l}function i(){const e=document.documentElement;return{left:e.scrollLeft-(e.clientLeft||0),top:e.scrollTop-(e.clientTop||0)}}n.create=o,n.createWithHTML=function(e,n,i,r){const l=o(e,n,i);return l.innerHTML=r,l.setAttribute(t.PEEK_JS_IGNORE_STATE_ATTRIBUTE,"ignore"),l},n.cancelBubble=function(e){e.preventDefault(),e.cancelBubble=!0},n.getScrollPosition=i,n.showElementAtMousePosition=function(e,t){if("block"!==t.style.display){let n=e.pageX,o=e.pageY;const r=i();t.style.display="block",n+t.offsetWidth>window.innerWidth?n-=t.offsetWidth:n++,o+t.offsetHeight>window.innerHeight?o-=t.offsetHeight:o++,n{function n(t,n){return e.definedArray(t)?t:n}t.getDefaultAnyString=function(e,t){return"string"==typeof e?e:t},t.getDefaultString=function(t,n){return e.definedString(t)?t:n},t.getDefaultBoolean=function(t,n){return e.definedBoolean(t)?t:n},t.getDefaultNumber=function(t,n){return e.definedNumber(t)?t:n},t.getDefaultArray=n,t.getDefaultObject=function(t,n){return e.definedObject(t)?t:n},t.getDefaultStringOrArray=function(t,o){let i=o;if(e.definedString(t)){const e=t.toString().split(" ");0===e.length?t=o:i=e}else i=n(t,o);return i}})(o||(o={})),(()=>{let i={},r=null,l=null,u=null,f=null,s=0,a=null,c=[];function d(){e.definedObject(r)&&(p(),document.body.removeChild(r),r=null),r=n.create(document.body,"div","peek-js"),r.onmousemove=n.cancelBubble,l=n.create(r,"div","dialog-title-bar"),u=n.create(r,"div","dialog-contents"),f=n.create(r,"div","dialog-buttons");n.createWithHTML(f,"button","close",i.closeText).onclick=()=>{p()}}function g(){let t=a.titleText;e.definedString(t)||(1===a.mode?t=i.cssPropertiesText:2===a.mode?t=i.attributesText:3===a.mode&&(t=i.sizeText)),l.innerHTML=t}function p(){r.style.display="none"}function T(e){u.innerHTML="",u.scrollTop=0,1===a.mode?function(e){const t=getComputedStyle(e),n=t.length;for(let o=0;o-1){const r=n.create(u,"div","property-row");n.createWithHTML(r,"div","property-name",t);const l=n.create(r,"div","property-value"),f=n.create(l,"input");f.type="text",f.value=o,a.allowEditing&&i?f.onkeyup=n=>{!function(e,t,n,o){"Enter"===e.code&&o.style.setProperty(t,n.value)}(n,t,f,e)}:f.readOnly=!0}}function b(n){const o=n.getAttribute(t.PEEK_JS_IGNORE_STATE_ATTRIBUTE);e.definedString(o)||(n.addEventListener("mousemove",(e=>{m(e,n)})),c.push(n))}function m(e,t){n.cancelBubble(e),0!==s&&(clearTimeout(s),s=0),s=setTimeout((()=>{T(t),n.showElementAtMousePosition(e,r)}),i.dialogDisplayDelay)}function A(e=null){i=o.getDefaultObject(e,{}),i.dialogDisplayDelay=o.getDefaultNumber(i.dialogDisplayDelay,1e3),i.cssPropertiesText=o.getDefaultAnyString(i.cssPropertiesText,"CSS Properties"),i.attributesText=o.getDefaultAnyString(i.attributesText,"Attributes"),i.sizeText=o.getDefaultAnyString(i.sizeText,"Size"),i.noAttributesAvailableText=o.getDefaultAnyString(i.noAttributesAvailableText,"No attributes are available."),i.closeText=o.getDefaultAnyString(i.closeText,"Close")}const S={start:function(t){return e.definedObject(a)||(a=function(e){let t=o.getDefaultObject(e,{});return t.nodeType=o.getDefaultStringOrArray(t.nodeType,[]),t.mode=o.getDefaultNumber(t.mode,1),t.titleText=o.getDefaultString(t.titleText,""),t.showOnly=o.getDefaultStringOrArray(t.showOnly,[]),t.allowEditing=o.getDefaultBoolean(t.allowEditing,!1),t}(t),g(),function(){const e=a.nodeType,t=e.length;for(let n=0;n{m(e,t)}))}c=[],window.removeEventListener("mousemove",p),p()}()),S},setConfiguration:function(t){if(e.definedObject(t)){let n=!1;const o=i;for(let e in t)t.hasOwnProperty(e)&&i.hasOwnProperty(e)&&o[e]!==t[e]&&(o[e]=t[e],n=!0);n&&(A(o),d(),e.definedObject(a)&&g())}return S},getVersion:function(){return"1.1.1"}};A(),document.addEventListener("DOMContentLoaded",(()=>{d()})),e.defined(window.$peek)||(window.$peek=S)})(); \ No newline at end of file diff --git a/docs/CHANGE_LOG.md b/docs/CHANGE_LOG.md index bb67694..92ef98a 100755 --- a/docs/CHANGE_LOG.md +++ b/docs/CHANGE_LOG.md @@ -1,6 +1,6 @@ # Peek.js - Change Log: -## Version 1.1.0: +## Version 1.1.1: - Added a new binding option called "showOnly" (excepts a string, or string array), which states the properties that should be shown in the dialog. - Added a new binding option called "allowEditing" (defaults to false), which allows CSS and Attribute values to be entered (simply type and press Enter). - Fixed a fault that caused the dialog elements to be included when viewing specific node types. diff --git a/package-lock.json b/package-lock.json index a4f2108..dbaf51b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jpeek.js", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jpeek.js", - "version": "1.1.0", + "version": "1.1.1", "license": "MIT", "devDependencies": { "@swc/core": "^1.6.12", @@ -1453,7 +1453,7 @@ }, "node_modules/globby": { "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.1.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "license": "MIT", diff --git a/package.json b/package.json index 433f4ba..637681f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "jpeek.js", "title": "Peek.js", "description": "A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.", - "version": "1.1.0", + "version": "1.1.1", "homepage": "https://www.william-troup.com/peek-js/", "author": { "name": "Bunoon" diff --git a/peek.js.nuspec b/peek.js.nuspec index 9db5da5..80cb2cf 100644 --- a/peek.js.nuspec +++ b/peek.js.nuspec @@ -2,7 +2,7 @@ jPeek.js - 1.1.0 + 1.1.1 Peek.js A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position. William Troup diff --git a/src/peek.js.scss b/src/peek.js.scss index 6b4a299..4618183 100644 --- a/src/peek.js.scss +++ b/src/peek.js.scss @@ -1,5 +1,5 @@ /* - * Peek.js Library v1.1.0 + * Peek.js Library v1.1.1 * * Copyright 2024 Bunoon * Released under the MIT License diff --git a/src/peek.ts b/src/peek.ts index 96033e3..8c24d40 100644 --- a/src/peek.ts +++ b/src/peek.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position. * * @file peek.ts - * @version v1.1.0 + * @version v1.1.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 @@ -344,7 +344,7 @@ import { Constant } from "./ts/constant"; */ getVersion: function (): string { - return "1.1.0"; + return "1.1.1"; } }; diff --git a/src/ts/api.ts b/src/ts/api.ts index 9317216..5514045 100644 --- a/src/ts/api.ts +++ b/src/ts/api.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position. * * @file api.ts - * @version v1.1.0 + * @version v1.1.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 diff --git a/src/ts/constant.ts b/src/ts/constant.ts index c9d512f..385b608 100644 --- a/src/ts/constant.ts +++ b/src/ts/constant.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position. * * @file constant.ts - * @version v1.1.0 + * @version v1.1.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 diff --git a/src/ts/data.ts b/src/ts/data.ts index e3e7263..ec13467 100644 --- a/src/ts/data.ts +++ b/src/ts/data.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position. * * @file data.ts - * @version v1.1.0 + * @version v1.1.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 diff --git a/src/ts/dom.ts b/src/ts/dom.ts index 5b2fcee..f8e42f8 100644 --- a/src/ts/dom.ts +++ b/src/ts/dom.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position. * * @file dom.ts - * @version v1.1.0 + * @version v1.1.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 diff --git a/src/ts/enum.ts b/src/ts/enum.ts index 7342bf7..4eaa1f7 100644 --- a/src/ts/enum.ts +++ b/src/ts/enum.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position. * * @file enum.ts - * @version v1.1.0 + * @version v1.1.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 diff --git a/src/ts/is.ts b/src/ts/is.ts index c165e9a..58de00e 100644 --- a/src/ts/is.ts +++ b/src/ts/is.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position. * * @file is.ts - * @version v1.1.0 + * @version v1.1.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 diff --git a/src/ts/type.ts b/src/ts/type.ts index 2874db2..be639b6 100644 --- a/src/ts/type.ts +++ b/src/ts/type.ts @@ -4,7 +4,7 @@ * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position. * * @file type.ts - * @version v1.1.0 + * @version v1.1.1 * @author Bunoon * @license MIT License * @copyright Bunoon 2024 From bd888ee129a4f66b16ea41804d4dd5e7d9e65bc9 Mon Sep 17 00:00:00 2001 From: William Troup Date: Wed, 10 Jul 2024 21:00:57 +0100 Subject: [PATCH 2/3] Fixed a fault that prevented attribute values assigning their values to CSS properties when "allowEditing" is enabled. --- dist/peek.esm.js | 6 +- dist/peek.esm.js.map | 2 +- dist/peek.js | 6 +- dist/peek.js.map | 2 +- dist/peek.min.js | 2 +- docs/CHANGE_LOG.md | 8 ++ package-lock.json | 269 +++++++++++++++++------------------ src/peek.ts | 6 +- test/peek.js.attributes.html | 2 +- 9 files changed, 157 insertions(+), 146 deletions(-) diff --git a/dist/peek.esm.js b/dist/peek.esm.js index bd1a408..66e2e11 100644 --- a/dist/peek.esm.js +++ b/dist/peek.esm.js @@ -261,7 +261,11 @@ var o; } function A(e, t, n, o) { if (e.code === "Enter") { - o.style.setProperty(t, n.value); + if (a.mode === 1) { + o.style.setProperty(t, n.value); + } else if (a.mode === 2) { + o.setAttribute(t, n.value); + } } } function S() { diff --git a/dist/peek.esm.js.map b/dist/peek.esm.js.map index 2d83bad..1b6d8e9 100644 --- a/dist/peek.esm.js.map +++ b/dist/peek.esm.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/ts/is.ts","../src/ts/constant.ts","../src/ts/dom.ts","../src/ts/data.ts","../src/peek.ts"],"names":["Is","Constant","DomElement","Data"],"mappings":";AAgBO,IAAU;AAAA,CAAV,CAAUA,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,KAAK,OAAO,WAAW;AAAA,EAClD;AAFO,EAAAA,IAAS;AAIT,WAAS,aAAc,QAAwB;AAClD,WAAO,cAAe,MAAO,KAAK,kBAAkB;AAAA,EACxD;AAFO,EAAAA,IAAS;AAIT,WAAS,YAAa,QAAwB;AACjD,WAAO,cAAe,MAAO,KAAK,kBAAkB;AAAA,EACxD;AAFO,EAAAA,IAAS;AAIT,WAAS,mBAAoB,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A0B,YAAa,IAAI,iBAAkB,YAAa;AAC1E,sCAA0B;AAAA,UAC9B;AAAA,QACJ;AAEA,YAAK,yBAA0B;AAC3B,oCAA2B,wBAAyB;AACpD,sBAAY;AAEZ,cAAK,GAAG,cAAe,wBAAyB,GAAI;AAChD,0BAAc;AAAA,UAClB;AAAA,QACJ;AAAA,MACJ;AAEA,aAAO;AAAA,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,YAAY,WAAoB;AAC5B,aAAO;AAAA,IACX;AAAA,EACJ;AASA,GAAE,MAAM;AACJ,8BAA0B;AAE1B,aAAS,iBAAkB,oBAAoB,MAAM;AACjD,kBAAY;AAAA,IAChB,CAAE;AAEF,QAAK,CAAC,GAAG,QAAS,OAAO,KAAM,GAAI;AAC/B,aAAO,QAAQ;AAAA,IACnB;AAAA,EACJ,GAAI;AACR,GAAI","sourcesContent":["/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file is.ts\n * @version v1.1.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 export function invalidOptionArray( array: any, minimumLength: number = 1 ) : boolean {\n return !definedArray( array ) || array.length < minimumLength;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file constant.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const PEEK_JS_IGNORE_STATE_ATTRIBUTE = \"data-peek-js-ignore-state\";\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file dom.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Constant } from \"./constant\";\nimport { Char, IgnoreState } from \"./enum\";\nimport { Is } from \"./is\";\nimport { type Position } from \"./type\";\n\n\nexport namespace DomElement {\n export function create( container: HTMLElement, type: string, className: string = Char.empty ) : HTMLElement {\n const nodeType: string = type.toLowerCase();\n const isText: boolean = nodeType === \"text\";\n\n let result: any = isText ? document.createTextNode( Char.empty ) : document.createElement( nodeType );\n\n result.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n if ( Is.defined( className ) ) {\n result.className = className;\n }\n\n container.appendChild( result );\n\n return result;\n }\n\n export function createWithHTML( container: HTMLElement, type: string, className: string, html: string ) : HTMLElement {\n const element: HTMLElement = create( container, type, className );\n element.innerHTML = html;\n element.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n return element;\n }\n\n export function cancelBubble( e: Event ) {\n e.preventDefault();\n e.cancelBubble = true;\n }\n\n export function getScrollPosition() : Position {\n const documentElement: HTMLElement = document.documentElement;\n\n const result: Position = {\n left: documentElement.scrollLeft - ( documentElement.clientLeft || 0 ),\n top: documentElement.scrollTop - ( documentElement.clientTop || 0 )\n } as Position;\n\n return result;\n }\n\n export function showElementAtMousePosition( e: any, element: HTMLElement ) {\n if ( element.style.display !== \"block\" ) {\n let left: number = e.pageX;\n let top: number = e.pageY;\n const scrollPosition: Position = getScrollPosition();\n \n element.style.display = \"block\";\n \n if ( left + element.offsetWidth > window.innerWidth ) {\n left -= element.offsetWidth;\n } else {\n left++;\n }\n \n if ( top + element.offsetHeight > window.innerHeight ) {\n top -= element.offsetHeight;\n } else {\n top++;\n }\n \n if ( left < scrollPosition.left ) {\n left = e.pageX + 1;\n }\n \n if ( top < scrollPosition.top ) {\n top = e.pageY + 1;\n }\n \n element.style.left = left + \"px\";\n element.style.top = top + \"px\";\n }\n }\n\n export function getOffset( element: HTMLElement ) : Position {\n const result: Position = {\n left: 0,\n top: 0\n } as Position;\n\n while ( element && !isNaN( element.offsetLeft ) && !isNaN( element.offsetTop ) ) {\n result.left += element.offsetLeft - element.scrollLeft;\n result.top += element.offsetTop - element.scrollTop;\n\n element = element.offsetParent as HTMLElement;\n }\n\n return result;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file data.ts\n * @version v1.1.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 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 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 getDefaultStringOrArray( value: any, defaultValue: any[] ) : any[] {\n let result: any[] = 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 * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file peek.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Position, type Configuration, type Options } from \"./ts/type\";\nimport { PublicApi } from \"./ts/api\";\nimport { Is } from \"./ts/is\";\nimport { DomElement } from \"./ts/dom\";\nimport { Data } from \"./ts/data\";\nimport { Char, IgnoreState, KeyCode, Mode, Value } from \"./ts/enum\";\nimport { Constant } from \"./ts/constant\";\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Dialog\n let _dialog: HTMLElement = null!;\n let _dialog_Title: HTMLElement = null!;\n let _dialog_Contents: HTMLElement = null!;\n let _dialog_Buttons: HTMLElement = null!;\n let _dialog_Timer: number = 0;\n\n // Variables: Current Process:\n let _current_Process_Options: Options = null!;\n let _current_Process_Elements: HTMLElement[] = [];\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialog() : void {\n if ( Is.definedObject( _dialog ) ) {\n closeDialog();\n\n document.body.removeChild( _dialog );\n _dialog = null!;\n }\n\n _dialog = DomElement.create( document.body, \"div\", \"peek-js\" );\n _dialog.onmousemove = DomElement.cancelBubble;\n\n _dialog_Title = DomElement.create( _dialog, \"div\", \"dialog-title-bar\" );\n _dialog_Contents = DomElement.create( _dialog, \"div\", \"dialog-contents\" );\n _dialog_Buttons = DomElement.create( _dialog, \"div\", \"dialog-buttons\" );\n\n const closeButton: HTMLElement = DomElement.createWithHTML( _dialog_Buttons, \"button\", \"close\", _configuration.closeText! );\n\n closeButton.onclick = () => {\n closeDialog();\n };\n }\n\n function setDialogText() : void {\n let title: string = _current_Process_Options.titleText!;\n\n if ( !Is.definedString( title ) ) {\n if ( _current_Process_Options.mode === Mode.css ) {\n title = _configuration.cssPropertiesText!;\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n title = _configuration.attributesText!;\n } else if ( _current_Process_Options.mode === Mode.size ) {\n title = _configuration.sizeText!;\n }\n }\n\n _dialog_Title.innerHTML = title;\n }\n\n function closeDialog() {\n _dialog.style.display = \"none\";\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog Content\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialogContent( element: HTMLElement ) : void {\n _dialog_Contents.innerHTML = Char.empty;\n _dialog_Contents.scrollTop = 0;\n\n if ( _current_Process_Options.mode === Mode.css ) {\n buildCssProperties( element );\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n buildAttributeProperties( element );\n } else if ( _current_Process_Options.mode === Mode.size ) {\n buildSizeProperties( element );\n }\n }\n\n function buildCssProperties( element: HTMLElement ) : void {\n const computedStyles: CSSStyleDeclaration = getComputedStyle( element );\n const computedStylesLength: number = computedStyles.length;\n\n for( let styleIndex: number = 0; styleIndex < computedStylesLength; styleIndex++ ) {\n buildPropertyRow( element, computedStyles[ styleIndex ], computedStyles.getPropertyValue( computedStyles[ styleIndex ] ) );\n }\n }\n\n function buildAttributeProperties( element: HTMLElement ) : void {\n if ( element.hasAttributes() ) {\n for ( let attribute of element.attributes ) {\n buildPropertyRow( element, attribute.name, attribute.value );\n }\n\n } else {\n _dialog_Contents.innerHTML = _configuration.noAttributesAvailableText!;\n }\n }\n\n function buildSizeProperties( element: HTMLElement ) : void {\n const offset: Position = DomElement.getOffset( element );\n\n buildPropertyRow( element, \"left\", offset.left.toString() + \"px\", false );\n buildPropertyRow( element, \"top\", offset.top.toString() + \"px\", false );\n buildPropertyRow( element, \"width\", element.offsetWidth.toString() + \"px\", false );\n buildPropertyRow( element, \"height\", element.offsetHeight.toString() + \"px\", false );\n }\n\n function buildPropertyRow( element: HTMLElement, propertyNameText: string, propertyValueText: string, allowEditing: boolean = true ) : void {\n if ( _current_Process_Options.showOnly!.length === 0 || _current_Process_Options.showOnly!.indexOf( propertyNameText ) > Value.notFound ) {\n const property: HTMLElement = DomElement.create( _dialog_Contents, \"div\", \"property-row\" );\n\n DomElement.createWithHTML( property, \"div\", \"property-name\", propertyNameText );\n \n const propertyValue: HTMLElement = DomElement.create( property, \"div\", \"property-value\" );\n const propertyValueInput: HTMLInputElement = DomElement.create( propertyValue, \"input\" ) as HTMLInputElement;\n \n propertyValueInput.type = \"text\";\n propertyValueInput.value = propertyValueText;\n\n if ( !_current_Process_Options.allowEditing || !allowEditing ) {\n propertyValueInput.readOnly = true;\n } else {\n propertyValueInput.onkeyup = ( e: KeyboardEvent ) => {\n onPropertyValueKeyUp( e, propertyNameText, propertyValueInput, element );\n }\n }\n }\n }\n\n function onPropertyValueKeyUp( e: KeyboardEvent, propertyName: string, input: HTMLInputElement, element: HTMLElement ) {\n if ( e.code === KeyCode.enter ) {\n element.style.setProperty( propertyName, input.value );\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Node Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildNodeEvents() : void {\n const tagTypes: string[] = _current_Process_Options.nodeType 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 buildNodeEvent( elements[ elementIndex ] );\n }\n }\n\n window.addEventListener( \"mousemove\", closeDialog );\n }\n\n function buildNodeEvent( element: HTMLElement ) : void {\n const attributeValue: string = element.getAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE )!;\n\n if ( !Is.definedString( attributeValue ) ?? attributeValue !== IgnoreState.ignore ) {\n element.addEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n \n _current_Process_Elements.push( element );\n }\n }\n\n function removeNodeEvents() : void {\n const currentProcessElementsLength: number = _current_Process_Elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < currentProcessElementsLength; elementIndex++ ) {\n var element: HTMLElement = _current_Process_Elements[ elementIndex ];\n\n element.removeEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n }\n\n _current_Process_Elements = [] as HTMLElement[];\n\n window.removeEventListener( \"mousemove\", closeDialog );\n\n closeDialog();\n }\n\n function onNodeMouseOver( e: MouseEvent, element: HTMLElement ) {\n DomElement.cancelBubble( e );\n \n if ( _dialog_Timer !== 0 ) {\n clearTimeout( _dialog_Timer );\n _dialog_Timer = 0;\n }\n\n _dialog_Timer = setTimeout( () => {\n buildDialogContent( element );\n\n DomElement.showElementAtMousePosition( e, _dialog );\n }, _configuration.dialogDisplayDelay );\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildOptions( newOptions: any ) : Options {\n let options: Options = Data.getDefaultObject( newOptions, {} as Options );\n options.nodeType = Data.getDefaultStringOrArray( options.nodeType, [] );\n options.mode = Data.getDefaultNumber( options.mode, Mode.css );\n options.titleText = Data.getDefaultString( options.titleText, Char.empty );\n options.showOnly = Data.getDefaultStringOrArray( options.showOnly, [] );\n options.allowEditing = Data.getDefaultBoolean( options.allowEditing, false );\n\n return options;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: Configuration = null! ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.dialogDisplayDelay = Data.getDefaultNumber( _configuration.dialogDisplayDelay, 1000 );\n\n buildDefaultStringConfiguration();\n }\n\n function buildDefaultStringConfiguration() : void {\n _configuration.cssPropertiesText = Data.getDefaultAnyString( _configuration.cssPropertiesText, \"CSS Properties\" );\n _configuration.attributesText = Data.getDefaultAnyString( _configuration.attributesText, \"Attributes\" );\n _configuration.sizeText = Data.getDefaultAnyString( _configuration.sizeText, \"Size\" );\n _configuration.noAttributesAvailableText = Data.getDefaultAnyString( _configuration.noAttributesAvailableText, \"No attributes are available.\" );\n _configuration.closeText = Data.getDefaultAnyString( _configuration.closeText, \"Close\" );\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: Running\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n start: function ( options: Options ): PublicApi {\n if ( !Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = buildOptions( options );\n\n setDialogText();\n buildNodeEvents();\n }\n\n return _public;\n },\n\n stop: function (): PublicApi {\n if ( Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = null!;\n\n removeNodeEvents();\n }\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 buildDialog();\n\n if ( Is.definedObject( _current_Process_Options ) ) {\n setDialogText();\n }\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.1.1\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Heat.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", () => {\n buildDialog();\n } );\n\n if ( !Is.defined( window.$peek ) ) {\n window.$peek = _public;\n }\n } )();\n} )();"]} \ No newline at end of file +{"version":3,"sources":["../src/ts/is.ts","../src/ts/constant.ts","../src/ts/dom.ts","../src/ts/data.ts","../src/peek.ts"],"names":["Is","Constant","DomElement","Data"],"mappings":";AAgBO,IAAU;AAAA,CAAV,CAAUA,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;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AAK,CAAC,GAAG,cAAe,wBAAyB,GAAI;AACjD,mCAA2B,aAAc,OAAQ;AAEjD,sBAAc;AACd,wBAAgB;AAAA,MACpB;AAEA,aAAO;AAAA,IACX;AAAA,IAEA,MAAM,WAAuB;AACzB,UAAK,GAAG,cAAe,wBAAyB,GAAI;AAChD,mCAA2B;AAE3B,yBAAiB;AAAA,MACrB;AAEA,aAAO;AAAA,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,kBAAkB,SAAW,kBAAmC;AAC5D,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;AACpD,sBAAY;AAEZ,cAAK,GAAG,cAAe,wBAAyB,GAAI;AAChD,0BAAc;AAAA,UAClB;AAAA,QACJ;AAAA,MACJ;AAEA,aAAO;AAAA,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,YAAY,WAAoB;AAC5B,aAAO;AAAA,IACX;AAAA,EACJ;AASA,GAAE,MAAM;AACJ,8BAA0B;AAE1B,aAAS,iBAAkB,oBAAoB,MAAM;AACjD,kBAAY;AAAA,IAChB,CAAE;AAEF,QAAK,CAAC,GAAG,QAAS,OAAO,KAAM,GAAI;AAC/B,aAAO,QAAQ;AAAA,IACnB;AAAA,EACJ,GAAI;AACR,GAAI","sourcesContent":["/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file is.ts\n * @version v1.1.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 export function invalidOptionArray( array: any, minimumLength: number = 1 ) : boolean {\n return !definedArray( array ) || array.length < minimumLength;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file constant.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const PEEK_JS_IGNORE_STATE_ATTRIBUTE = \"data-peek-js-ignore-state\";\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file dom.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Constant } from \"./constant\";\nimport { Char, IgnoreState } from \"./enum\";\nimport { Is } from \"./is\";\nimport { type Position } from \"./type\";\n\n\nexport namespace DomElement {\n export function create( container: HTMLElement, type: string, className: string = Char.empty ) : HTMLElement {\n const nodeType: string = type.toLowerCase();\n const isText: boolean = nodeType === \"text\";\n\n let result: any = isText ? document.createTextNode( Char.empty ) : document.createElement( nodeType );\n\n result.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n if ( Is.defined( className ) ) {\n result.className = className;\n }\n\n container.appendChild( result );\n\n return result;\n }\n\n export function createWithHTML( container: HTMLElement, type: string, className: string, html: string ) : HTMLElement {\n const element: HTMLElement = create( container, type, className );\n element.innerHTML = html;\n element.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n return element;\n }\n\n export function cancelBubble( e: Event ) {\n e.preventDefault();\n e.cancelBubble = true;\n }\n\n export function getScrollPosition() : Position {\n const documentElement: HTMLElement = document.documentElement;\n\n const result: Position = {\n left: documentElement.scrollLeft - ( documentElement.clientLeft || 0 ),\n top: documentElement.scrollTop - ( documentElement.clientTop || 0 )\n } as Position;\n\n return result;\n }\n\n export function showElementAtMousePosition( e: any, element: HTMLElement ) {\n if ( element.style.display !== \"block\" ) {\n let left: number = e.pageX;\n let top: number = e.pageY;\n const scrollPosition: Position = getScrollPosition();\n \n element.style.display = \"block\";\n \n if ( left + element.offsetWidth > window.innerWidth ) {\n left -= element.offsetWidth;\n } else {\n left++;\n }\n \n if ( top + element.offsetHeight > window.innerHeight ) {\n top -= element.offsetHeight;\n } else {\n top++;\n }\n \n if ( left < scrollPosition.left ) {\n left = e.pageX + 1;\n }\n \n if ( top < scrollPosition.top ) {\n top = e.pageY + 1;\n }\n \n element.style.left = left + \"px\";\n element.style.top = top + \"px\";\n }\n }\n\n export function getOffset( element: HTMLElement ) : Position {\n const result: Position = {\n left: 0,\n top: 0\n } as Position;\n\n while ( element && !isNaN( element.offsetLeft ) && !isNaN( element.offsetTop ) ) {\n result.left += element.offsetLeft - element.scrollLeft;\n result.top += element.offsetTop - element.scrollTop;\n\n element = element.offsetParent as HTMLElement;\n }\n\n return result;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file data.ts\n * @version v1.1.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 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 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 getDefaultStringOrArray( value: any, defaultValue: any[] ) : any[] {\n let result: any[] = 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 * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file peek.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Position, type Configuration, type Options } from \"./ts/type\";\nimport { PublicApi } from \"./ts/api\";\nimport { Is } from \"./ts/is\";\nimport { DomElement } from \"./ts/dom\";\nimport { Data } from \"./ts/data\";\nimport { Char, IgnoreState, KeyCode, Mode, Value } from \"./ts/enum\";\nimport { Constant } from \"./ts/constant\";\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Dialog\n let _dialog: HTMLElement = null!;\n let _dialog_Title: HTMLElement = null!;\n let _dialog_Contents: HTMLElement = null!;\n let _dialog_Buttons: HTMLElement = null!;\n let _dialog_Timer: number = 0;\n\n // Variables: Current Process:\n let _current_Process_Options: Options = null!;\n let _current_Process_Elements: HTMLElement[] = [];\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialog() : void {\n if ( Is.definedObject( _dialog ) ) {\n closeDialog();\n\n document.body.removeChild( _dialog );\n _dialog = null!;\n }\n\n _dialog = DomElement.create( document.body, \"div\", \"peek-js\" );\n _dialog.onmousemove = DomElement.cancelBubble;\n\n _dialog_Title = DomElement.create( _dialog, \"div\", \"dialog-title-bar\" );\n _dialog_Contents = DomElement.create( _dialog, \"div\", \"dialog-contents\" );\n _dialog_Buttons = DomElement.create( _dialog, \"div\", \"dialog-buttons\" );\n\n const closeButton: HTMLElement = DomElement.createWithHTML( _dialog_Buttons, \"button\", \"close\", _configuration.closeText! );\n\n closeButton.onclick = () => {\n closeDialog();\n };\n }\n\n function setDialogText() : void {\n let title: string = _current_Process_Options.titleText!;\n\n if ( !Is.definedString( title ) ) {\n if ( _current_Process_Options.mode === Mode.css ) {\n title = _configuration.cssPropertiesText!;\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n title = _configuration.attributesText!;\n } else if ( _current_Process_Options.mode === Mode.size ) {\n title = _configuration.sizeText!;\n }\n }\n\n _dialog_Title.innerHTML = title;\n }\n\n function closeDialog() {\n _dialog.style.display = \"none\";\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog Content\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialogContent( element: HTMLElement ) : void {\n _dialog_Contents.innerHTML = Char.empty;\n _dialog_Contents.scrollTop = 0;\n\n if ( _current_Process_Options.mode === Mode.css ) {\n buildCssProperties( element );\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n buildAttributeProperties( element );\n } else if ( _current_Process_Options.mode === Mode.size ) {\n buildSizeProperties( element );\n }\n }\n\n function buildCssProperties( element: HTMLElement ) : void {\n const computedStyles: CSSStyleDeclaration = getComputedStyle( element );\n const computedStylesLength: number = computedStyles.length;\n\n for( let styleIndex: number = 0; styleIndex < computedStylesLength; styleIndex++ ) {\n buildPropertyRow( element, computedStyles[ styleIndex ], computedStyles.getPropertyValue( computedStyles[ styleIndex ] ) );\n }\n }\n\n function buildAttributeProperties( element: HTMLElement ) : void {\n if ( element.hasAttributes() ) {\n for ( let attribute of element.attributes ) {\n buildPropertyRow( element, attribute.name, attribute.value );\n }\n\n } else {\n _dialog_Contents.innerHTML = _configuration.noAttributesAvailableText!;\n }\n }\n\n function buildSizeProperties( element: HTMLElement ) : void {\n const offset: Position = DomElement.getOffset( element );\n\n buildPropertyRow( element, \"left\", offset.left.toString() + \"px\", false );\n buildPropertyRow( element, \"top\", offset.top.toString() + \"px\", false );\n buildPropertyRow( element, \"width\", element.offsetWidth.toString() + \"px\", false );\n buildPropertyRow( element, \"height\", element.offsetHeight.toString() + \"px\", false );\n }\n\n function buildPropertyRow( element: HTMLElement, propertyNameText: string, propertyValueText: string, allowEditing: boolean = true ) : void {\n if ( _current_Process_Options.showOnly!.length === 0 || _current_Process_Options.showOnly!.indexOf( propertyNameText ) > Value.notFound ) {\n const property: HTMLElement = DomElement.create( _dialog_Contents, \"div\", \"property-row\" );\n\n DomElement.createWithHTML( property, \"div\", \"property-name\", propertyNameText );\n \n const propertyValue: HTMLElement = DomElement.create( property, \"div\", \"property-value\" );\n const propertyValueInput: HTMLInputElement = DomElement.create( propertyValue, \"input\" ) as HTMLInputElement;\n \n propertyValueInput.type = \"text\";\n propertyValueInput.value = propertyValueText;\n\n if ( !_current_Process_Options.allowEditing || !allowEditing ) {\n propertyValueInput.readOnly = true;\n } else {\n propertyValueInput.onkeyup = ( e: KeyboardEvent ) => {\n onPropertyValueKeyUp( e, propertyNameText, propertyValueInput, element );\n }\n }\n }\n }\n\n function onPropertyValueKeyUp( e: KeyboardEvent, propertyName: string, input: HTMLInputElement, element: HTMLElement ) {\n if ( e.code === KeyCode.enter ) {\n if ( _current_Process_Options.mode === Mode.css ) {\n element.style.setProperty( propertyName, input.value );\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n element.setAttribute( propertyName, input.value );\n }\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Node Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildNodeEvents() : void {\n const tagTypes: string[] = _current_Process_Options.nodeType 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 buildNodeEvent( elements[ elementIndex ] );\n }\n }\n\n window.addEventListener( \"mousemove\", closeDialog );\n }\n\n function buildNodeEvent( element: HTMLElement ) : void {\n const attributeValue: string = element.getAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE )!;\n\n if ( !Is.definedString( attributeValue ) ?? attributeValue !== IgnoreState.ignore ) {\n element.addEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n \n _current_Process_Elements.push( element );\n }\n }\n\n function removeNodeEvents() : void {\n const currentProcessElementsLength: number = _current_Process_Elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < currentProcessElementsLength; elementIndex++ ) {\n var element: HTMLElement = _current_Process_Elements[ elementIndex ];\n\n element.removeEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n }\n\n _current_Process_Elements = [] as HTMLElement[];\n\n window.removeEventListener( \"mousemove\", closeDialog );\n\n closeDialog();\n }\n\n function onNodeMouseOver( e: MouseEvent, element: HTMLElement ) {\n DomElement.cancelBubble( e );\n \n if ( _dialog_Timer !== 0 ) {\n clearTimeout( _dialog_Timer );\n _dialog_Timer = 0;\n }\n\n _dialog_Timer = setTimeout( () => {\n buildDialogContent( element );\n\n DomElement.showElementAtMousePosition( e, _dialog );\n }, _configuration.dialogDisplayDelay );\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildOptions( newOptions: any ) : Options {\n let options: Options = Data.getDefaultObject( newOptions, {} as Options );\n options.nodeType = Data.getDefaultStringOrArray( options.nodeType, [] );\n options.mode = Data.getDefaultNumber( options.mode, Mode.css );\n options.titleText = Data.getDefaultString( options.titleText, Char.empty );\n options.showOnly = Data.getDefaultStringOrArray( options.showOnly, [] );\n options.allowEditing = Data.getDefaultBoolean( options.allowEditing, false );\n\n return options;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: Configuration = null! ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.dialogDisplayDelay = Data.getDefaultNumber( _configuration.dialogDisplayDelay, 1000 );\n\n buildDefaultStringConfiguration();\n }\n\n function buildDefaultStringConfiguration() : void {\n _configuration.cssPropertiesText = Data.getDefaultAnyString( _configuration.cssPropertiesText, \"CSS Properties\" );\n _configuration.attributesText = Data.getDefaultAnyString( _configuration.attributesText, \"Attributes\" );\n _configuration.sizeText = Data.getDefaultAnyString( _configuration.sizeText, \"Size\" );\n _configuration.noAttributesAvailableText = Data.getDefaultAnyString( _configuration.noAttributesAvailableText, \"No attributes are available.\" );\n _configuration.closeText = Data.getDefaultAnyString( _configuration.closeText, \"Close\" );\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: Running\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n start: function ( options: Options ): PublicApi {\n if ( !Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = buildOptions( options );\n\n setDialogText();\n buildNodeEvents();\n }\n\n return _public;\n },\n\n stop: function (): PublicApi {\n if ( Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = null!;\n\n removeNodeEvents();\n }\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 buildDialog();\n\n if ( Is.definedObject( _current_Process_Options ) ) {\n setDialogText();\n }\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.1.1\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Heat.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", () => {\n buildDialog();\n } );\n\n if ( !Is.defined( window.$peek ) ) {\n window.$peek = _public;\n }\n } )();\n} )();"]} \ No newline at end of file diff --git a/dist/peek.js b/dist/peek.js index 5ed4824..483ab8a 100644 --- a/dist/peek.js +++ b/dist/peek.js @@ -263,7 +263,11 @@ var o; } function A(e, t, n, o) { if (e.code === "Enter") { - o.style.setProperty(t, n.value); + if (a.mode === 1) { + o.style.setProperty(t, n.value); + } else if (a.mode === 2) { + o.setAttribute(t, n.value); + } } } function S() { diff --git a/dist/peek.js.map b/dist/peek.js.map index 6c630bc..d1af85e 100644 --- a/dist/peek.js.map +++ b/dist/peek.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/ts/is.ts","../src/ts/constant.ts","../src/ts/dom.ts","../src/ts/data.ts","../src/peek.ts"],"names":["Is","Constant","DomElement","Data"],"mappings":";;;AAgBO,IAAU;AAAA,CAAV,CAAUA,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,KAAK,OAAO,WAAW;AAAA,EAClD;AAFO,EAAAA,IAAS;AAIT,WAAS,aAAc,QAAwB;AAClD,WAAO,cAAe,MAAO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,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;AACpD,sBAAY;AAEZ,cAAK,GAAG,cAAe,wBAAyB,GAAI;AAChD,0BAAc;AAAA,UAClB;AAAA,QACJ;AAAA,MACJ;AAEA,aAAO;AAAA,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,YAAY,WAAoB;AAC5B,aAAO;AAAA,IACX;AAAA,EACJ;AASA,GAAE,MAAM;AACJ,8BAA0B;AAE1B,aAAS,iBAAkB,oBAAoB,MAAM;AACjD,kBAAY;AAAA,IAChB,CAAE;AAEF,QAAK,CAAC,GAAG,QAAS,OAAO,KAAM,GAAI;AAC/B,aAAO,QAAQ;AAAA,IACnB;AAAA,EACJ,GAAI;AACR,GAAI","sourcesContent":["/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file is.ts\n * @version v1.1.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 export function invalidOptionArray( array: any, minimumLength: number = 1 ) : boolean {\n return !definedArray( array ) || array.length < minimumLength;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file constant.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const PEEK_JS_IGNORE_STATE_ATTRIBUTE = \"data-peek-js-ignore-state\";\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file dom.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Constant } from \"./constant\";\nimport { Char, IgnoreState } from \"./enum\";\nimport { Is } from \"./is\";\nimport { type Position } from \"./type\";\n\n\nexport namespace DomElement {\n export function create( container: HTMLElement, type: string, className: string = Char.empty ) : HTMLElement {\n const nodeType: string = type.toLowerCase();\n const isText: boolean = nodeType === \"text\";\n\n let result: any = isText ? document.createTextNode( Char.empty ) : document.createElement( nodeType );\n\n result.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n if ( Is.defined( className ) ) {\n result.className = className;\n }\n\n container.appendChild( result );\n\n return result;\n }\n\n export function createWithHTML( container: HTMLElement, type: string, className: string, html: string ) : HTMLElement {\n const element: HTMLElement = create( container, type, className );\n element.innerHTML = html;\n element.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n return element;\n }\n\n export function cancelBubble( e: Event ) {\n e.preventDefault();\n e.cancelBubble = true;\n }\n\n export function getScrollPosition() : Position {\n const documentElement: HTMLElement = document.documentElement;\n\n const result: Position = {\n left: documentElement.scrollLeft - ( documentElement.clientLeft || 0 ),\n top: documentElement.scrollTop - ( documentElement.clientTop || 0 )\n } as Position;\n\n return result;\n }\n\n export function showElementAtMousePosition( e: any, element: HTMLElement ) {\n if ( element.style.display !== \"block\" ) {\n let left: number = e.pageX;\n let top: number = e.pageY;\n const scrollPosition: Position = getScrollPosition();\n \n element.style.display = \"block\";\n \n if ( left + element.offsetWidth > window.innerWidth ) {\n left -= element.offsetWidth;\n } else {\n left++;\n }\n \n if ( top + element.offsetHeight > window.innerHeight ) {\n top -= element.offsetHeight;\n } else {\n top++;\n }\n \n if ( left < scrollPosition.left ) {\n left = e.pageX + 1;\n }\n \n if ( top < scrollPosition.top ) {\n top = e.pageY + 1;\n }\n \n element.style.left = left + \"px\";\n element.style.top = top + \"px\";\n }\n }\n\n export function getOffset( element: HTMLElement ) : Position {\n const result: Position = {\n left: 0,\n top: 0\n } as Position;\n\n while ( element && !isNaN( element.offsetLeft ) && !isNaN( element.offsetTop ) ) {\n result.left += element.offsetLeft - element.scrollLeft;\n result.top += element.offsetTop - element.scrollTop;\n\n element = element.offsetParent as HTMLElement;\n }\n\n return result;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file data.ts\n * @version v1.1.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 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 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 getDefaultStringOrArray( value: any, defaultValue: any[] ) : any[] {\n let result: any[] = 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 * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file peek.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Position, type Configuration, type Options } from \"./ts/type\";\nimport { PublicApi } from \"./ts/api\";\nimport { Is } from \"./ts/is\";\nimport { DomElement } from \"./ts/dom\";\nimport { Data } from \"./ts/data\";\nimport { Char, IgnoreState, KeyCode, Mode, Value } from \"./ts/enum\";\nimport { Constant } from \"./ts/constant\";\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Dialog\n let _dialog: HTMLElement = null!;\n let _dialog_Title: HTMLElement = null!;\n let _dialog_Contents: HTMLElement = null!;\n let _dialog_Buttons: HTMLElement = null!;\n let _dialog_Timer: number = 0;\n\n // Variables: Current Process:\n let _current_Process_Options: Options = null!;\n let _current_Process_Elements: HTMLElement[] = [];\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialog() : void {\n if ( Is.definedObject( _dialog ) ) {\n closeDialog();\n\n document.body.removeChild( _dialog );\n _dialog = null!;\n }\n\n _dialog = DomElement.create( document.body, \"div\", \"peek-js\" );\n _dialog.onmousemove = DomElement.cancelBubble;\n\n _dialog_Title = DomElement.create( _dialog, \"div\", \"dialog-title-bar\" );\n _dialog_Contents = DomElement.create( _dialog, \"div\", \"dialog-contents\" );\n _dialog_Buttons = DomElement.create( _dialog, \"div\", \"dialog-buttons\" );\n\n const closeButton: HTMLElement = DomElement.createWithHTML( _dialog_Buttons, \"button\", \"close\", _configuration.closeText! );\n\n closeButton.onclick = () => {\n closeDialog();\n };\n }\n\n function setDialogText() : void {\n let title: string = _current_Process_Options.titleText!;\n\n if ( !Is.definedString( title ) ) {\n if ( _current_Process_Options.mode === Mode.css ) {\n title = _configuration.cssPropertiesText!;\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n title = _configuration.attributesText!;\n } else if ( _current_Process_Options.mode === Mode.size ) {\n title = _configuration.sizeText!;\n }\n }\n\n _dialog_Title.innerHTML = title;\n }\n\n function closeDialog() {\n _dialog.style.display = \"none\";\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog Content\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialogContent( element: HTMLElement ) : void {\n _dialog_Contents.innerHTML = Char.empty;\n _dialog_Contents.scrollTop = 0;\n\n if ( _current_Process_Options.mode === Mode.css ) {\n buildCssProperties( element );\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n buildAttributeProperties( element );\n } else if ( _current_Process_Options.mode === Mode.size ) {\n buildSizeProperties( element );\n }\n }\n\n function buildCssProperties( element: HTMLElement ) : void {\n const computedStyles: CSSStyleDeclaration = getComputedStyle( element );\n const computedStylesLength: number = computedStyles.length;\n\n for( let styleIndex: number = 0; styleIndex < computedStylesLength; styleIndex++ ) {\n buildPropertyRow( element, computedStyles[ styleIndex ], computedStyles.getPropertyValue( computedStyles[ styleIndex ] ) );\n }\n }\n\n function buildAttributeProperties( element: HTMLElement ) : void {\n if ( element.hasAttributes() ) {\n for ( let attribute of element.attributes ) {\n buildPropertyRow( element, attribute.name, attribute.value );\n }\n\n } else {\n _dialog_Contents.innerHTML = _configuration.noAttributesAvailableText!;\n }\n }\n\n function buildSizeProperties( element: HTMLElement ) : void {\n const offset: Position = DomElement.getOffset( element );\n\n buildPropertyRow( element, \"left\", offset.left.toString() + \"px\", false );\n buildPropertyRow( element, \"top\", offset.top.toString() + \"px\", false );\n buildPropertyRow( element, \"width\", element.offsetWidth.toString() + \"px\", false );\n buildPropertyRow( element, \"height\", element.offsetHeight.toString() + \"px\", false );\n }\n\n function buildPropertyRow( element: HTMLElement, propertyNameText: string, propertyValueText: string, allowEditing: boolean = true ) : void {\n if ( _current_Process_Options.showOnly!.length === 0 || _current_Process_Options.showOnly!.indexOf( propertyNameText ) > Value.notFound ) {\n const property: HTMLElement = DomElement.create( _dialog_Contents, \"div\", \"property-row\" );\n\n DomElement.createWithHTML( property, \"div\", \"property-name\", propertyNameText );\n \n const propertyValue: HTMLElement = DomElement.create( property, \"div\", \"property-value\" );\n const propertyValueInput: HTMLInputElement = DomElement.create( propertyValue, \"input\" ) as HTMLInputElement;\n \n propertyValueInput.type = \"text\";\n propertyValueInput.value = propertyValueText;\n\n if ( !_current_Process_Options.allowEditing || !allowEditing ) {\n propertyValueInput.readOnly = true;\n } else {\n propertyValueInput.onkeyup = ( e: KeyboardEvent ) => {\n onPropertyValueKeyUp( e, propertyNameText, propertyValueInput, element );\n }\n }\n }\n }\n\n function onPropertyValueKeyUp( e: KeyboardEvent, propertyName: string, input: HTMLInputElement, element: HTMLElement ) {\n if ( e.code === KeyCode.enter ) {\n element.style.setProperty( propertyName, input.value );\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Node Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildNodeEvents() : void {\n const tagTypes: string[] = _current_Process_Options.nodeType 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 buildNodeEvent( elements[ elementIndex ] );\n }\n }\n\n window.addEventListener( \"mousemove\", closeDialog );\n }\n\n function buildNodeEvent( element: HTMLElement ) : void {\n const attributeValue: string = element.getAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE )!;\n\n if ( !Is.definedString( attributeValue ) ?? attributeValue !== IgnoreState.ignore ) {\n element.addEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n \n _current_Process_Elements.push( element );\n }\n }\n\n function removeNodeEvents() : void {\n const currentProcessElementsLength: number = _current_Process_Elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < currentProcessElementsLength; elementIndex++ ) {\n var element: HTMLElement = _current_Process_Elements[ elementIndex ];\n\n element.removeEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n }\n\n _current_Process_Elements = [] as HTMLElement[];\n\n window.removeEventListener( \"mousemove\", closeDialog );\n\n closeDialog();\n }\n\n function onNodeMouseOver( e: MouseEvent, element: HTMLElement ) {\n DomElement.cancelBubble( e );\n \n if ( _dialog_Timer !== 0 ) {\n clearTimeout( _dialog_Timer );\n _dialog_Timer = 0;\n }\n\n _dialog_Timer = setTimeout( () => {\n buildDialogContent( element );\n\n DomElement.showElementAtMousePosition( e, _dialog );\n }, _configuration.dialogDisplayDelay );\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildOptions( newOptions: any ) : Options {\n let options: Options = Data.getDefaultObject( newOptions, {} as Options );\n options.nodeType = Data.getDefaultStringOrArray( options.nodeType, [] );\n options.mode = Data.getDefaultNumber( options.mode, Mode.css );\n options.titleText = Data.getDefaultString( options.titleText, Char.empty );\n options.showOnly = Data.getDefaultStringOrArray( options.showOnly, [] );\n options.allowEditing = Data.getDefaultBoolean( options.allowEditing, false );\n\n return options;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: Configuration = null! ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.dialogDisplayDelay = Data.getDefaultNumber( _configuration.dialogDisplayDelay, 1000 );\n\n buildDefaultStringConfiguration();\n }\n\n function buildDefaultStringConfiguration() : void {\n _configuration.cssPropertiesText = Data.getDefaultAnyString( _configuration.cssPropertiesText, \"CSS Properties\" );\n _configuration.attributesText = Data.getDefaultAnyString( _configuration.attributesText, \"Attributes\" );\n _configuration.sizeText = Data.getDefaultAnyString( _configuration.sizeText, \"Size\" );\n _configuration.noAttributesAvailableText = Data.getDefaultAnyString( _configuration.noAttributesAvailableText, \"No attributes are available.\" );\n _configuration.closeText = Data.getDefaultAnyString( _configuration.closeText, \"Close\" );\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: Running\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n start: function ( options: Options ): PublicApi {\n if ( !Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = buildOptions( options );\n\n setDialogText();\n buildNodeEvents();\n }\n\n return _public;\n },\n\n stop: function (): PublicApi {\n if ( Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = null!;\n\n removeNodeEvents();\n }\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 buildDialog();\n\n if ( Is.definedObject( _current_Process_Options ) ) {\n setDialogText();\n }\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.1.1\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Heat.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", () => {\n buildDialog();\n } );\n\n if ( !Is.defined( window.$peek ) ) {\n window.$peek = _public;\n }\n } )();\n} )();"]} \ No newline at end of file +{"version":3,"sources":["../src/ts/is.ts","../src/ts/constant.ts","../src/ts/dom.ts","../src/ts/data.ts","../src/peek.ts"],"names":["Is","Constant","DomElement","Data"],"mappings":";;;AAgBO,IAAU;AAAA,CAAV,CAAUA,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,eA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J,GAAI;AACR,GAAI","sourcesContent":["/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file is.ts\n * @version v1.1.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 export function invalidOptionArray( array: any, minimumLength: number = 1 ) : boolean {\n return !definedArray( array ) || array.length < minimumLength;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file constant.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nexport namespace Constant {\n export const PEEK_JS_IGNORE_STATE_ATTRIBUTE = \"data-peek-js-ignore-state\";\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file dom.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Constant } from \"./constant\";\nimport { Char, IgnoreState } from \"./enum\";\nimport { Is } from \"./is\";\nimport { type Position } from \"./type\";\n\n\nexport namespace DomElement {\n export function create( container: HTMLElement, type: string, className: string = Char.empty ) : HTMLElement {\n const nodeType: string = type.toLowerCase();\n const isText: boolean = nodeType === \"text\";\n\n let result: any = isText ? document.createTextNode( Char.empty ) : document.createElement( nodeType );\n\n result.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n if ( Is.defined( className ) ) {\n result.className = className;\n }\n\n container.appendChild( result );\n\n return result;\n }\n\n export function createWithHTML( container: HTMLElement, type: string, className: string, html: string ) : HTMLElement {\n const element: HTMLElement = create( container, type, className );\n element.innerHTML = html;\n element.setAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE, IgnoreState.ignore );\n\n return element;\n }\n\n export function cancelBubble( e: Event ) {\n e.preventDefault();\n e.cancelBubble = true;\n }\n\n export function getScrollPosition() : Position {\n const documentElement: HTMLElement = document.documentElement;\n\n const result: Position = {\n left: documentElement.scrollLeft - ( documentElement.clientLeft || 0 ),\n top: documentElement.scrollTop - ( documentElement.clientTop || 0 )\n } as Position;\n\n return result;\n }\n\n export function showElementAtMousePosition( e: any, element: HTMLElement ) {\n if ( element.style.display !== \"block\" ) {\n let left: number = e.pageX;\n let top: number = e.pageY;\n const scrollPosition: Position = getScrollPosition();\n \n element.style.display = \"block\";\n \n if ( left + element.offsetWidth > window.innerWidth ) {\n left -= element.offsetWidth;\n } else {\n left++;\n }\n \n if ( top + element.offsetHeight > window.innerHeight ) {\n top -= element.offsetHeight;\n } else {\n top++;\n }\n \n if ( left < scrollPosition.left ) {\n left = e.pageX + 1;\n }\n \n if ( top < scrollPosition.top ) {\n top = e.pageY + 1;\n }\n \n element.style.left = left + \"px\";\n element.style.top = top + \"px\";\n }\n }\n\n export function getOffset( element: HTMLElement ) : Position {\n const result: Position = {\n left: 0,\n top: 0\n } as Position;\n\n while ( element && !isNaN( element.offsetLeft ) && !isNaN( element.offsetTop ) ) {\n result.left += element.offsetLeft - element.scrollLeft;\n result.top += element.offsetTop - element.scrollTop;\n\n element = element.offsetParent as HTMLElement;\n }\n\n return result;\n }\n}","/**\n * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file data.ts\n * @version v1.1.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 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 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 getDefaultStringOrArray( value: any, defaultValue: any[] ) : any[] {\n let result: any[] = 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 * Peek.js\n * \n * A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position.\n * \n * @file peek.ts\n * @version v1.1.1\n * @author Bunoon\n * @license MIT License\n * @copyright Bunoon 2024\n */\n\n\nimport { Position, type Configuration, type Options } from \"./ts/type\";\nimport { PublicApi } from \"./ts/api\";\nimport { Is } from \"./ts/is\";\nimport { DomElement } from \"./ts/dom\";\nimport { Data } from \"./ts/data\";\nimport { Char, IgnoreState, KeyCode, Mode, Value } from \"./ts/enum\";\nimport { Constant } from \"./ts/constant\";\n\n\n( () => {\n // Variables: Configuration\n let _configuration: Configuration = {} as Configuration;\n\n // Variables: Dialog\n let _dialog: HTMLElement = null!;\n let _dialog_Title: HTMLElement = null!;\n let _dialog_Contents: HTMLElement = null!;\n let _dialog_Buttons: HTMLElement = null!;\n let _dialog_Timer: number = 0;\n\n // Variables: Current Process:\n let _current_Process_Options: Options = null!;\n let _current_Process_Elements: HTMLElement[] = [];\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialog() : void {\n if ( Is.definedObject( _dialog ) ) {\n closeDialog();\n\n document.body.removeChild( _dialog );\n _dialog = null!;\n }\n\n _dialog = DomElement.create( document.body, \"div\", \"peek-js\" );\n _dialog.onmousemove = DomElement.cancelBubble;\n\n _dialog_Title = DomElement.create( _dialog, \"div\", \"dialog-title-bar\" );\n _dialog_Contents = DomElement.create( _dialog, \"div\", \"dialog-contents\" );\n _dialog_Buttons = DomElement.create( _dialog, \"div\", \"dialog-buttons\" );\n\n const closeButton: HTMLElement = DomElement.createWithHTML( _dialog_Buttons, \"button\", \"close\", _configuration.closeText! );\n\n closeButton.onclick = () => {\n closeDialog();\n };\n }\n\n function setDialogText() : void {\n let title: string = _current_Process_Options.titleText!;\n\n if ( !Is.definedString( title ) ) {\n if ( _current_Process_Options.mode === Mode.css ) {\n title = _configuration.cssPropertiesText!;\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n title = _configuration.attributesText!;\n } else if ( _current_Process_Options.mode === Mode.size ) {\n title = _configuration.sizeText!;\n }\n }\n\n _dialog_Title.innerHTML = title;\n }\n\n function closeDialog() {\n _dialog.style.display = \"none\";\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Build Dialog Content\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildDialogContent( element: HTMLElement ) : void {\n _dialog_Contents.innerHTML = Char.empty;\n _dialog_Contents.scrollTop = 0;\n\n if ( _current_Process_Options.mode === Mode.css ) {\n buildCssProperties( element );\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n buildAttributeProperties( element );\n } else if ( _current_Process_Options.mode === Mode.size ) {\n buildSizeProperties( element );\n }\n }\n\n function buildCssProperties( element: HTMLElement ) : void {\n const computedStyles: CSSStyleDeclaration = getComputedStyle( element );\n const computedStylesLength: number = computedStyles.length;\n\n for( let styleIndex: number = 0; styleIndex < computedStylesLength; styleIndex++ ) {\n buildPropertyRow( element, computedStyles[ styleIndex ], computedStyles.getPropertyValue( computedStyles[ styleIndex ] ) );\n }\n }\n\n function buildAttributeProperties( element: HTMLElement ) : void {\n if ( element.hasAttributes() ) {\n for ( let attribute of element.attributes ) {\n buildPropertyRow( element, attribute.name, attribute.value );\n }\n\n } else {\n _dialog_Contents.innerHTML = _configuration.noAttributesAvailableText!;\n }\n }\n\n function buildSizeProperties( element: HTMLElement ) : void {\n const offset: Position = DomElement.getOffset( element );\n\n buildPropertyRow( element, \"left\", offset.left.toString() + \"px\", false );\n buildPropertyRow( element, \"top\", offset.top.toString() + \"px\", false );\n buildPropertyRow( element, \"width\", element.offsetWidth.toString() + \"px\", false );\n buildPropertyRow( element, \"height\", element.offsetHeight.toString() + \"px\", false );\n }\n\n function buildPropertyRow( element: HTMLElement, propertyNameText: string, propertyValueText: string, allowEditing: boolean = true ) : void {\n if ( _current_Process_Options.showOnly!.length === 0 || _current_Process_Options.showOnly!.indexOf( propertyNameText ) > Value.notFound ) {\n const property: HTMLElement = DomElement.create( _dialog_Contents, \"div\", \"property-row\" );\n\n DomElement.createWithHTML( property, \"div\", \"property-name\", propertyNameText );\n \n const propertyValue: HTMLElement = DomElement.create( property, \"div\", \"property-value\" );\n const propertyValueInput: HTMLInputElement = DomElement.create( propertyValue, \"input\" ) as HTMLInputElement;\n \n propertyValueInput.type = \"text\";\n propertyValueInput.value = propertyValueText;\n\n if ( !_current_Process_Options.allowEditing || !allowEditing ) {\n propertyValueInput.readOnly = true;\n } else {\n propertyValueInput.onkeyup = ( e: KeyboardEvent ) => {\n onPropertyValueKeyUp( e, propertyNameText, propertyValueInput, element );\n }\n }\n }\n }\n\n function onPropertyValueKeyUp( e: KeyboardEvent, propertyName: string, input: HTMLInputElement, element: HTMLElement ) {\n if ( e.code === KeyCode.enter ) {\n if ( _current_Process_Options.mode === Mode.css ) {\n element.style.setProperty( propertyName, input.value );\n } else if ( _current_Process_Options.mode === Mode.attributes ) {\n element.setAttribute( propertyName, input.value );\n }\n }\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Render: Node Events\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildNodeEvents() : void {\n const tagTypes: string[] = _current_Process_Options.nodeType 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 buildNodeEvent( elements[ elementIndex ] );\n }\n }\n\n window.addEventListener( \"mousemove\", closeDialog );\n }\n\n function buildNodeEvent( element: HTMLElement ) : void {\n const attributeValue: string = element.getAttribute( Constant.PEEK_JS_IGNORE_STATE_ATTRIBUTE )!;\n\n if ( !Is.definedString( attributeValue ) ?? attributeValue !== IgnoreState.ignore ) {\n element.addEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n \n _current_Process_Elements.push( element );\n }\n }\n\n function removeNodeEvents() : void {\n const currentProcessElementsLength: number = _current_Process_Elements.length;\n\n for ( let elementIndex: number = 0; elementIndex < currentProcessElementsLength; elementIndex++ ) {\n var element: HTMLElement = _current_Process_Elements[ elementIndex ];\n\n element.removeEventListener( \"mousemove\", ( e ) => {\n onNodeMouseOver( e, element );\n } );\n }\n\n _current_Process_Elements = [] as HTMLElement[];\n\n window.removeEventListener( \"mousemove\", closeDialog );\n\n closeDialog();\n }\n\n function onNodeMouseOver( e: MouseEvent, element: HTMLElement ) {\n DomElement.cancelBubble( e );\n \n if ( _dialog_Timer !== 0 ) {\n clearTimeout( _dialog_Timer );\n _dialog_Timer = 0;\n }\n\n _dialog_Timer = setTimeout( () => {\n buildDialogContent( element );\n\n DomElement.showElementAtMousePosition( e, _dialog );\n }, _configuration.dialogDisplayDelay );\n }\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Options\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n function buildOptions( newOptions: any ) : Options {\n let options: Options = Data.getDefaultObject( newOptions, {} as Options );\n options.nodeType = Data.getDefaultStringOrArray( options.nodeType, [] );\n options.mode = Data.getDefaultNumber( options.mode, Mode.css );\n options.titleText = Data.getDefaultString( options.titleText, Char.empty );\n options.showOnly = Data.getDefaultStringOrArray( options.showOnly, [] );\n options.allowEditing = Data.getDefaultBoolean( options.allowEditing, false );\n\n return options;\n }\n\n\n\t/*\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t * Public API Functions: Helpers: Configuration\n\t * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\t */\n\n function buildDefaultConfiguration( newConfiguration: Configuration = null! ) : void {\n _configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );\n _configuration.dialogDisplayDelay = Data.getDefaultNumber( _configuration.dialogDisplayDelay, 1000 );\n\n buildDefaultStringConfiguration();\n }\n\n function buildDefaultStringConfiguration() : void {\n _configuration.cssPropertiesText = Data.getDefaultAnyString( _configuration.cssPropertiesText, \"CSS Properties\" );\n _configuration.attributesText = Data.getDefaultAnyString( _configuration.attributesText, \"Attributes\" );\n _configuration.sizeText = Data.getDefaultAnyString( _configuration.sizeText, \"Size\" );\n _configuration.noAttributesAvailableText = Data.getDefaultAnyString( _configuration.noAttributesAvailableText, \"No attributes are available.\" );\n _configuration.closeText = Data.getDefaultAnyString( _configuration.closeText, \"Close\" );\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: Running\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n start: function ( options: Options ): PublicApi {\n if ( !Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = buildOptions( options );\n\n setDialogText();\n buildNodeEvents();\n }\n\n return _public;\n },\n\n stop: function (): PublicApi {\n if ( Is.definedObject( _current_Process_Options ) ) {\n _current_Process_Options = null!;\n\n removeNodeEvents();\n }\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 buildDialog();\n\n if ( Is.definedObject( _current_Process_Options ) ) {\n setDialogText();\n }\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.1.1\";\n }\n };\n\n\n /*\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n * Initialize Heat.js\n * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n */\n\n ( () => {\n buildDefaultConfiguration();\n\n document.addEventListener( \"DOMContentLoaded\", () => {\n buildDialog();\n } );\n\n if ( !Is.defined( window.$peek ) ) {\n window.$peek = _public;\n }\n } )();\n} )();"]} \ No newline at end of file diff --git a/dist/peek.min.js b/dist/peek.min.js index 5ecc9ed..8111c32 100644 --- a/dist/peek.min.js +++ b/dist/peek.min.js @@ -1 +1 @@ -"use strict";var e,t,n,o;(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}function o(e){return n(e)&&e instanceof Array}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=o,e.definedDate=function(e){return n(e)&&e instanceof Date},e.invalidOptionArray=function(e,t=1){return!o(e)||e.length{function o(n,o,i=""){const r=o.toLowerCase();let l="text"===r?document.createTextNode(""):document.createElement(r);return l.setAttribute(t.PEEK_JS_IGNORE_STATE_ATTRIBUTE,"ignore"),e.defined(i)&&(l.className=i),n.appendChild(l),l}function i(){const e=document.documentElement;return{left:e.scrollLeft-(e.clientLeft||0),top:e.scrollTop-(e.clientTop||0)}}n.create=o,n.createWithHTML=function(e,n,i,r){const l=o(e,n,i);return l.innerHTML=r,l.setAttribute(t.PEEK_JS_IGNORE_STATE_ATTRIBUTE,"ignore"),l},n.cancelBubble=function(e){e.preventDefault(),e.cancelBubble=!0},n.getScrollPosition=i,n.showElementAtMousePosition=function(e,t){if("block"!==t.style.display){let n=e.pageX,o=e.pageY;const r=i();t.style.display="block",n+t.offsetWidth>window.innerWidth?n-=t.offsetWidth:n++,o+t.offsetHeight>window.innerHeight?o-=t.offsetHeight:o++,n{function n(t,n){return e.definedArray(t)?t:n}t.getDefaultAnyString=function(e,t){return"string"==typeof e?e:t},t.getDefaultString=function(t,n){return e.definedString(t)?t:n},t.getDefaultBoolean=function(t,n){return e.definedBoolean(t)?t:n},t.getDefaultNumber=function(t,n){return e.definedNumber(t)?t:n},t.getDefaultArray=n,t.getDefaultObject=function(t,n){return e.definedObject(t)?t:n},t.getDefaultStringOrArray=function(t,o){let i=o;if(e.definedString(t)){const e=t.toString().split(" ");0===e.length?t=o:i=e}else i=n(t,o);return i}})(o||(o={})),(()=>{let i={},r=null,l=null,u=null,f=null,s=0,a=null,c=[];function d(){e.definedObject(r)&&(p(),document.body.removeChild(r),r=null),r=n.create(document.body,"div","peek-js"),r.onmousemove=n.cancelBubble,l=n.create(r,"div","dialog-title-bar"),u=n.create(r,"div","dialog-contents"),f=n.create(r,"div","dialog-buttons");n.createWithHTML(f,"button","close",i.closeText).onclick=()=>{p()}}function g(){let t=a.titleText;e.definedString(t)||(1===a.mode?t=i.cssPropertiesText:2===a.mode?t=i.attributesText:3===a.mode&&(t=i.sizeText)),l.innerHTML=t}function p(){r.style.display="none"}function T(e){u.innerHTML="",u.scrollTop=0,1===a.mode?function(e){const t=getComputedStyle(e),n=t.length;for(let o=0;o-1){const r=n.create(u,"div","property-row");n.createWithHTML(r,"div","property-name",t);const l=n.create(r,"div","property-value"),f=n.create(l,"input");f.type="text",f.value=o,a.allowEditing&&i?f.onkeyup=n=>{!function(e,t,n,o){"Enter"===e.code&&o.style.setProperty(t,n.value)}(n,t,f,e)}:f.readOnly=!0}}function b(n){const o=n.getAttribute(t.PEEK_JS_IGNORE_STATE_ATTRIBUTE);e.definedString(o)||(n.addEventListener("mousemove",(e=>{m(e,n)})),c.push(n))}function m(e,t){n.cancelBubble(e),0!==s&&(clearTimeout(s),s=0),s=setTimeout((()=>{T(t),n.showElementAtMousePosition(e,r)}),i.dialogDisplayDelay)}function A(e=null){i=o.getDefaultObject(e,{}),i.dialogDisplayDelay=o.getDefaultNumber(i.dialogDisplayDelay,1e3),i.cssPropertiesText=o.getDefaultAnyString(i.cssPropertiesText,"CSS Properties"),i.attributesText=o.getDefaultAnyString(i.attributesText,"Attributes"),i.sizeText=o.getDefaultAnyString(i.sizeText,"Size"),i.noAttributesAvailableText=o.getDefaultAnyString(i.noAttributesAvailableText,"No attributes are available."),i.closeText=o.getDefaultAnyString(i.closeText,"Close")}const S={start:function(t){return e.definedObject(a)||(a=function(e){let t=o.getDefaultObject(e,{});return t.nodeType=o.getDefaultStringOrArray(t.nodeType,[]),t.mode=o.getDefaultNumber(t.mode,1),t.titleText=o.getDefaultString(t.titleText,""),t.showOnly=o.getDefaultStringOrArray(t.showOnly,[]),t.allowEditing=o.getDefaultBoolean(t.allowEditing,!1),t}(t),g(),function(){const e=a.nodeType,t=e.length;for(let n=0;n{m(e,t)}))}c=[],window.removeEventListener("mousemove",p),p()}()),S},setConfiguration:function(t){if(e.definedObject(t)){let n=!1;const o=i;for(let e in t)t.hasOwnProperty(e)&&i.hasOwnProperty(e)&&o[e]!==t[e]&&(o[e]=t[e],n=!0);n&&(A(o),d(),e.definedObject(a)&&g())}return S},getVersion:function(){return"1.1.1"}};A(),document.addEventListener("DOMContentLoaded",(()=>{d()})),e.defined(window.$peek)||(window.$peek=S)})(); \ No newline at end of file +"use strict";var e,t,n,o;(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}function o(e){return n(e)&&e instanceof Array}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=o,e.definedDate=function(e){return n(e)&&e instanceof Date},e.invalidOptionArray=function(e,t=1){return!o(e)||e.length{function o(n,o,i=""){const r=o.toLowerCase();let l="text"===r?document.createTextNode(""):document.createElement(r);return l.setAttribute(t.PEEK_JS_IGNORE_STATE_ATTRIBUTE,"ignore"),e.defined(i)&&(l.className=i),n.appendChild(l),l}function i(){const e=document.documentElement;return{left:e.scrollLeft-(e.clientLeft||0),top:e.scrollTop-(e.clientTop||0)}}n.create=o,n.createWithHTML=function(e,n,i,r){const l=o(e,n,i);return l.innerHTML=r,l.setAttribute(t.PEEK_JS_IGNORE_STATE_ATTRIBUTE,"ignore"),l},n.cancelBubble=function(e){e.preventDefault(),e.cancelBubble=!0},n.getScrollPosition=i,n.showElementAtMousePosition=function(e,t){if("block"!==t.style.display){let n=e.pageX,o=e.pageY;const r=i();t.style.display="block",n+t.offsetWidth>window.innerWidth?n-=t.offsetWidth:n++,o+t.offsetHeight>window.innerHeight?o-=t.offsetHeight:o++,n{function n(t,n){return e.definedArray(t)?t:n}t.getDefaultAnyString=function(e,t){return"string"==typeof e?e:t},t.getDefaultString=function(t,n){return e.definedString(t)?t:n},t.getDefaultBoolean=function(t,n){return e.definedBoolean(t)?t:n},t.getDefaultNumber=function(t,n){return e.definedNumber(t)?t:n},t.getDefaultArray=n,t.getDefaultObject=function(t,n){return e.definedObject(t)?t:n},t.getDefaultStringOrArray=function(t,o){let i=o;if(e.definedString(t)){const e=t.toString().split(" ");0===e.length?t=o:i=e}else i=n(t,o);return i}})(o||(o={})),(()=>{let i={},r=null,l=null,u=null,f=null,s=0,a=null,c=[];function d(){e.definedObject(r)&&(p(),document.body.removeChild(r),r=null),r=n.create(document.body,"div","peek-js"),r.onmousemove=n.cancelBubble,l=n.create(r,"div","dialog-title-bar"),u=n.create(r,"div","dialog-contents"),f=n.create(r,"div","dialog-buttons");n.createWithHTML(f,"button","close",i.closeText).onclick=()=>{p()}}function g(){let t=a.titleText;e.definedString(t)||(1===a.mode?t=i.cssPropertiesText:2===a.mode?t=i.attributesText:3===a.mode&&(t=i.sizeText)),l.innerHTML=t}function p(){r.style.display="none"}function T(e){u.innerHTML="",u.scrollTop=0,1===a.mode?function(e){const t=getComputedStyle(e),n=t.length;for(let o=0;o-1){const r=n.create(u,"div","property-row");n.createWithHTML(r,"div","property-name",t);const l=n.create(r,"div","property-value"),f=n.create(l,"input");f.type="text",f.value=o,a.allowEditing&&i?f.onkeyup=n=>{!function(e,t,n,o){"Enter"===e.code&&(1===a.mode?o.style.setProperty(t,n.value):2===a.mode&&o.setAttribute(t,n.value))}(n,t,f,e)}:f.readOnly=!0}}function b(n){const o=n.getAttribute(t.PEEK_JS_IGNORE_STATE_ATTRIBUTE);e.definedString(o)||(n.addEventListener("mousemove",(e=>{m(e,n)})),c.push(n))}function m(e,t){n.cancelBubble(e),0!==s&&(clearTimeout(s),s=0),s=setTimeout((()=>{T(t),n.showElementAtMousePosition(e,r)}),i.dialogDisplayDelay)}function A(e=null){i=o.getDefaultObject(e,{}),i.dialogDisplayDelay=o.getDefaultNumber(i.dialogDisplayDelay,1e3),i.cssPropertiesText=o.getDefaultAnyString(i.cssPropertiesText,"CSS Properties"),i.attributesText=o.getDefaultAnyString(i.attributesText,"Attributes"),i.sizeText=o.getDefaultAnyString(i.sizeText,"Size"),i.noAttributesAvailableText=o.getDefaultAnyString(i.noAttributesAvailableText,"No attributes are available."),i.closeText=o.getDefaultAnyString(i.closeText,"Close")}const S={start:function(t){return e.definedObject(a)||(a=function(e){let t=o.getDefaultObject(e,{});return t.nodeType=o.getDefaultStringOrArray(t.nodeType,[]),t.mode=o.getDefaultNumber(t.mode,1),t.titleText=o.getDefaultString(t.titleText,""),t.showOnly=o.getDefaultStringOrArray(t.showOnly,[]),t.allowEditing=o.getDefaultBoolean(t.allowEditing,!1),t}(t),g(),function(){const e=a.nodeType,t=e.length;for(let n=0;n{m(e,t)}))}c=[],window.removeEventListener("mousemove",p),p()}()),S},setConfiguration:function(t){if(e.definedObject(t)){let n=!1;const o=i;for(let e in t)t.hasOwnProperty(e)&&i.hasOwnProperty(e)&&o[e]!==t[e]&&(o[e]=t[e],n=!0);n&&(A(o),d(),e.definedObject(a)&&g())}return S},getVersion:function(){return"1.1.1"}};A(),document.addEventListener("DOMContentLoaded",(()=>{d()})),e.defined(window.$peek)||(window.$peek=S)})(); \ No newline at end of file diff --git a/docs/CHANGE_LOG.md b/docs/CHANGE_LOG.md index 92ef98a..c12ac8a 100755 --- a/docs/CHANGE_LOG.md +++ b/docs/CHANGE_LOG.md @@ -1,6 +1,13 @@ # Peek.js - Change Log: ## Version 1.1.1: +- Updated NPM packages to the latest versions. +- Fixed a fault that prevented attribute values assigning their values to CSS properties when "allowEditing" is enabled. + +
+ + +## Version 1.1.0: - Added a new binding option called "showOnly" (excepts a string, or string array), which states the properties that should be shown in the dialog. - Added a new binding option called "allowEditing" (defaults to false), which allows CSS and Attribute values to be entered (simply type and press Enter). - Fixed a fault that caused the dialog elements to be included when viewing specific node types. @@ -8,5 +15,6 @@
+ ## Version 1.0.0: - Everything :) \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index dbaf51b..d93da54 100644 --- a/package-lock.json +++ b/package-lock.json @@ -472,9 +472,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true, "license": "MIT" }, @@ -539,9 +539,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", - "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", + "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==", "cpu": [ "arm" ], @@ -553,9 +553,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", - "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.1.tgz", + "integrity": "sha512-F/tkdw0WSs4ojqz5Ovrw5r9odqzFjb5LIgHdHZG65dFI1lWTWRVy32KDJLKRISHgJvqUeUhdIvy43fX41znyDg==", "cpu": [ "arm64" ], @@ -567,9 +567,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", - "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", + "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==", "cpu": [ "arm64" ], @@ -581,9 +581,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", - "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", + "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==", "cpu": [ "x64" ], @@ -595,9 +595,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", - "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", + "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==", "cpu": [ "arm" ], @@ -609,9 +609,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", - "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", + "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==", "cpu": [ "arm" ], @@ -623,9 +623,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", - "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", + "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==", "cpu": [ "arm64" ], @@ -637,9 +637,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", - "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", + "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==", "cpu": [ "arm64" ], @@ -651,9 +651,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", - "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", + "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==", "cpu": [ "ppc64" ], @@ -665,9 +665,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", - "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", + "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==", "cpu": [ "riscv64" ], @@ -679,9 +679,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", - "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", + "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==", "cpu": [ "s390x" ], @@ -693,9 +693,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", - "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "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==", "cpu": [ "x64" ], @@ -707,9 +707,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", - "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", + "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==", "cpu": [ "x64" ], @@ -721,9 +721,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", - "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", + "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==", "cpu": [ "arm64" ], @@ -735,9 +735,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", - "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", + "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==", "cpu": [ "ia32" ], @@ -749,9 +749,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", - "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", + "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==", "cpu": [ "x64" ], @@ -763,9 +763,9 @@ ] }, "node_modules/@swc/core": { - "version": "1.6.12", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.6.12.tgz", - "integrity": "sha512-XWS4fQrmZUsMUOzKWZHoSO5sBNUlLpbi++WpCtGyoXC279IKBnWL90YS7SxjYudiKuGDBWrS7Ph25yN63vTZYg==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.6.13.tgz", + "integrity": "sha512-eailUYex6fkfaQTev4Oa3mwn0/e3mQU4H8y1WPuImYQESOQDtVrowwUGDSc19evpBbHpKtwM+hw8nLlhIsF+Tw==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", @@ -781,16 +781,16 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-darwin-arm64": "1.6.12", - "@swc/core-darwin-x64": "1.6.12", - "@swc/core-linux-arm-gnueabihf": "1.6.12", - "@swc/core-linux-arm64-gnu": "1.6.12", - "@swc/core-linux-arm64-musl": "1.6.12", - "@swc/core-linux-x64-gnu": "1.6.12", - "@swc/core-linux-x64-musl": "1.6.12", - "@swc/core-win32-arm64-msvc": "1.6.12", - "@swc/core-win32-ia32-msvc": "1.6.12", - "@swc/core-win32-x64-msvc": "1.6.12" + "@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" }, "peerDependencies": { "@swc/helpers": "*" @@ -802,9 +802,9 @@ } }, "node_modules/@swc/core-darwin-arm64": { - "version": "1.6.12", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.6.12.tgz", - "integrity": "sha512-aVDdQ5BNn6pFedCZIE/756rGo+6P7ue1sYtTseBlGe94yfj6jr0I7nAffBnXAA9cbQ46aMtmKvVfv023HmUwNg==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.6.13.tgz", + "integrity": "sha512-SOF4buAis72K22BGJ3N8y88mLNfxLNprTuJUpzikyMGrvkuBFNcxYtMhmomO0XHsgLDzOJ+hWzcgjRNzjMsUcQ==", "cpu": [ "arm64" ], @@ -819,9 +819,9 @@ } }, "node_modules/@swc/core-darwin-x64": { - "version": "1.6.12", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.6.12.tgz", - "integrity": "sha512-ud+wlkWdQKawtpdjWNP2+ZLiwZU2xkKuC3L8uhlLy6MGNmRl6OGIpD/ASEDfOy3O77UhrjYRuOiOxsgBmXwuow==", + "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==", "cpu": [ "x64" ], @@ -836,9 +836,9 @@ } }, "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.6.12", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.6.12.tgz", - "integrity": "sha512-I5370gbWGsyrlgQQ0bB3j2TALUTr/AZpOXFbwhB45HsUwpV+W1ZpuB0L5d6uzlX+UvMtoNXtUYiDCcdFWw2UXA==", + "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==", "cpu": [ "arm" ], @@ -853,9 +853,9 @@ } }, "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.6.12", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.6.12.tgz", - "integrity": "sha512-5SzAKf+rzsTwU/OCbEF+v7sUO5DVHbM5v2nYhZf8Otq4Lqphr9X65CIlmyakv77s7vIN4IrX+e8FOffSVF+OpQ==", + "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==", "cpu": [ "arm64" ], @@ -870,9 +870,9 @@ } }, "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.6.12", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.6.12.tgz", - "integrity": "sha512-Hsy04ZPUSs6oti2ZqCoMa+3r9wBU/rhEyYYoTiqWKtdH2zxqXyph8ZfEdJfAop5STX6w318iqMiAh0p7TBM3ew==", + "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==", "cpu": [ "arm64" ], @@ -887,9 +887,9 @@ } }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.6.12", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.6.12.tgz", - "integrity": "sha512-86PsFFQsTXdJWXM/VjNLNE2s0JFB05Pi6DwSOa2/5g7HIHk1QuD8TCusB4zcky4F3MX78QDRHKLpxIEnOV6Tnw==", + "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==", "cpu": [ "x64" ], @@ -904,9 +904,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.6.12", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.6.12.tgz", - "integrity": "sha512-qqylxwMWRVYh0XiozJLajX25yqCABkaySGS1eNXIDQsc7uV8Z7qq5OB07Ilpm6FxIkyRnrjUfGG9WO4UfBWiXQ==", + "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==", "cpu": [ "x64" ], @@ -921,9 +921,9 @@ } }, "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.6.12", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.6.12.tgz", - "integrity": "sha512-nl6/7kOKSx5R4j25yANfKJntJpFy41bAIhEcI3bpm8Xay2BDp6YrDQtpaYT/MeBFzg6EUWg/YYQLcOhZsSvmaw==", + "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==", "cpu": [ "arm64" ], @@ -938,9 +938,9 @@ } }, "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.6.12", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.6.12.tgz", - "integrity": "sha512-GfWyYotHr3u6QvmGxagcIOiheK/fxP/+CTJ+SdtkADBHGLfgs/Bc9ePqzTY033sdjTVzPCOujV/JRVizmOnavA==", + "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==", "cpu": [ "ia32" ], @@ -955,9 +955,9 @@ } }, "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.6.12", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.6.12.tgz", - "integrity": "sha512-W00XNkFQnGf+2JXTPjxg3qhgYfblETXqeQBN1nAg2OXoMuvyU+xs+Qp9CryO+mOGt613GlZ/etmOvkC2xX1l7Q==", + "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==", "cpu": [ "x64" ], @@ -1415,9 +1415,9 @@ } }, "node_modules/glob": { - "version": "10.4.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.2.tgz", - "integrity": "sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "license": "ISC", "dependencies": { @@ -1431,9 +1431,6 @@ "bin": { "glob": "dist/esm/bin.mjs" }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } @@ -1453,7 +1450,7 @@ }, "node_modules/globby": { "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.1.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "license": "MIT", @@ -1576,17 +1573,14 @@ "license": "ISC" }, "node_modules/jackspeak": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", - "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, - "engines": { - "node": ">=14" - }, "funding": { "url": "https://github.com/sponsors/isaacs" }, @@ -1642,14 +1636,11 @@ "license": "MIT" }, "node_modules/lru-cache": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.3.0.tgz", - "integrity": "sha512-CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "dev": true, - "license": "ISC", - "engines": { - "node": "14 || >=16.14" - } + "license": "ISC" }, "node_modules/merge-stream": { "version": "2.0.0", @@ -1955,9 +1946,9 @@ } }, "node_modules/rollup": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", - "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.1.tgz", + "integrity": "sha512-Elx2UT8lzxxOXMpy5HWQGZqkrQOtrVDDa/bm9l10+U4rQnVzbL/LgZ4NOM1MPIDyHk69W4InuYDF5dzRh4Kw1A==", "dev": true, "license": "MIT", "dependencies": { @@ -1971,22 +1962,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.18.0", - "@rollup/rollup-android-arm64": "4.18.0", - "@rollup/rollup-darwin-arm64": "4.18.0", - "@rollup/rollup-darwin-x64": "4.18.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", - "@rollup/rollup-linux-arm-musleabihf": "4.18.0", - "@rollup/rollup-linux-arm64-gnu": "4.18.0", - "@rollup/rollup-linux-arm64-musl": "4.18.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", - "@rollup/rollup-linux-riscv64-gnu": "4.18.0", - "@rollup/rollup-linux-s390x-gnu": "4.18.0", - "@rollup/rollup-linux-x64-gnu": "4.18.0", - "@rollup/rollup-linux-x64-musl": "4.18.0", - "@rollup/rollup-win32-arm64-msvc": "4.18.0", - "@rollup/rollup-win32-ia32-msvc": "4.18.0", - "@rollup/rollup-win32-x64-msvc": "4.18.0", + "@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", "fsevents": "~2.3.2" } }, @@ -2015,9 +2006,9 @@ } }, "node_modules/sass": { - "version": "1.77.6", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.77.6.tgz", - "integrity": "sha512-ByXE1oLD79GVq9Ht1PeHWCPMPB8XHpBuz1r85oByKHjZY6qV6rWnQovQzXJXuQ/XyE1Oj3iPk3lo28uzaRA2/Q==", + "version": "1.77.7", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.77.7.tgz", + "integrity": "sha512-9ywH75cO+rLjbrZ6en3Gp8qAMwPGBapFtlsMJoDTkcMU/bSe5a6cjKVUn5Jr4Gzg5GbP3HE8cm+02pLCgcoMow==", "dev": true, "license": "MIT", "dependencies": { @@ -2251,9 +2242,9 @@ } }, "node_modules/terser": { - "version": "5.31.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.1.tgz", - "integrity": "sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg==", + "version": "5.31.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.2.tgz", + "integrity": "sha512-LGyRZVFm/QElZHy/CPr/O4eNZOZIzsrQ92y4v9UJe/pFJjypje2yI3C2FmPtvUEnhadlSbmG2nXtdcjHOjCfxw==", "dev": true, "license": "BSD-2-Clause", "dependencies": { diff --git a/src/peek.ts b/src/peek.ts index 8c24d40..f393de4 100644 --- a/src/peek.ts +++ b/src/peek.ts @@ -156,7 +156,11 @@ import { Constant } from "./ts/constant"; function onPropertyValueKeyUp( e: KeyboardEvent, propertyName: string, input: HTMLInputElement, element: HTMLElement ) { if ( e.code === KeyCode.enter ) { - element.style.setProperty( propertyName, input.value ); + if ( _current_Process_Options.mode === Mode.css ) { + element.style.setProperty( propertyName, input.value ); + } else if ( _current_Process_Options.mode === Mode.attributes ) { + element.setAttribute( propertyName, input.value ); + } } } diff --git a/test/peek.js.attributes.html b/test/peek.js.attributes.html index 3dda1d8..88785c1 100644 --- a/test/peek.js.attributes.html +++ b/test/peek.js.attributes.html @@ -25,7 +25,7 @@

Configuration:


Running:

- +
From a20852c04644245eed128d85d4786728645f92ec Mon Sep 17 00:00:00 2001 From: William Troup Date: Wed, 10 Jul 2024 21:01:49 +0100 Subject: [PATCH 3/3] Updated change log. --- docs/CHANGE_LOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CHANGE_LOG.md b/docs/CHANGE_LOG.md index c12ac8a..eda42e6 100755 --- a/docs/CHANGE_LOG.md +++ b/docs/CHANGE_LOG.md @@ -2,7 +2,7 @@ ## Version 1.1.1: - Updated NPM packages to the latest versions. -- Fixed a fault that prevented attribute values assigning their values to CSS properties when "allowEditing" is enabled. +- Fixed a fault that caused attribute values to assign their values to CSS properties when "allowEditing" is enabled.