js-mvc-framework
Advanced tools
Comparing version 1.2.16 to 1.2.17
@@ -132,4 +132,49 @@ import { readFile } from 'node:fs/promises' | ||
} | ||
}, | ||
{ | ||
name: 'Test', | ||
url: '/test', | ||
source: 'documents/test', | ||
target: 'localhost/test', | ||
main: 'index.html', | ||
clear: { | ||
target: [ | ||
'/**/*.{html,css,js,md}', | ||
], | ||
source: [ | ||
'**/template.js' | ||
], | ||
}, | ||
documents: { | ||
simules: [], | ||
styles: [{ | ||
type: 'style', | ||
input: 'index.scss', | ||
output: 'index.css', | ||
watch: ['**/*.scss'], | ||
}], | ||
scripts: [{ | ||
type: 'script', | ||
input: 'index.js', | ||
output: 'index.js', | ||
watch: ['**/*.js'], | ||
external: ['/dependencies/mvc-framework.js'] | ||
}], | ||
structs: [{ | ||
type: 'struct', | ||
outputType: 'server', | ||
model: 'index.json', | ||
input: 'index.ejs', | ||
output: 'index.html', | ||
watch: ['**/*.{ejs,json}', '!**/\$.ejs'], | ||
}, { | ||
type: 'struct', | ||
outputType: 'client', | ||
input: '**/*.ejs', | ||
output: '', | ||
watch: ['**/\$*.ejs', '!index.ejs'], | ||
}], | ||
} | ||
} | ||
], | ||
} |
@@ -0,1 +1,2 @@ | ||
import Content from '../../Model/Content/index.js' | ||
export default class CoreEvent { | ||
@@ -12,9 +13,19 @@ #settings | ||
let target = this.#context | ||
const pathKeys = this.path.split('.') | ||
let pathKeysIndex = 0 | ||
iterateTargetPathKeys: | ||
for(const $targetPathKey of this.path.split('.')) { | ||
if($targetPathKey === ':scope') { break iterateTargetPathKeys } | ||
if(target[$targetPathKey] === undefined) { return undefined } | ||
target = target[$targetPathKey] | ||
while(pathKeysIndex < pathKeys.length) { | ||
const pathKey = pathKeys[pathKeysIndex] | ||
if(pathKeysIndex === 0 && pathKey === ':scope') { | ||
break iterateTargetPathKeys | ||
} | ||
if(target.classToString === Content.toString()) { | ||
target = target.get(pathKey) | ||
} | ||
else { | ||
target = target[pathKey] | ||
} | ||
if(target === undefined) { break iterateTargetPathKeys } | ||
pathKeysIndex++ | ||
} | ||
if(target instanceof EventTarget) { return target } | ||
return target | ||
@@ -26,3 +37,6 @@ } | ||
set enable($enable) { | ||
if($enable === this.#_enable) { return } | ||
if( | ||
$enable === this.#_enable || | ||
this.target === undefined | ||
) { return } | ||
const eventAbility = ( | ||
@@ -29,0 +43,0 @@ $enable === true |
@@ -34,12 +34,26 @@ import { regularExpressions, recursiveAssign } from '../../../../../../../Coutil/index.js' | ||
// Delete Property Event | ||
if(contentEvents && events['deleteProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('deleteProperty', { | ||
path, | ||
detail: { | ||
key: propertyKey, | ||
val: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
if(contentEvents) { | ||
if(events['deleteProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('deleteProperty', { | ||
path, | ||
detail: { | ||
key: propertyKey, | ||
val: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
} | ||
if(events['deleteProperty:$key']) { | ||
const type = ['deleteProperty', ':', propertyKey].join('') | ||
const _path = [path, '.', propertyKey].join('') | ||
$content.dispatchEvent( | ||
new ContentEvent(type, { | ||
path: _path, | ||
detail: { | ||
val: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
} | ||
} | ||
@@ -57,12 +71,26 @@ return undefined | ||
// Delete Property Event | ||
if(contentEvents && events['deleteProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('deleteProperty', { | ||
path, | ||
detail: { | ||
key: propertyKey, | ||
val: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
if(contentEvents) { | ||
if(events['deleteProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('deleteProperty', { | ||
path, | ||
detail: { | ||
key: propertyKey, | ||
val: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
} | ||
if(events['deleteProperty:$key']) { | ||
const type = ['deleteProperty', ':', propertyKey].join('') | ||
const _path = [path, '.', propertyKey].join('') | ||
$content.dispatchEvent( | ||
new ContentEvent(type, { | ||
path: _path, | ||
detail: { | ||
val: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
} | ||
} | ||
@@ -69,0 +97,0 @@ return undefined |
@@ -29,12 +29,26 @@ import { regularExpressions, recursiveAssign } from '../../../../../../../Coutil/index.js' | ||
// Get Property Event | ||
if(contentEvents && events['getProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('getProperty', { | ||
path, | ||
detail: { | ||
key: propertyKey, | ||
val: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
if(contentEvents) { | ||
if(events['getProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('getProperty', { | ||
path, | ||
detail: { | ||
key: propertyKey, | ||
val: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
} | ||
if(events['getProperty:$key']) { | ||
const type = ['getProperty', ':', propertyKey].join('') | ||
const _path = [path, '.', propertyKey].join('') | ||
$content.dispatchEvent( | ||
new ContentEvent(type, { | ||
path: _path, | ||
detail: { | ||
val: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
} | ||
} | ||
@@ -41,0 +55,0 @@ return propertyValue |
@@ -101,12 +101,26 @@ import { regularExpressions, recursiveAssign } from '../../../../../../../Coutil/index.js' | ||
// Set Property Event | ||
if(contentEvents && events['setProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('setProperty', { | ||
path, | ||
detail: { | ||
key: propertyKey, | ||
value: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
if(contentEvents) { | ||
if(events['setProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('setProperty', { | ||
path, | ||
detail: { | ||
key: propertyKey, | ||
value: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
} | ||
if(events['setProperty:$key']) { | ||
const type = ['setProperty', ':', propertyKey].join('') | ||
const _path = [path, '.', propertyKey].join('') | ||
$content.dispatchEvent( | ||
new ContentEvent(type, { | ||
path: _path, | ||
detail: { | ||
value: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
} | ||
} | ||
@@ -141,12 +155,26 @@ // Return Property Value | ||
// Set Property Event | ||
if(contentEvents && events['setProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('setProperty', { | ||
path, | ||
detail: { | ||
key: propertyKey, | ||
value: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
if(contentEvents) { | ||
if(events['setProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('setProperty', { | ||
path, | ||
detail: { | ||
key: propertyKey, | ||
value: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
} | ||
if(events['setProperty:$key']) { | ||
const type = ['setProperty', ':', propertyKey].join('') | ||
const _path = [path, '.', propertyKey].join('') | ||
$content.dispatchEvent( | ||
new ContentEvent(type, { | ||
path: _path, | ||
detail: { | ||
value: propertyValue, | ||
} | ||
}, $content) | ||
) | ||
} | ||
} | ||
@@ -153,0 +181,0 @@ // Return Property Value |
@@ -53,12 +53,27 @@ import Content from '../../../../index.js' | ||
rootConcat = Array.prototype.concat.call(rootConcat, values[valueIndex]) | ||
if(contentEvents && events['concatValue']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('concatValue', { | ||
path, | ||
detail: { | ||
valueIndex, | ||
value: values[valueIndex], | ||
}, | ||
}, $content) | ||
) | ||
if(contentEvents) { | ||
if(events['concatValue']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('concatValue', { | ||
path, | ||
detail: { | ||
valueIndex, | ||
value: values[valueIndex], | ||
}, | ||
}, $content) | ||
) | ||
} | ||
if(events['concatValue:$index']) { | ||
const type = ['concatValue', ':', valueIndex].join('') | ||
const _path = [path, '.', valueIndex].join('') | ||
$content.dispatchEvent( | ||
new ContentEvent('concatValue', { | ||
path: _path, | ||
detail: { | ||
valueIndex, | ||
value: values[valueIndex], | ||
}, | ||
}, $content) | ||
) | ||
} | ||
} | ||
@@ -65,0 +80,0 @@ valueIndex++ |
@@ -38,18 +38,39 @@ import { ContentEvent } from '../../../../Events/index.js' | ||
// Array Copy Within Index Event Data | ||
if(contentEvents && events['copyWithinIndex']) { | ||
$content.dispatchEvent( | ||
new ContentEvent( | ||
'copyWithinIndex', | ||
{ | ||
path, | ||
detail: { | ||
target: targetIndex, | ||
start: copyIndex, | ||
end: copyIndex + 1, | ||
item: copyItem, | ||
if(contentEvents) { | ||
if(events['copyWithinIndex']) { | ||
$content.dispatchEvent( | ||
new ContentEvent( | ||
'copyWithinIndex', | ||
{ | ||
path, | ||
detail: { | ||
target: targetIndex, | ||
start: copyIndex, | ||
end: copyIndex + 1, | ||
item: copyItem, | ||
}, | ||
}, | ||
}, | ||
$content | ||
$content | ||
) | ||
) | ||
) | ||
} | ||
if(events['copyWithinIndex:$index']) { | ||
const type = ['copyWithinIndex', ':', copyIndex].join('') | ||
const _path = [path, '.', copyIndex].join('') | ||
$content.dispatchEvent( | ||
new ContentEvent( | ||
type, | ||
{ | ||
path: _path, | ||
detail: { | ||
target: targetIndex, | ||
start: copyIndex, | ||
end: copyIndex + 1, | ||
item: copyItem, | ||
}, | ||
}, | ||
$content | ||
) | ||
) | ||
} | ||
} | ||
@@ -56,0 +77,0 @@ copyIndex++ |
@@ -58,13 +58,29 @@ import Content from '../../../../index.js' | ||
// Array Fill Index Event | ||
if(contentEvents && events['fillIndex']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('fillIndex', { | ||
path, | ||
detail: { | ||
start: fillIndex, | ||
end: fillIndex + 1, | ||
value, | ||
}, | ||
}, $content) | ||
) | ||
if(contentEvents) { | ||
if(events['fillIndex']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('fillIndex', { | ||
path, | ||
detail: { | ||
start: fillIndex, | ||
end: fillIndex + 1, | ||
value, | ||
}, | ||
}, $content) | ||
) | ||
} | ||
if(events['fillIndex:$index']) { | ||
const type = ['fillIndex', ':', fillIndex].join('') | ||
const _path = [path, '.', fillIndex].join('') | ||
$content.dispatchEvent( | ||
new ContentEvent(type, { | ||
path: _path, | ||
detail: { | ||
start: fillIndex, | ||
end: fillIndex + 1, | ||
value, | ||
}, | ||
}, $content) | ||
) | ||
} | ||
} | ||
@@ -71,0 +87,0 @@ fillIndex++ |
@@ -43,12 +43,27 @@ import Content from '../../../../index.js' | ||
} | ||
if(contentEvents && events['pushProp']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('pushProp', { | ||
path, | ||
detail: { | ||
elementsIndex, | ||
element: elements[elementsIndex], | ||
}, | ||
}, $content) | ||
) | ||
if(contentEvents) { | ||
if(events['pushProp']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('pushProp', { | ||
path, | ||
detail: { | ||
elementsIndex, | ||
element: elements[elementsIndex], | ||
}, | ||
}, $content) | ||
) | ||
} | ||
if(events['pushProp:$index']) { | ||
const type = ['pushProp', ':', elementsIndex].join('') | ||
const _path = [path, '.', elementsIndex].join('') | ||
$content.dispatchEvent( | ||
new ContentEvent(type, { | ||
path: _path, | ||
detail: { | ||
elementsIndex, | ||
element: elements[elementsIndex], | ||
}, | ||
}, $content) | ||
) | ||
} | ||
} | ||
@@ -55,0 +70,0 @@ elementsIndex++ |
@@ -29,13 +29,29 @@ import Content from '../../../../index.js' | ||
// Array Splice Delete Event | ||
if(contentEvents && events['spliceDelete']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('spliceDelete', { | ||
path, | ||
detail: { | ||
index: $start + deleteItemsIndex, | ||
deleteIndex: deleteItemsIndex, | ||
deleteItem: deleteItem, | ||
}, | ||
}, $content) | ||
) | ||
if(contentEvents) { | ||
if(events['spliceDelete']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('spliceDelete', { | ||
path, | ||
detail: { | ||
index: $start + deleteItemsIndex, | ||
deleteIndex: deleteItemsIndex, | ||
deleteItem: deleteItem, | ||
}, | ||
}, $content) | ||
) | ||
} | ||
if(events['spliceDelete:$index']) { | ||
const type = ['spliceDelete', ':', deleteItemsIndex].join('') | ||
const _path = [path, '.', deleteItemsIndex].join('') | ||
$content.dispatchEvent( | ||
new ContentEvent(type, { | ||
path: _path, | ||
detail: { | ||
index: $start + deleteItemsIndex, | ||
deleteIndex: deleteItemsIndex, | ||
deleteItem: deleteItem, | ||
}, | ||
}, $content) | ||
) | ||
} | ||
} | ||
@@ -84,13 +100,29 @@ deleteItemsIndex++ | ||
// Array Splice Add Event | ||
if(contentEvents && events['spliceAdd']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('spliceAdd', { | ||
path, | ||
detail: { | ||
index: $start + addItemsIndex, | ||
addIndex: addItemsIndex, | ||
addItem: addItem, | ||
}, | ||
}, $content) | ||
) | ||
if(contentEvents) { | ||
if(events['spliceAdd']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('spliceAdd', { | ||
path, | ||
detail: { | ||
index: $start + addItemsIndex, | ||
addIndex: addItemsIndex, | ||
addItem: addItem, | ||
}, | ||
}, $content) | ||
) | ||
} | ||
if(events['spliceAdd:$index']) { | ||
const type = ['spliceAdd', ':', addItemsIndex].join('') | ||
const _path = [path, '.', addItemsIndex].join('') | ||
$content.dispatchEvent( | ||
new ContentEvent(type, { | ||
path: _path, | ||
detail: { | ||
index: $start + addItemsIndex, | ||
addIndex: addItemsIndex, | ||
addItem: addItem, | ||
}, | ||
}, $content) | ||
) | ||
} | ||
} | ||
@@ -97,0 +129,0 @@ addItemsIndex++ |
@@ -49,12 +49,28 @@ import Content from '../../../../index.js' | ||
// Array Unshift Prop Event | ||
if(contentEvents && events['unshiftProp']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('unshiftProp', { | ||
path, | ||
detail: { | ||
elementIndex, | ||
element: element, | ||
}, | ||
}, $content) | ||
) | ||
if(contentEvents) { | ||
if(events['unshiftProp']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('unshiftProp', { | ||
path, | ||
detail: { | ||
elementIndex, | ||
element: element, | ||
}, | ||
}, $content) | ||
) | ||
} | ||
if(events['unshiftProp:$index']) { | ||
const type = ['unshiftProp', ':', elementIndex].join('') | ||
const _path = [path, '.', elementIndex] | ||
$content.dispatchEvent( | ||
new ContentEvent(type, { | ||
path: _path, | ||
detail: { | ||
elementIndex, | ||
element: element, | ||
}, | ||
}, $content) | ||
) | ||
} | ||
} | ||
@@ -61,0 +77,0 @@ elementIndex-- |
@@ -86,13 +86,29 @@ import { recursiveAssign } from '../../../../../../Coutil/index.js' | ||
// Content Event: Assign Source Property | ||
if(contentEvents && events['assignSourceProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('assignSourceProperty', { | ||
path, | ||
detail: { | ||
key: $sourcePropKey, | ||
val: $sourcePropVal, | ||
source: $source, | ||
} | ||
}, $content) | ||
) | ||
if(contentEvents) { | ||
if(events['assignSourceProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('assignSourceProperty', { | ||
path, | ||
detail: { | ||
key: $sourcePropKey, | ||
val: $sourcePropVal, | ||
source: $source, | ||
} | ||
}, $content) | ||
) | ||
} | ||
if(events['assignSourceProperty:$key']) { | ||
const type = ['assignSourceProperty', ':', $sourcePropKey].join('') | ||
const _path = [path, '.', $sourcePropKey].join('') | ||
$content.dispatchEvent( | ||
new ContentEvent(type, { | ||
path: _path, | ||
detail: { | ||
key: $sourcePropKey, | ||
val: $sourcePropVal, | ||
source: $source, | ||
} | ||
}, $content) | ||
) | ||
} | ||
} | ||
@@ -99,0 +115,0 @@ } |
@@ -77,14 +77,29 @@ import { typeOf } from '../../../../../../Coutil/index.js' | ||
// Define Property Event | ||
if(contentEvents && events['defineProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('defineProperty', { | ||
path, | ||
detail: { | ||
prop: propertyKey, | ||
descriptor: propertyDescriptor, | ||
}, | ||
}, $content | ||
)) | ||
if(contentEvents) { | ||
if(events['defineProperty']) { | ||
$content.dispatchEvent( | ||
new ContentEvent('defineProperty', { | ||
path, | ||
detail: { | ||
prop: propertyKey, | ||
descriptor: propertyDescriptor, | ||
}, | ||
}, $content | ||
)) | ||
} | ||
if(events['defineProperty:$key']) { | ||
const type = ['defineProperty', ':', propertyKey].join('') | ||
const _path = [path, '.', propertyKey].join('') | ||
$content.dispatchEvent( | ||
new ContentEvent(type, { | ||
path: _path, | ||
detail: { | ||
prop: propertyKey, | ||
descriptor: propertyDescriptor, | ||
}, | ||
}, $content | ||
)) | ||
} | ||
} | ||
return proxy | ||
} |
@@ -16,2 +16,3 @@ export default { | ||
'getProperty': true, | ||
'getProperty:$key': true, | ||
}, | ||
@@ -24,2 +25,3 @@ }, | ||
'setProperty': true, | ||
'setProperty:$key': true, | ||
}, | ||
@@ -31,2 +33,3 @@ }, | ||
'deleteProperty': true, | ||
'deleteProperty:$key': true, | ||
}, | ||
@@ -39,2 +42,3 @@ }, | ||
events: { | ||
'assignSourceProperty:$key': true, | ||
'assignSourceProperty': true, | ||
@@ -51,3 +55,6 @@ 'assignSource': true, | ||
descriptorTree: true, | ||
events: { 'defineProperty': true }, | ||
events: { | ||
'defineProperty': true, | ||
'defineProperty:$key': true, | ||
}, | ||
}, | ||
@@ -66,2 +73,3 @@ freeze: { | ||
events: { | ||
'concatValue:$index': true, | ||
'concatValue': true, | ||
@@ -73,2 +81,3 @@ 'concat': true, | ||
events: { | ||
'copyWithinIndex:$index': true, | ||
'copyWithinIndex': true, | ||
@@ -80,2 +89,3 @@ 'copyWithin': true, | ||
events: { | ||
'fillIndex:$index': true, | ||
'fillIndex': true, | ||
@@ -90,2 +100,3 @@ 'fill': true, | ||
events: { | ||
'pushProp:$index': true, | ||
'pushProp': true, | ||
@@ -103,3 +114,5 @@ 'push': true, | ||
events: { | ||
'spliceDelete:$index': true, | ||
'spliceDelete': true, | ||
'spliceAdd:$index': true, | ||
'spliceAdd': true, | ||
@@ -111,2 +124,3 @@ 'splice': true, | ||
events: { | ||
'unshiftProp:$index': true, | ||
'unshiftProp': true, | ||
@@ -113,0 +127,0 @@ 'unshift': true, |
{ | ||
"name": "js-mvc-framework", | ||
"author": "Thomas Patrick Welborn", | ||
"version": "1.2.16", | ||
"version": "1.2.17", | ||
"type": "module", | ||
"scripts": { | ||
"demonstrament": "concurrently \"npm run start --workspace development\" \"npm run start --workspace demonstrament\"" | ||
"demonstrament": "concurrently \"npm run start --workspace development\" \"npm run start --workspace demonstrament\"", | ||
"development": "npm run start --workspace development" | ||
}, | ||
@@ -9,0 +10,0 @@ "imports": {}, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1658147
198
12704