New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aurelia/runtime-html

Package Overview
Dependencies
Maintainers
1
Versions
1027
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aurelia/runtime-html - npm Package Compare versions

Comparing version 2.1.0-dev.202304270200 to 2.1.0-dev.202305021031

27

dist/types/bindable.d.ts

@@ -23,5 +23,2 @@ import { Class } from '@aurelia/kernel';

};
type PartialBindableDefinitionPropertyRequired = PartialBindableDefinition & {
property: string;
};
type PartialBindableDefinitionPropertyOmitted = Omit<PartialBindableDefinition, 'property'>;

@@ -47,25 +44,2 @@ /**

export declare function bindable(target: {}, prop: string): void;
type BFluent = {
add(config: PartialBindableDefinitionPropertyRequired): BFluent;
add(property: string): BFluent & B12345;
};
type B1<T = {}> = {
mode(mode: BindingMode): BFluent & T;
};
type B2<T = {}> = {
callback(callback: string): BFluent & T;
};
type B3<T = {}> = {
attribute(attribute: string): BFluent & T;
};
type B4<T = {}> = {
primary(): BFluent & T;
};
type B5<T = {}> = {
set(setterFn: InterceptorFunc): BFluent & T;
};
type B45 = B5 & B4<B5>;
type B345 = B45 & B3<B45>;
type B2345 = B345 & B2<B345>;
type B12345 = B2345 & B1<B2345>;
export declare const Bindable: Readonly<{

@@ -75,3 +49,2 @@ name: string;

from(type: Constructable, ...bindableLists: readonly (BindableDefinition | Record<string, PartialBindableDefinition> | readonly string[] | undefined)[]): Record<string, BindableDefinition>;
for(Type: Constructable): BFluent;
getAll(Type: Constructable): readonly BindableDefinition[];

@@ -78,0 +51,0 @@ }>;

1

dist/types/index.d.ts
export { bindable, Bindable, BindableDefinition, type PartialBindableDefinition, coercer, } from './bindable';
export { BindableObserver, } from './observation/bindable-observer';
export { bindingBehavior, BindingBehavior, BindingBehaviorDefinition, type PartialBindingBehaviorDefinition, type BindingBehaviorKind, type BindingBehaviorDecorator, type BindingBehaviorType, } from './resources/binding-behavior';

@@ -4,0 +3,0 @@ export { BindingModeBehavior, OneTimeBindingBehavior, ToViewBindingBehavior, FromViewBindingBehavior, TwoWayBindingBehavior, } from './resources/binding-behaviors/binding-mode';

9

dist/types/templating/controller.d.ts

@@ -1,2 +0,2 @@

import { Scope } from '@aurelia/runtime';
import { Scope, ICoercionConfiguration } from '@aurelia/runtime';
import { CustomElementDefinition } from '../resources/custom-element';

@@ -60,2 +60,3 @@ import { CustomAttributeDefinition } from '../resources/custom-attribute';

set viewModel(v: BindingContext<C> | null);
coercion: ICoercionConfiguration | undefined;
constructor(container: IContainer, vmKind: ViewModelKind, definition: CustomElementDefinition | CustomAttributeDefinition | null,

@@ -233,2 +234,6 @@ /**

readonly viewModel: C;
/**
* Coercion configuration associated with a component (attribute/element) or an application
*/
readonly coercion: ICoercionConfiguration | undefined;
}

@@ -454,2 +459,3 @@ /**

created?(controller: ICustomElementController<this>): void;
propertyChanged?(key: PropertyKey, newValue: unknown, oldValue: unknown): void;
}

@@ -460,2 +466,3 @@ export interface ICustomAttributeViewModel extends IViewModel, IActivationHooks<IHydratedController> {

created?(controller: ICustomAttributeController<this>): void;
propertyChanged?(key: PropertyKey, newValue: unknown, oldValue: unknown): void;
}

@@ -462,0 +469,0 @@ export interface IHydratedCustomElementViewModel extends ICustomElementViewModel {

@@ -1,3 +0,4 @@

import { type IResolver, type Key, type Constructable, type IContainer, type IResourceKind, type ResourceDefinition, type IAllResolver } from '@aurelia/kernel';
import { type IResolver, type Key, type Constructable, type IContainer, type IResourceKind, type ResourceDefinition, type IAllResolver, IOptionalResolver } from '@aurelia/kernel';
export declare const resource: <T extends Key>(key: T) => IResolver<T> & ((...args: unknown[]) => any);
export declare const optionalResource: <T extends Key>(key: T) => IOptionalResolver<T>;
/**

@@ -4,0 +5,0 @@ * A resolver builder for resolving all registrations of a key

{
"name": "@aurelia/runtime-html",
"version": "2.1.0-dev.202304270200",
"version": "2.1.0-dev.202305021031",
"main": "dist/cjs/index.cjs",

@@ -52,7 +52,7 @@ "module": "dist/esm/index.mjs",

"dependencies": {
"@aurelia/kernel": "2.1.0-dev.202304270200",
"@aurelia/metadata": "2.1.0-dev.202304270200",
"@aurelia/platform": "2.1.0-dev.202304270200",
"@aurelia/platform-browser": "2.1.0-dev.202304270200",
"@aurelia/runtime": "2.1.0-dev.202304270200"
"@aurelia/kernel": "2.1.0-dev.202305021031",
"@aurelia/metadata": "2.1.0-dev.202305021031",
"@aurelia/platform": "2.1.0-dev.202305021031",
"@aurelia/platform-browser": "2.1.0-dev.202305021031",
"@aurelia/runtime": "2.1.0-dev.202305021031"
},

@@ -59,0 +59,0 @@ "devDependencies": {

@@ -1,9 +0,9 @@

import { kebabCase, firstDefined, getPrototypeChain, noop, Class } from '@aurelia/kernel';
import { kebabCase, getPrototypeChain, noop, Class } from '@aurelia/kernel';
import { ICoercionConfiguration } from '@aurelia/runtime';
import { Metadata } from '@aurelia/metadata';
import { BindingMode } from './binding/interfaces-bindings';
import { appendAnnotationKey, defineMetadata, getAllAnnotations, getAnnotationKeyFor, getOwnMetadata, hasOwnMetadata } from './utilities-metadata';
import { appendAnnotationKey, defineMetadata, getAllAnnotations, getAnnotationKeyFor, getOwnMetadata } from './utilities-metadata';
import { isString, objectFreeze, objectKeys } from './utilities';
import type { Constructable, Writable } from '@aurelia/kernel';
import type { Constructable } from '@aurelia/kernel';
import type { InterceptorFunc } from '@aurelia/runtime';

@@ -30,6 +30,2 @@

type PartialBindableDefinitionPropertyRequired = PartialBindableDefinition & {
property: string;
};
type PartialBindableDefinitionPropertyOmitted = Omit<PartialBindableDefinition, 'property'>;

@@ -99,36 +95,4 @@

type BFluent = {
add(config: PartialBindableDefinitionPropertyRequired): BFluent;
add(property: string): BFluent & B12345;
};
const baseName = /*@__PURE__*/getAnnotationKeyFor('bindable');
type B1<T = {}> = {
mode(mode: BindingMode): BFluent & T;
};
type B2<T = {}> = {
callback(callback: string): BFluent & T;
};
type B3<T = {}> = {
attribute(attribute: string): BFluent & T;
};
type B4<T = {}> = {
primary(): BFluent & T;
};
type B5<T = {}> = {
set(setterFn: InterceptorFunc): BFluent & T;
};
// An important self-imposed limitation for this to be viable (e.g. avoid exponential combination growth),
// is to keep the fluent API invocation order in a single direction.
type B45 = B5 & B4<B5>;
type B345 = B45 & B3<B45>;
type B2345 = B345 & B2<B345>;
type B12345 = B2345 & B1<B2345>;
const baseName = getAnnotationKeyFor('bindable');
export const Bindable = objectFreeze({

@@ -164,54 +128,2 @@ name: baseName,

},
for(Type: Constructable): BFluent {
let def: Writable<BindableDefinition>;
const builder: BFluent & B12345 = {
add(configOrProp: string | PartialBindableDefinitionPropertyRequired): BFluent & B12345 {
let prop: string;
let config: PartialBindableDefinitionPropertyRequired;
if (isString(configOrProp)) {
prop = configOrProp;
config = { property: prop };
} else {
prop = configOrProp.property;
config = configOrProp;
}
def = BindableDefinition.create(prop, Type, config) as Writable<BindableDefinition>;
if (!hasOwnMetadata(baseName, Type, prop)) {
appendAnnotationKey(Type, Bindable.keyFrom(prop));
}
defineMetadata(baseName, def, Type, prop);
return builder;
},
mode(mode: BindingMode): BFluent & B12345 {
def.mode = mode;
return builder;
},
callback(callback: string): BFluent & B12345 {
def.callback = callback;
return builder;
},
attribute(attribute: string): BFluent & B12345 {
def.attribute = attribute;
return builder;
},
primary(): BFluent & B12345 {
def.primary = true;
return builder;
},
set(setInterpreter: InterceptorFunc): BFluent & B12345 {
def.set = setInterpreter;
return builder;
}
};
return builder;
},
getAll(Type: Constructable): readonly BindableDefinition[] {

@@ -252,8 +164,8 @@ const propStart = baseName.length + 1;

return new BindableDefinition(
firstDefined(def.attribute, kebabCase(prop)),
firstDefined(def.callback, `${prop}Changed`),
firstDefined(def.mode, BindingMode.toView),
firstDefined(def.primary, false),
firstDefined(def.property, prop),
firstDefined(def.set, getInterceptor(prop, target, def)),
def.attribute ?? kebabCase(prop),
def.callback ?? `${prop}Changed`,
def.mode ?? BindingMode.toView,
def.primary ?? false,
def.property ?? prop,
def.set ?? getInterceptor(prop, target, def),
);

@@ -297,39 +209,2 @@ }

}
Bindable.for(Foo)
// > expected error - there is no add() function with only optional params on the fluent api
//.add()
// > expected error - 'property' is a required property on the fluent api
//.add({})
.add({ property: 'prop' })
.add({ property: 'prop', mode: BindingMode.twoWay })
.add({ property: 'prop', callback: 'propChanged' })
.add({ property: 'prop', attribute: 'prop' })
.add({ property: 'prop', primary: true })
.add({ property: 'prop', mode: BindingMode.twoWay, callback: 'propChanged', attribute: 'prop', primary: true })
.add('prop')
// > expected error - the add() method that accepts an object literal does not return a fluent api
//.add({ property: 'prop' }).mode(BindingMode.twoWay)
//.add({ property: 'prop' }).callback('propChanged')
//.add({ property: 'prop' }).attribute('prop')
//.add({ property: 'prop' }).primary()
// > expected error - fluent api methods can only be invoked once per bindable
//.add('prop').mode(BindingMode.twoWay).mode(BindingMode.twoWay)
//.add('prop').mode(BindingMode.twoWay).callback('propChanged').mode(BindingMode.twoWay)
//.add('prop').mode(BindingMode.twoWay).callback('propChanged').callback('propChanged') // etc
// > expected error - wrong invocation order
//.add('prop').callback('propChanged').mode(BindingMode.twoWay)
//.add('prop').primary().mode(BindingMode.twoWay) // etc
.add('prop').mode(BindingMode.twoWay)
.add('prop').mode(BindingMode.twoWay).callback('propChanged')
.add('prop').mode(BindingMode.twoWay).callback('propChanged').attribute('prop')
.add('prop').mode(BindingMode.twoWay).callback('propChanged').attribute('prop').primary()
.add('prop').mode(BindingMode.twoWay).set((value: unknown) => Number(value))
.add('prop').mode(BindingMode.twoWay).callback('propChanged').set(value => Number(value))
.add('prop').callback('propChanged')
.add('prop').callback('propChanged').attribute('prop')
.add('prop').callback('propChanged').attribute('prop').primary()
.add('prop').attribute('prop')
.add('prop').attribute('prop').primary()
.add('prop').primary();
}

@@ -343,3 +218,3 @@ /* eslint-enable @typescript-eslint/no-unused-vars,spaced-comment */

const Coercer = {
key: getAnnotationKeyFor('coercer'),
key: /*@__PURE__*/getAnnotationKeyFor('coercer'),
define(target: Constructable<unknown>, property: string) {

@@ -380,3 +255,3 @@ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any

function createCoercer<TInput, TOutput>(coercer: InterceptorFunc<TInput, TOutput>, nullable: boolean | undefined): InterceptorFunc<TInput, TOutput> {
return function (value: TInput, coercionConfiguration: ICoercionConfiguration | null): TOutput {
return function (value: TInput, coercionConfiguration?: ICoercionConfiguration): TOutput {
if (!coercionConfiguration?.enableCoercion) return value as unknown as TOutput;

@@ -383,0 +258,0 @@ return ((nullable ?? ((coercionConfiguration?.coerceNullish ?? false) ? false : true)) && value == null)

@@ -10,6 +10,2 @@ export {

export {
BindableObserver,
} from './observation/bindable-observer';
export {
bindingBehavior,

@@ -16,0 +12,0 @@ BindingBehavior,

@@ -126,3 +126,3 @@ import { Constructable, IContainer, InstanceProvider, onResolve, transient } from '@aurelia/kernel';

/** @internal */
protected propertyChanged(name: ChangeSource): void {
public propertyChanged(name: ChangeSource): void {
if (name === 'model' && this._composition != null) {

@@ -129,0 +129,0 @@ // eslint-disable-next-line

@@ -12,6 +12,8 @@ import {

type IAllResolver,
IOptionalResolver,
} from '@aurelia/kernel';
import { defineMetadata, getAnnotationKeyFor, getOwnMetadata } from './utilities-metadata';
import { objectAssign } from './utilities';
export const resource = function <T extends Key>(key: T) {
export const resource = <T extends Key>(key: T) => {
function Resolver(target: Injectable, property?: string | number, descriptor?: PropertyDescriptor | number) {

@@ -21,11 +23,7 @@ DI.inject(Resolver)(target, property, descriptor);

Resolver.$isResolver = true;
Resolver.resolve = function (handler: IContainer, requestor: IContainer) {
if (/* is root? */requestor.root === requestor) {
return requestor.get(key);
}
return requestor.has(key, false)
Resolver.resolve = (handler: IContainer, requestor: IContainer) =>
requestor.has(key, false)
? requestor.get(key)
: requestor.root.get(key);
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any

@@ -35,2 +33,16 @@ return Resolver as IResolver<T> & ((...args: unknown[]) => any);

export const optionalResource = <T extends Key>(key: T) => {
return objectAssign(function Resolver(target: Injectable, property?: string | number, descriptor?: PropertyDescriptor | number) {
DI.inject(Resolver)(target, property, descriptor);
}, {
$isResolver: true,
resolve: (handler: IContainer, requestor: IContainer) =>
requestor.has(key, false)
? requestor.get(key)
: requestor.root.has(key, false)
? requestor.root.get(key)
: void 0,
}) as IOptionalResolver<T>;
};
/**

@@ -37,0 +49,0 @@ * A resolver builder for resolving all registrations of a key

@@ -24,3 +24,3 @@ import type { ISignaler, ISubscriber } from '@aurelia/runtime';

const IsDataAttribute: Record<string, boolean> = createLookup();
const IsDataAttribute: Record<string, boolean> = /*@__PURE__*/createLookup();

@@ -27,0 +27,0 @@ /** @internal */ export const isDataAttribute = (obj: Node, key: PropertyKey, svgAnalyzer: ISVGAnalyzer): boolean => {

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 not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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 too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc