@stimulus/core
Advanced tools
Comparing version 0.9.0 to 1.0.0-beta.1
@@ -6,2 +6,3 @@ export { Action } from "./src/action"; | ||
export { Controller } from "./src/controller"; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9Ac3RpbXVsdXMvY29yZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sY0FBYyxDQUFBO0FBQ3JDLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHlCQUF5QixDQUFBO0FBQzFELE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQTtBQUMvQyxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ3ZDLE9BQU8sRUFBRSxVQUFVLEVBQXlCLE1BQU0sa0JBQWtCLENBQUEifQ== | ||
export { defaultSchema } from "./src/schema"; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9Ac3RpbXVsdXMvY29yZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sY0FBYyxDQUFBO0FBQ3JDLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHlCQUF5QixDQUFBO0FBQzFELE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQTtBQUMvQyxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ3ZDLE9BQU8sRUFBRSxVQUFVLEVBQXlCLE1BQU0sa0JBQWtCLENBQUE7QUFFcEUsT0FBTyxFQUFVLGFBQWEsRUFBRSxNQUFNLGNBQWMsQ0FBQSJ9 |
@@ -21,10 +21,2 @@ var Action = /** @class */ (function () { | ||
}; | ||
Action.prototype.invokeWithEvent = function (event) { | ||
try { | ||
this.method.call(this.controller, event, event.currentTarget); | ||
} | ||
catch (error) { | ||
this.context.reportError(error, "invoking action \"" + this.descriptor + "\"", event, this); | ||
} | ||
}; | ||
Object.defineProperty(Action.prototype, "eventName", { | ||
@@ -48,2 +40,10 @@ get: function () { | ||
}); | ||
Action.prototype.invokeWithEvent = function (event) { | ||
try { | ||
this.method.call(this.controller, event); | ||
} | ||
catch (error) { | ||
this.context.handleError(error, "invoking action \"" + this.descriptor + "\"", { event: event }); | ||
} | ||
}; | ||
Action.prototype.willBeInvokedByEvent = function (event) { | ||
@@ -92,2 +92,2 @@ var eventTarget = event.target; | ||
export { Action }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvQHN0aW11bHVzL2NvcmUvc3JjL2FjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLQTtJQUtFLGdCQUFZLE9BQWdCLEVBQUUsVUFBNEIsRUFBRSxXQUF3QjtRQUNsRixJQUFJLENBQUMsT0FBTyxHQUFHLE9BQU8sQ0FBQTtRQUN0QixJQUFJLENBQUMsVUFBVSxHQUFHLFVBQVUsQ0FBQTtRQUM1QixJQUFJLENBQUMsV0FBVyxHQUFHLFdBQVcsQ0FBQTtJQUNoQyxDQUFDO0lBRUQsd0JBQU8sR0FBUDtRQUNFLElBQUksQ0FBQyxXQUFXLENBQUMsZ0JBQWdCLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBRSxJQUFJLEVBQUUsS0FBSyxD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VQUFVLENBQUE7UUFDbkMsQ0FBQzs7O09BQUE7SUFFRCxzQkFBWSwyQkFBTzthQUFuQjtZQUNFLE1BQU0sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQTtRQUMzQixDQUFDOzs7T0FBQTtJQUVELHNCQUFZLHlCQUFLO2FBQWpCO1lBQ0UsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFBO1FBQzNCLENBQUM7OztPQUFBO0lBQ0gsYUFBQztBQUFELENBQUMsQUEzRUQsSUEyRUMifQ== |
@@ -1,11 +0,13 @@ | ||
import { createConfiguration } from "./configuration"; | ||
import { Router } from "./router"; | ||
import { defaultSchema } from "./schema"; | ||
var Application = /** @class */ (function () { | ||
function Application(configurationOptions) { | ||
if (configurationOptions === void 0) { configurationOptions = {}; } | ||
this.configuration = createConfiguration(configurationOptions); | ||
function Application(element, schema) { | ||
if (element === void 0) { element = document.documentElement; } | ||
if (schema === void 0) { schema = defaultSchema; } | ||
this.element = element; | ||
this.schema = schema; | ||
this.router = new Router(this); | ||
} | ||
Application.start = function (configurationOptions) { | ||
var application = new Application(configurationOptions); | ||
Application.start = function (element, schema) { | ||
var application = new Application(element, schema); | ||
application.start(); | ||
@@ -21,7 +23,30 @@ return application; | ||
Application.prototype.register = function (identifier, controllerConstructor) { | ||
this.router.register(identifier, controllerConstructor); | ||
this.load({ identifier: identifier, controllerConstructor: controllerConstructor }); | ||
}; | ||
Application.prototype.unregister = function (identifier) { | ||
this.router.unregister(identifier); | ||
Application.prototype.load = function (head) { | ||
var _this = this; | ||
var rest = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
rest[_i - 1] = arguments[_i]; | ||
} | ||
var definitions = Array.isArray(head) ? head : [head].concat(rest); | ||
definitions.forEach(function (definition) { return _this.router.loadDefinition(definition); }); | ||
}; | ||
Application.prototype.unload = function (head) { | ||
var _this = this; | ||
var rest = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
rest[_i - 1] = arguments[_i]; | ||
} | ||
var identifiers = Array.isArray(head) ? head : [head].concat(rest); | ||
identifiers.forEach(function (identifier) { return _this.router.unloadIdentifier(identifier); }); | ||
}; | ||
Object.defineProperty(Application.prototype, "controllers", { | ||
// Controllers | ||
get: function () { | ||
return this.router.contexts.map(function (context) { return context.controller; }); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Application.prototype.getControllerForElementAndIdentifier = function (element, identifier) { | ||
@@ -31,5 +56,9 @@ var context = this.router.getContextForElementAndIdentifier(element, identifier); | ||
}; | ||
// Error handling | ||
Application.prototype.handleError = function (error, message, detail) { | ||
console.error("%s\n\n%o\n\n%o", message, error, detail); | ||
}; | ||
return Application; | ||
}()); | ||
export { Application }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwbGljYXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9Ac3RpbXVsdXMvY29yZS9zcmMvYXBwbGljYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUF1QyxtQkFBbUIsRUFBRSxNQUFNLGlCQUFpQixDQUFBO0FBRTFGLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxVQUFVLENBQUE7QUFFakM7SUFVRSxxQkFBWSxvQkFBK0M7UUFBL0MscUNBQUEsRUFBQSx5QkFBK0M7UUFDekQsSUFBSSxDQUFDLGFBQWEsR0FBRyxtQkFBbUIsQ0FBQyxvQkFBb0IsQ0FBQyxDQUFBO1FBQzlELElBQUksQ0FBQyxNQUFNLEdBQUcsSUFBSSxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUE7SUFDaEMsQ0FBQztJQVRNLGlCQUFLLEdBQVosVUFBYSxvQkFBMkM7UUFDdEQsSUFBTSxXQUFXLEdBQUcsSUFBSSxXQUFXLENBQUM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LEVBQWxCLENBQWtCLENBQUMsQ0FBQTtRQUNoRSxDQUFDOzs7T0FBQTtJQUVELDBEQUFvQyxHQUFwQyxVQUFxQyxPQUFnQixFQUFFLFVBQWtCO1FBQ3ZFLElBQU0sT0FBTyxHQUFHLElBQUksQ0FBQyxNQUFNLENBQUMsaUNBQWlDLENBQUMsT0FBTyxFQUFFLFVBQVUsQ0FBQyxDQUFBO1FBQ2xGLE1BQU0sQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQTtJQUM1QyxDQUFDO0lBRUQsaUJBQWlCO0lBRWpCLGlDQUFXLEdBQVgsVUFBWSxLQUFZLEVBQUUsT0FBZSxFQUFFLE1BQWM7UUFDdkQsT0FBTyxDQUFDLEtBQUssQ0FBQyxnQkFBZ0IsRUFBRSxPQUFPLEVBQUUsS0FBSyxFQUFFLE1BQU0sQ0FBQyxDQUFBO0lBQ3pELENBQUM7SUFDSCxrQkFBQztBQUFELENBQUMsQUEzREQsSUEyREMifQ== |
@@ -1,3 +0,1 @@ | ||
import { Action } from "./action"; | ||
import { ActionDescriptor } from "./action_descriptor"; | ||
import { ActionSet } from "./action_set"; | ||
@@ -7,13 +5,13 @@ import { InlineActionObserver } from "./inline_action_observer"; | ||
var Context = /** @class */ (function () { | ||
function Context(contextSet, element) { | ||
this.contextSet = contextSet; | ||
this.scope = new Scope(this.configuration, this.identifier, element); | ||
function Context(module, element) { | ||
this.module = module; | ||
this.scope = new Scope(this.schema, this.identifier, element); | ||
this.actions = new ActionSet(this); | ||
this.inlineActionObserver = new InlineActionObserver(this, this); | ||
try { | ||
this.controller = new contextSet.controllerConstructor(this); | ||
this.controller = new module.controllerConstructor(this); | ||
this.controller.initialize(); | ||
} | ||
catch (error) { | ||
this.reportError(error, "initializing controller \"" + this.identifier + "\""); | ||
this.handleError(error, "initializing controller"); | ||
} | ||
@@ -28,3 +26,3 @@ } | ||
catch (error) { | ||
this.reportError(error, "connecting controller \"" + this.identifier + "\""); | ||
this.handleError(error, "connecting controller"); | ||
} | ||
@@ -37,3 +35,3 @@ }; | ||
catch (error) { | ||
this.reportError(error, "disconnecting controller \"" + this.identifier + "\""); | ||
this.handleError(error, "disconnecting controller"); | ||
} | ||
@@ -45,3 +43,3 @@ this.inlineActionObserver.stop(); | ||
get: function () { | ||
return this.contextSet.application; | ||
return this.module.application; | ||
}, | ||
@@ -53,3 +51,3 @@ enumerable: true, | ||
get: function () { | ||
return this.contextSet.identifier; | ||
return this.module.identifier; | ||
}, | ||
@@ -59,5 +57,5 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(Context.prototype, "configuration", { | ||
Object.defineProperty(Context.prototype, "schema", { | ||
get: function () { | ||
return this.application.configuration; | ||
return this.application.schema; | ||
}, | ||
@@ -81,38 +79,17 @@ enumerable: true, | ||
}); | ||
Context.prototype.addAction = function (actionOrDescriptorString, eventTarget) { | ||
var action; | ||
if (actionOrDescriptorString instanceof Action) { | ||
action = actionOrDescriptorString; | ||
} | ||
else if (typeof actionOrDescriptorString == "string") { | ||
var descriptorString = actionOrDescriptorString; | ||
if (!isEventTarget(eventTarget)) { | ||
eventTarget = this.element; | ||
} | ||
var descriptor = ActionDescriptor.forElementWithInlineDescriptorString(eventTarget, descriptorString); | ||
action = new Action(this, descriptor, eventTarget); | ||
} | ||
if (action) { | ||
this.actions.add(action); | ||
} | ||
}; | ||
Context.prototype.removeAction = function (action) { | ||
this.actions.delete(action); | ||
}; | ||
// Inline action observer delegate | ||
/** @private */ | ||
Context.prototype.inlineActionConnected = function (action) { | ||
this.addAction(action); | ||
this.actions.add(action); | ||
}; | ||
/** @private */ | ||
Context.prototype.inlineActionDisconnected = function (action) { | ||
this.removeAction(action); | ||
this.actions.delete(action); | ||
}; | ||
// Logging | ||
Context.prototype.reportError = function (error, message) { | ||
var args = []; | ||
for (var _i = 2; _i < arguments.length; _i++) { | ||
args[_i - 2] = arguments[_i]; | ||
} | ||
var argsFormat = args.map(function (arg) { return "%o"; }).join("\n"); | ||
var format = "Error %s\n\n%o\n\n" + argsFormat + "\n%o\n%o"; | ||
return console.error.apply(console, [format, message, error].concat(args, [this.controller, this.element])); | ||
// Error handling | ||
Context.prototype.handleError = function (error, message, detail) { | ||
if (detail === void 0) { detail = {}; } | ||
var _a = this, identifier = _a.identifier, controller = _a.controller, element = _a.element; | ||
detail = Object.assign({ identifier: identifier, controller: controller, element: element }, detail); | ||
this.application.handleError(error, "Error " + message, detail); | ||
}; | ||
@@ -122,13 +99,2 @@ return Context; | ||
export { Context }; | ||
function isEventTarget(object) { | ||
if (!object) { | ||
return false; | ||
} | ||
else if (typeof EventTarget != "undefined") { | ||
return object instanceof EventTarget; | ||
} | ||
else { | ||
return typeof object.addEventListener == "function"; | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL0BzdGltdWx1cy9jb3JlL3NyYy9jb250ZXh0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxVQUFVLENBQUE7QUFDakMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0scUJBQXFCLENBQUE7QUFDdEQsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGNBQWMsQ0FBQTtBQUt4QyxPQUFPLEVBQUUsb0JBQW9CLEVBQWdDLE1BQU0sMEJBQTBCLENBQUE7QUFDN0YsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLFNBQVMsQ0FBQTtBQUUvQjtJQU9FLGlCQUFZLFVBQXNCLEVBQUUsT0FBZ0I7UUFDbEQsSUFBSSxDQUFDLFVBQVUsR0FBRyxVQUFVLENBQUE7UUFDNUIsSUFBSSxDQUFDLEtBQU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0FBQUQsQ0FBQyxBQWxGRCxJQWtGQyJ9 |
@@ -56,11 +56,6 @@ var Controller = /** @class */ (function () { | ||
}; | ||
Controller.prototype.addAction = function (actionOrDescriptorString, eventTarget) { | ||
this.context.addAction(actionOrDescriptorString, eventTarget); | ||
}; | ||
Controller.prototype.removeAction = function (action) { | ||
this.context.removeAction(action); | ||
}; | ||
Controller.targets = []; | ||
return Controller; | ||
}()); | ||
export { Controller }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJvbGxlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL0BzdGltdWx1cy9jb3JlL3NyYy9jb250cm9sbGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVdBO0lBR0Usb0JBQVksT0FBZ0I7UUFDMUIsSUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUE7SUFDeEIsQ0FBQztJQUVELHNCQUFJLG1DQUFXO2FBQWY7WUFDRSxNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxXQUFXLENBQUE7UUFDakMsQ0FBQzs7O09BQUE7SUFFRCxzQkFBSSw2QkFBSzthQUFUO1lBQ0UsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFBO1FBQzNCLENBQUM7OztPQUFBO0lBRUQsc0JBQUksK0JBQU87YUFBWDtZQUNFLE1BQU0sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQTtRQUMzQixDQUFDOzs7T0FBQTtJQUVELHNCQUFJLGtDQUFVO2FBQWQ7WUFDRSxNQUFNLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxVQUFVLENBQUE7UUFDOUIsQ0FBQzs7O09BQUE7SUFFRCxzQkFBSSwrQkFBTzthQUFYO1lBQ0UsTUFBTSxDQUFDLElBQ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0FBQzs7O09BQUE7SUFFRCxzQkFBSSw2QkFBSzthQUFUO1lBQ0UsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFBO1FBQzNCLENBQUM7OztPQUFBO0lBRUQsc0JBQUksK0JBQU87YUFBWDtZQUNFLE1BQU0sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQTtRQUMzQixDQUFDOzs7T0FBQTtJQUVELHNCQUFJLGtDQUFVO2FBQWQ7WUFDRSxNQUFNLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxVQUFVLENBQUE7UUFDOUIsQ0FBQzs7O09BQUE7SUFFRCxzQkFBSSwrQkFBTzthQUFYO1lBQ0UsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFBO1FBQzNCLENBQUM7OztPQUFBO0lBRUQsc0JBQUksNEJBQUk7YUFBUjtZQUNFLE1BQU0sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQTtRQUN4QixDQUFDOzs7T0FBQTtJQUVELCtCQUFVLEdBQVY7UUFDRSwrREFBK0Q7SUFDakUsQ0FBQztJQUVELDRCQUFPLEdBQVA7UUFDRSxtRkFBbUY7SUFDckYsQ0FBQztJQUVELCtCQUFVLEdBQVY7UUFDRSx3RkFBd0Y7SUFDMUYsQ0FBQztJQXpDTSxrQkFBTyxHQUFhLEVBQUUsQ0FBQTtJQTBDL0IsaUJBQUM7Q0FBQSxBQTNDRCxJQTJDQztTQTNDWSxVQUFVIn0= |
@@ -19,5 +19,5 @@ import { Action } from "./action"; | ||
}); | ||
Object.defineProperty(InlineActionObserver.prototype, "configuration", { | ||
Object.defineProperty(InlineActionObserver.prototype, "schema", { | ||
get: function () { | ||
return this.scope.configuration; | ||
return this.context.schema; | ||
}, | ||
@@ -29,3 +29,3 @@ enumerable: true, | ||
get: function () { | ||
return this.configuration.actionAttribute; | ||
return this.schema.actionAttribute; | ||
}, | ||
@@ -56,2 +56,3 @@ enumerable: true, | ||
// Token list observer delegate | ||
/** @private */ | ||
InlineActionObserver.prototype.elementMatchedTokenForAttribute = function (element, token, attributeName) { | ||
@@ -66,2 +67,3 @@ if (this.scope.containsElement(element)) { | ||
}; | ||
/** @private */ | ||
InlineActionObserver.prototype.elementUnmatchedTokenForAttribute = function (element, token, attributeName) { | ||
@@ -89,3 +91,3 @@ var action = this.getConnectedActionForElementWithDescriptorString(element, token); | ||
catch (error) { | ||
this.context.reportError(error, "parsing descriptor string \"" + descriptorString + "\" for element", element); | ||
this.context.handleError(error, "parsing descriptor string \"" + descriptorString + "\"", { element: element }); | ||
} | ||
@@ -96,2 +98,2 @@ }; | ||
export { InlineActionObserver }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lX2FjdGlvbl9vYnNlcnZlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL0BzdGltdWx1cy9jb3JlL3NyYy9pbmxpbmVfYWN0aW9uX29ic2VydmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxVQUFVLENBQUE7QUFDakMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0scUJBQXFCLENBQUE7QUFHdEQsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLG9CQUFvQixDQUFBO0FBRTdDLE9BQU8sRUFBRSxpQkFBaUIsRUFBNkIsTUFBTSw4QkFBOEIsQ0FBQTtBQU8zRjtJQU1FLDhCQUFZLE9BQWdCLEVBQUUsUUFBc0M7UUFDbEUsSUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUE7UUFDdEIsSUFBSSxDQUFDLFFBQVEsR0FBRyxRQUFRLENBQUE7UUFDeEIsSUFBSSxDQUFDLGlCQUFpQixHQ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ENBQUMsQ0FBQztnQkFDN0MsTUFBTSxDQUFDLElBQUksTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLEVBQUUsVUFBVSxFQUFFLFVBQVUsQ0FBQyxXQUFXLENBQUMsQ0FBQTtZQUNyRSxDQUFDO1FBQ0gsQ0FBQztRQUFDLEtBQUssQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7WUFDZixJQUFJLENBQUMsT0FBTyxDQUFDLFdBQVcsQ0FBQyxLQUFLLEVBQUUsaUNBQThCLGdCQUFnQixPQUFHLEVBQUUsRUFBRSxPQUFPLFNBQUEsRUFBRSxDQUFDLENBQUE7UUFDakcsQ0FBQztJQUNILENBQUM7SUFDSCwyQkFBQztBQUFELENBQUMsQUFqRkQsSUFpRkMifQ== |
@@ -1,2 +0,2 @@ | ||
import { ContextSet } from "./context_set"; | ||
import { Module } from "./module"; | ||
import { TokenListObserver } from "@stimulus/mutation-observers"; | ||
@@ -7,7 +7,7 @@ var Router = /** @class */ (function () { | ||
this.tokenListObserver = new TokenListObserver(this.element, this.controllerAttribute, this); | ||
this.contextSets = new Map; | ||
this.modulesByIdentifier = new Map; | ||
} | ||
Object.defineProperty(Router.prototype, "configuration", { | ||
Object.defineProperty(Router.prototype, "schema", { | ||
get: function () { | ||
return this.application.configuration; | ||
return this.application.schema; | ||
}, | ||
@@ -19,3 +19,3 @@ enumerable: true, | ||
get: function () { | ||
return this.configuration.rootElement; | ||
return this.application.element; | ||
}, | ||
@@ -27,3 +27,3 @@ enumerable: true, | ||
get: function () { | ||
return this.configuration.controllerAttribute; | ||
return this.schema.controllerAttribute; | ||
}, | ||
@@ -33,2 +33,9 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(Router.prototype, "modules", { | ||
get: function () { | ||
return Array.from(this.modulesByIdentifier.values()); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Router.prototype.start = function () { | ||
@@ -40,55 +47,63 @@ this.tokenListObserver.start(); | ||
}; | ||
Router.prototype.register = function (identifier, controllerConstructor) { | ||
if (this.contextSets.has(identifier)) { | ||
throw new Error("Router already has a controller registered with the identifier '" + identifier + "'"); | ||
} | ||
var contextSet = new ContextSet(this, identifier, controllerConstructor); | ||
this.contextSets.set(identifier, contextSet); | ||
this.connectContextSet(contextSet); | ||
Router.prototype.loadDefinition = function (definition) { | ||
var identifier = definition.identifier; | ||
this.unloadIdentifier(identifier); | ||
var module = new Module(this.application, definition); | ||
this.modulesByIdentifier.set(identifier, module); | ||
this.connectModule(module); | ||
}; | ||
Router.prototype.unregister = function (identifier) { | ||
var contextSet = this.contextSets.get(identifier); | ||
if (contextSet) { | ||
this.disconnectContextSet(contextSet); | ||
this.contextSets.delete(identifier); | ||
Router.prototype.unloadIdentifier = function (identifier) { | ||
var module = this.modulesByIdentifier.get(identifier); | ||
if (module) { | ||
this.disconnectModule(module); | ||
this.modulesByIdentifier.delete(identifier); | ||
} | ||
}; | ||
// Token list observer delegate | ||
/** @private */ | ||
Router.prototype.elementMatchedTokenForAttribute = function (element, token, attributeName) { | ||
this.connectContextForIdentifierToElement(token, element); | ||
this.connectModuleForIdentifierToElement(token, element); | ||
}; | ||
/** @private */ | ||
Router.prototype.elementUnmatchedTokenForAttribute = function (element, token, attributeName) { | ||
this.disconnectContextForIdentifierFromElement(token, element); | ||
this.disconnectModuleForIdentifierFromElement(token, element); | ||
}; | ||
// Contexts | ||
Object.defineProperty(Router.prototype, "contexts", { | ||
// Contexts | ||
get: function () { | ||
return this.modules.reduce(function (contexts, module) { return contexts.concat(Array.from(module.contexts)); }, []); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Router.prototype.getContextForElementAndIdentifier = function (element, identifier) { | ||
var contextSet = this.contextSets.get(identifier); | ||
if (contextSet) { | ||
return contextSet.getContextForElement(element); | ||
var module = this.modulesByIdentifier.get(identifier); | ||
if (module) { | ||
return module.getContextForElement(element); | ||
} | ||
}; | ||
Router.prototype.connectContextSet = function (contextSet) { | ||
var elements = this.tokenListObserver.getElementsMatchingToken(contextSet.identifier); | ||
Router.prototype.connectModule = function (module) { | ||
var elements = this.tokenListObserver.getElementsMatchingToken(module.identifier); | ||
for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { | ||
var element = elements_1[_i]; | ||
contextSet.connect(element); | ||
module.connectElement(element); | ||
} | ||
}; | ||
Router.prototype.disconnectContextSet = function (contextSet) { | ||
var contexts = contextSet.contexts; | ||
Router.prototype.disconnectModule = function (module) { | ||
var contexts = module.contexts; | ||
for (var _i = 0, contexts_1 = contexts; _i < contexts_1.length; _i++) { | ||
var element = contexts_1[_i].element; | ||
contextSet.disconnect(element); | ||
module.disconnectElement(element); | ||
} | ||
}; | ||
Router.prototype.connectContextForIdentifierToElement = function (identifier, element) { | ||
var contextSet = this.contextSets.get(identifier); | ||
if (contextSet) { | ||
contextSet.connect(element); | ||
Router.prototype.connectModuleForIdentifierToElement = function (identifier, element) { | ||
var module = this.modulesByIdentifier.get(identifier); | ||
if (module) { | ||
module.connectElement(element); | ||
} | ||
}; | ||
Router.prototype.disconnectContextForIdentifierFromElement = function (identifier, element) { | ||
var contextSet = this.contextSets.get(identifier); | ||
if (contextSet) { | ||
contextSet.disconnect(element); | ||
Router.prototype.disconnectModuleForIdentifierFromElement = function (identifier, element) { | ||
var module = this.modulesByIdentifier.get(identifier); | ||
if (module) { | ||
module.disconnectElement(element); | ||
} | ||
@@ -99,2 +114,2 @@ }; | ||
export { Router }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvQHN0aW11bHVzL2NvcmUvc3JjL3JvdXRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBRTFDLE9BQU8sRUFBRSxpQkF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QUE7UUFDaEMsQ0FBQztJQUNILENBQUM7SUFFTyx5REFBd0MsR0FBaEQsVUFBaUQsVUFBa0IsRUFBRSxPQUFnQjtRQUNuRixJQUFNLE1BQU0sR0FBRyxJQUFJLENBQUMsbUJBQW1CLENBQUMsR0FBRyxDQUFDLFVBQVUsQ0FBQyxDQUFBO1FBQ3ZELEVBQUUsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7WUFDWCxNQUFNLENBQUMsaUJBQWlCLENBQUMsT0FBTyxDQUFDLENBQUE7UUFDbkMsQ0FBQztJQUNILENBQUM7SUFDSCxhQUFDO0FBQUQsQ0FBQyxBQXhHRCxJQXdHQyJ9 |
@@ -5,4 +5,4 @@ import { DataMap } from "./data_map"; | ||
var Scope = /** @class */ (function () { | ||
function Scope(configuration, identifier, element) { | ||
this.configuration = configuration; | ||
function Scope(schema, identifier, element) { | ||
this.schema = schema; | ||
this.identifier = identifier; | ||
@@ -30,3 +30,3 @@ this.element = element; | ||
get: function () { | ||
return attributeValueContainsToken(this.configuration.controllerAttribute, this.identifier); | ||
return attributeValueContainsToken(this.schema.controllerAttribute, this.identifier); | ||
}, | ||
@@ -39,2 +39,2 @@ enumerable: true, | ||
export { Scope }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NvcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9Ac3RpbXVsdXMvY29yZS9zcmMvc2NvcGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLFlBQVksQ0FBQTtBQUNwQyxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sY0FBYyxDQUFBO0FBQ3hDLE9BQU8sRUFBRSwyQkFBMkIsRUFBRSxNQUFNLGFBQWEsQ0FBQTtBQUV6RDtJQU9FLGVBQVksYUF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yxJQUFJLENBQUMsa0JBQWtCLENBQUMsS0FBSyxJQUFJLENBQUMsT0FBTyxDQUFBO0lBQ2xFLENBQUM7SUFFRCxzQkFBWSxxQ0FBa0I7YUFBOUI7WUFDRSxNQUFNLENBQUMsMkJBQTJCLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxtQkFBbUIsRUFBRSxJQUFJLENBQUMsVUFBVSxDQUFDLENBQUE7UUFDdEYsQ0FBQzs7O09BQUE7SUFDSCxZQUFDO0FBQUQsQ0FBQyxBQXBDRCxJQW9DQyJ9 |
@@ -0,4 +1,5 @@ | ||
/** @private */ | ||
export function attributeValueContainsToken(attributeName, token) { | ||
return "[" + attributeName + "~=\"" + token + "\"]"; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0b3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvQHN0aW11bHVzL2NvcmUvc3JjL3NlbGVjdG9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLHNDQUFzQyxhQUFxQixFQUFFLEtBQWE7SUFDOUUsTUFBTSxDQUFDLE1BQUksYUFBYSxZQUFNLEtBQUssUUFBSSxDQUFBO0FBQ3pDLENBQUMifQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0b3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvQHN0aW11bHVzL2NvcmUvc3JjL3NlbGVjdG9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxlQUFlO0FBQ2YsTUFBTSxzQ0FBc0MsYUFBcUIsRUFBRSxLQUFhO0lBQzlFLE1BQU0sQ0FBQyxNQUFJLGFBQWEsWUFBTSxLQUFLLFFBQUksQ0FBQTtBQUN6QyxDQUFDIn0= |
@@ -20,5 +20,5 @@ import { attributeValueContainsToken } from "./selectors"; | ||
}); | ||
Object.defineProperty(TargetSet.prototype, "configuration", { | ||
Object.defineProperty(TargetSet.prototype, "schema", { | ||
get: function () { | ||
return this.scope.configuration; | ||
return this.scope.schema; | ||
}, | ||
@@ -53,3 +53,3 @@ enumerable: true, | ||
var targetDescriptor = this.identifier + "." + targetName; | ||
return attributeValueContainsToken(this.configuration.targetAttribute, targetDescriptor); | ||
return attributeValueContainsToken(this.schema.targetAttribute, targetDescriptor); | ||
}; | ||
@@ -59,2 +59,2 @@ return TargetSet; | ||
export { TargetSet }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFyZ2V0X3NldC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL0BzdGltdWx1cy9jb3JlL3NyYy90YXJnZXRfc2V0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sRUFBRSwyQkFBMkIsRUFBRSxNQUFNLGFBQWEsQ0FBQTtBQUV6RDtJQUdFLG1CQUFZLEtBQVk7UUFDdEIsSUFBSSxDQUFDLEtBQUssR0FBRyxLQUFLLENBQUE7SUFDcEIsQ0FBQztJQUVELHNCQUFJLDhCQUFPO2FBQVg7WUFDRSxNQUFNLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUE7UUFDM0IsQ0FBQzs7O09BQUE7SUFFRCxzQkFBSSxpQ0FBVTthQUFkO1lBQ0UsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsVUFBVSxDQUFBO1FBQzlCLENBQUM7OztPQUFBO0lBRUQsc0JBQUksb0NBQWE7YUFBakI7WUFDRSxNQUFNLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxhQUFhLENBQUE7UUFDakMsQ0FB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@@ -6,1 +6,3 @@ export { Action } from "./src/action"; | ||
export { Controller, ControllerConstructor } from "./src/controller"; | ||
export { Definition } from "./src/definition"; | ||
export { Schema, defaultSchema } from "./src/schema"; |
@@ -9,6 +9,6 @@ export interface ActionDescriptorOptions { | ||
private static defaultEventNames; | ||
identifier: string; | ||
eventName: string; | ||
methodName: string; | ||
eventTarget: EventTarget; | ||
readonly identifier: string; | ||
readonly eventName: string; | ||
readonly methodName: string; | ||
readonly eventTarget: EventTarget; | ||
static forOptions(options: ActionDescriptorOptions): ActionDescriptor; | ||
@@ -15,0 +15,0 @@ static forElementWithInlineDescriptorString(element: Element, descriptorString: string): ActionDescriptor; |
import { Action } from "./action"; | ||
import { Context } from "./context"; | ||
export declare class ActionSet { | ||
context: Context; | ||
started: boolean; | ||
actions: Set<Action>; | ||
readonly context: Context; | ||
private started; | ||
private actions; | ||
constructor(context: Context); | ||
@@ -8,0 +8,0 @@ start(): void; |
import { ActionDescriptor } from "./action_descriptor"; | ||
import { Context } from "./context"; | ||
import { Controller } from "./controller"; | ||
import { Scope } from "./scope"; | ||
export declare class Action implements EventListenerObject { | ||
context: Context; | ||
descriptor: ActionDescriptor; | ||
eventTarget: EventTarget; | ||
readonly context: Context; | ||
readonly descriptor: ActionDescriptor; | ||
readonly eventTarget: EventTarget; | ||
constructor(context: Context, descriptor: ActionDescriptor, eventTarget: EventTarget); | ||
@@ -14,10 +12,10 @@ connect(): void; | ||
handleEvent(event: Event): void; | ||
invokeWithEvent(event: Event): void; | ||
readonly eventName: string; | ||
readonly method: Function; | ||
willBeInvokedByEvent(event: Event): boolean; | ||
readonly controller: Controller; | ||
readonly methodName: string; | ||
readonly element: Element; | ||
readonly scope: Scope; | ||
private invokeWithEvent(event); | ||
private willBeInvokedByEvent(event); | ||
private readonly controller; | ||
private readonly methodName; | ||
private readonly element; | ||
private readonly scope; | ||
} |
@@ -1,13 +0,20 @@ | ||
import { Configuration, ConfigurationOptions } from "./configuration"; | ||
import { Controller, ControllerConstructor } from "./controller"; | ||
import { Definition } from "./definition"; | ||
import { Schema } from "./schema"; | ||
export declare class Application { | ||
configuration: Configuration; | ||
readonly element: Element; | ||
readonly schema: Schema; | ||
private router; | ||
static start(configurationOptions?: ConfigurationOptions): Application; | ||
constructor(configurationOptions?: ConfigurationOptions); | ||
static start(element?: Element, schema?: Schema): Application; | ||
constructor(element?: Element, schema?: Schema); | ||
start(): void; | ||
stop(): void; | ||
register(identifier: string, controllerConstructor: ControllerConstructor): void; | ||
unregister(identifier: string): void; | ||
load(...definitions: Definition[]): any; | ||
load(definitions: Definition[]): any; | ||
unload(...identifiers: string[]): any; | ||
unload(identifiers: string[]): any; | ||
readonly controllers: Controller[]; | ||
getControllerForElementAndIdentifier(element: Element, identifier: string): Controller | null; | ||
handleError(error: Error, message: string, detail: object): void; | ||
} |
import { Action } from "./action"; | ||
import { Application } from "./application"; | ||
import { Configuration } from "./configuration"; | ||
import { ContextSet } from "./context_set"; | ||
import { Controller } from "./controller"; | ||
import { InlineActionObserverDelegate } from "./inline_action_observer"; | ||
import { Module } from "./module"; | ||
import { Schema } from "./schema"; | ||
import { Scope } from "./scope"; | ||
export declare class Context implements InlineActionObserverDelegate { | ||
contextSet: ContextSet; | ||
scope: Scope; | ||
controller: Controller; | ||
readonly module: Module; | ||
readonly scope: Scope; | ||
readonly controller: Controller; | ||
private actions; | ||
private inlineActionObserver; | ||
constructor(contextSet: ContextSet, element: Element); | ||
constructor(module: Module, element: Element); | ||
connect(): void; | ||
@@ -19,11 +19,10 @@ disconnect(): void; | ||
readonly identifier: string; | ||
readonly configuration: Configuration; | ||
readonly schema: Schema; | ||
readonly element: Element; | ||
readonly parentElement: Element | null; | ||
addAction(action: Action): any; | ||
addAction(descriptorString: string, eventTarget: EventTarget): any; | ||
removeAction(action: Action): void; | ||
/** @private */ | ||
inlineActionConnected(action: Action): void; | ||
/** @private */ | ||
inlineActionDisconnected(action: Action): void; | ||
reportError(error: any, message: any, ...args: any[]): void; | ||
handleError(error: Error, message: string, detail?: object): void; | ||
} |
@@ -1,2 +0,1 @@ | ||
import { Action } from "./action"; | ||
import { Application } from "./application"; | ||
@@ -8,6 +7,8 @@ import { Context } from "./context"; | ||
export interface ControllerConstructor { | ||
targets: string[]; | ||
new (context: Context): Controller; | ||
} | ||
export declare class Controller { | ||
context: Context; | ||
static targets: string[]; | ||
readonly context: Context; | ||
constructor(context: Context); | ||
@@ -23,5 +24,2 @@ readonly application: Application; | ||
disconnect(): void; | ||
addAction(action: Action): any; | ||
addAction(descriptorString: string, eventTarget: EventTarget): any; | ||
removeAction(action: Action): void; | ||
} |
import { Scope } from "./scope"; | ||
export declare class DataMap { | ||
scope: Scope; | ||
readonly scope: Scope; | ||
constructor(scope: Scope); | ||
@@ -5,0 +5,0 @@ readonly element: Element; |
import { Action } from "./action"; | ||
import { Configuration } from "./configuration"; | ||
import { Context } from "./context"; | ||
import { Schema } from "./schema"; | ||
import { Scope } from "./scope"; | ||
@@ -11,4 +11,4 @@ import { TokenListObserverDelegate } from "@stimulus/mutation-observers"; | ||
export declare class InlineActionObserver implements TokenListObserverDelegate { | ||
context: Context; | ||
delegate: InlineActionObserverDelegate; | ||
readonly context: Context; | ||
readonly delegate: InlineActionObserverDelegate; | ||
private tokenListObserver; | ||
@@ -18,3 +18,3 @@ private connectedActions; | ||
readonly scope: Scope; | ||
readonly configuration: Configuration; | ||
readonly schema: Schema; | ||
readonly attributeName: string; | ||
@@ -25,3 +25,5 @@ readonly element: Element; | ||
stop(): void; | ||
/** @private */ | ||
elementMatchedTokenForAttribute(element: Element, token: string, attributeName: string): void; | ||
/** @private */ | ||
elementUnmatchedTokenForAttribute(element: Element, token: string, attributeName: string): void; | ||
@@ -28,0 +30,0 @@ private getConnectedActionForElementWithDescriptorString(element, descriptorString); |
import { Application } from "./application"; | ||
import { Configuration } from "./configuration"; | ||
import { Context } from "./context"; | ||
import { ControllerConstructor } from "./controller"; | ||
import { Definition } from "./definition"; | ||
import { Module } from "./module"; | ||
import { Schema } from "./schema"; | ||
import { TokenListObserverDelegate } from "@stimulus/mutation-observers"; | ||
export declare class Router implements TokenListObserverDelegate { | ||
application: Application; | ||
readonly application: Application; | ||
private tokenListObserver; | ||
private contextSets; | ||
private modulesByIdentifier; | ||
constructor(application: Application); | ||
readonly configuration: Configuration; | ||
readonly schema: Schema; | ||
readonly element: Element; | ||
readonly controllerAttribute: string; | ||
readonly modules: Module[]; | ||
start(): void; | ||
stop(): void; | ||
register(identifier: string, controllerConstructor: ControllerConstructor): void; | ||
unregister(identifier: string): void; | ||
loadDefinition(definition: Definition): void; | ||
unloadIdentifier(identifier: string): void; | ||
/** @private */ | ||
elementMatchedTokenForAttribute(element: Element, token: string, attributeName: string): void; | ||
/** @private */ | ||
elementUnmatchedTokenForAttribute(element: Element, token: string, attributeName: string): void; | ||
readonly contexts: Context[]; | ||
getContextForElementAndIdentifier(element: Element, identifier: string): Context | undefined; | ||
private connectContextSet(contextSet); | ||
private disconnectContextSet(contextSet); | ||
private connectContextForIdentifierToElement(identifier, element); | ||
private disconnectContextForIdentifierFromElement(identifier, element); | ||
private connectModule(module); | ||
private disconnectModule(module); | ||
private connectModuleForIdentifierToElement(identifier, element); | ||
private disconnectModuleForIdentifierFromElement(identifier, element); | ||
} |
@@ -1,11 +0,11 @@ | ||
import { Configuration } from "./configuration"; | ||
import { DataMap } from "./data_map"; | ||
import { Schema } from "./schema"; | ||
import { TargetSet } from "./target_set"; | ||
export declare class Scope { | ||
configuration: Configuration; | ||
identifier: string; | ||
element: Element; | ||
targets: TargetSet; | ||
data: DataMap; | ||
constructor(configuration: Configuration, identifier: string, element: Element); | ||
readonly schema: Schema; | ||
readonly identifier: string; | ||
readonly element: Element; | ||
readonly targets: TargetSet; | ||
readonly data: DataMap; | ||
constructor(schema: Schema, identifier: string, element: Element); | ||
findElement(selector: string): Element | undefined; | ||
@@ -12,0 +12,0 @@ findAllElements(selector: string): Element[]; |
@@ -0,1 +1,2 @@ | ||
/** @private */ | ||
export declare function attributeValueContainsToken(attributeName: string, token: string): string; |
@@ -1,9 +0,9 @@ | ||
import { Configuration } from "./configuration"; | ||
import { Schema } from "./schema"; | ||
import { Scope } from "./scope"; | ||
export declare class TargetSet { | ||
scope: Scope; | ||
readonly scope: Scope; | ||
constructor(scope: Scope); | ||
readonly element: Element; | ||
readonly identifier: string; | ||
readonly configuration: Configuration; | ||
readonly schema: Schema; | ||
has(targetName: string): boolean; | ||
@@ -10,0 +10,0 @@ find(...targetNames: string[]): Element | undefined; |
{ | ||
"name": "@stimulus/core", | ||
"version": "0.9.0", | ||
"version": "1.0.0-beta.1", | ||
"description": "Stimulus JavaScript framework: Core library", | ||
@@ -16,3 +16,3 @@ "repository": "https://github.com/stimulusjs/stimulus", | ||
"dependencies": { | ||
"@stimulus/mutation-observers": "^0.9.0" | ||
"@stimulus/mutation-observers": "^1.0.0-beta.1" | ||
}, | ||
@@ -24,3 +24,7 @@ "files": [ | ||
"access": "public" | ||
}, | ||
"devDependencies": { | ||
"@stimulus/test": "^1.0.0-beta.1", | ||
"@types/webpack-env": "^1.13.3" | ||
} | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
140940
56
1980
2
1
+ Added@stimulus/multimap@1.1.1(transitive)
+ Added@stimulus/mutation-observers@1.1.1(transitive)
- Removed@stimulus/multimap@0.9.0(transitive)
- Removed@stimulus/mutation-observers@0.9.0(transitive)