From 0ee58fea48299d107b42aadcbdb64ef3b3c32e39 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Wed, 19 Sep 2018 18:19:02 +0200 Subject: [PATCH] feat(core): Allow to type _ctx BREAKING CHANGE: GondelBaseComponent constructor requires a ctx and a componentName argument --- examples/typescript/src/components/input.ts | 4 +--- packages/core/dist/GondelComponent.d.ts | 9 +++++---- packages/core/dist/GondelComponent.js | 2 +- packages/core/dist/GondelComponent.js.map | 2 +- packages/core/dist/GondelComponentStarter.d.ts | 2 +- packages/core/dist/GondelDecorators.d.ts | 2 +- packages/core/dist/gondel.es5.js | 2 +- packages/core/dist/gondel.es5.js.map | 2 +- packages/core/dist/gondel.es5.min.js | 2 +- packages/core/dist/gondel.es5.min.js.map | 2 +- packages/core/src/GondelComponent.ts | 9 +++++---- packages/core/src/GondelComponentStarter.test.ts | 4 ++-- packages/plugins/jquery/dist/index.d.ts | 7 ++++--- packages/plugins/jquery/dist/index.es5.js | 2 +- packages/plugins/jquery/dist/index.es5.js.map | 2 +- packages/plugins/jquery/dist/index.js | 11 ++++++++++- packages/plugins/jquery/dist/index.js.map | 2 +- packages/plugins/jquery/src/index.ts | 11 +++++++++-- packages/plugins/react/dist/index.d.ts | 2 +- packages/plugins/react/dist/index.js | 4 ++-- packages/plugins/react/dist/index.js.map | 2 +- packages/plugins/react/src/index.ts | 4 ++-- 22 files changed, 53 insertions(+), 36 deletions(-) diff --git a/examples/typescript/src/components/input.ts b/examples/typescript/src/components/input.ts index 44c853af..3ac58ed2 100644 --- a/examples/typescript/src/components/input.ts +++ b/examples/typescript/src/components/input.ts @@ -1,9 +1,7 @@ import { Component, EventListener, GondelBaseComponent, triggerPublicEvent } from "@gondel/core"; @Component("Input") -export class Input extends GondelBaseComponent { - _ctx: HTMLInputElement; - +export class Input extends GondelBaseComponent { @EventListener("input") _handleInput() { triggerPublicEvent("gInput", this); diff --git a/packages/core/dist/GondelComponent.d.ts b/packages/core/dist/GondelComponent.d.ts index bd219a84..c6058864 100644 --- a/packages/core/dist/GondelComponent.d.ts +++ b/packages/core/dist/GondelComponent.d.ts @@ -1,7 +1,7 @@ export declare type IGondelComponent = new (context: HTMLElement, componentName: string) => GondelComponent; export declare type StartMethod = ((resolve: Function, reject?: Function) => void) | (() => Promise) | (() => void); -export interface GondelComponent { - _ctx: HTMLElement; +export interface GondelComponent { + _ctx: TElement; _namespace: string; _componentName: string; _stopped: boolean; @@ -9,11 +9,12 @@ export interface GondelComponent { stop?(): void; sync?(): void; } -export declare class GondelBaseComponent implements GondelComponent { +export declare class GondelBaseComponent implements GondelComponent { + constructor(domNode: TElement, componentName: string); /** * The component context */ - _ctx: HTMLElement; + _ctx: TElement; /** * The namespace e.g. 'g' */ diff --git a/packages/core/dist/GondelComponent.js b/packages/core/dist/GondelComponent.js index a20a0bbf..64bd5f8e 100644 --- a/packages/core/dist/GondelComponent.js +++ b/packages/core/dist/GondelComponent.js @@ -1,5 +1,5 @@ var GondelBaseComponent = /** @class */ (function () { - function GondelBaseComponent() { + function GondelBaseComponent(domNode, componentName) { } /** * Stop method diff --git a/packages/core/dist/GondelComponent.js.map b/packages/core/dist/GondelComponent.js.map index 4ac8ed23..bca65b56 100644 --- a/packages/core/dist/GondelComponent.js.map +++ b/packages/core/dist/GondelComponent.js.map @@ -1 +1 @@ -{"version":3,"file":"GondelComponent.js","sourceRoot":"","sources":["../src/GondelComponent.ts"],"names":[],"mappings":"AA2BA;IAAA;IAqBA,CAAC;IAJC;;OAEG;IACH,kCAAI,GAAJ,cAAQ,CAAC;IACX,0BAAC;AAAD,CAAC,AArBD,IAqBC"} \ No newline at end of file +{"version":3,"file":"GondelComponent.js","sourceRoot":"","sources":["../src/GondelComponent.ts"],"names":[],"mappings":"AA2BA;IACE,6BAAY,OAAiB,EAAE,aAAqB;IAAG,CAAC;IAiBxD;;OAEG;IACH,kCAAI,GAAJ,cAAQ,CAAC;IACX,0BAAC;AAAD,CAAC,AAtBD,IAsBC"} \ No newline at end of file diff --git a/packages/core/dist/GondelComponentStarter.d.ts b/packages/core/dist/GondelComponentStarter.d.ts index 48dc6956..58858336 100644 --- a/packages/core/dist/GondelComponentStarter.d.ts +++ b/packages/core/dist/GondelComponentStarter.d.ts @@ -16,7 +16,7 @@ export declare function attachGondelBootingFlag(domNode: HTMLElement, bootingFla /** * Constructs a new component */ -export declare function constructComponent(domNode: HTMLElement, gondelComponentRegistry: GondelComponentRegistry, namespace: string): GondelComponent; +export declare function constructComponent(domNode: HTMLElement, gondelComponentRegistry: GondelComponentRegistry, namespace: string): GondelComponent; /** * Start a component after it was constructed */ diff --git a/packages/core/dist/GondelDecorators.d.ts b/packages/core/dist/GondelDecorators.d.ts index fdfba9a1..0690a01e 100644 --- a/packages/core/dist/GondelDecorators.d.ts +++ b/packages/core/dist/GondelDecorators.d.ts @@ -5,4 +5,4 @@ export declare function Component(componentName: string, namespace?: string): (c */ export declare function EventListener(eventName: string, selector?: string | object): (target: T, handler: string) => void; +} & GondelComponent>(target: T, handler: string) => void; diff --git a/packages/core/dist/gondel.es5.js b/packages/core/dist/gondel.es5.js index ef20bdf8..47ed08ae 100644 --- a/packages/core/dist/gondel.es5.js +++ b/packages/core/dist/gondel.es5.js @@ -681,7 +681,7 @@ } var GondelBaseComponent = /** @class */ (function () { - function GondelBaseComponent() { + function GondelBaseComponent(domNode, componentName) { } /** * Stop method diff --git a/packages/core/dist/gondel.es5.js.map b/packages/core/dist/gondel.es5.js.map index 965efb24..d3e9bf3a 100644 --- a/packages/core/dist/gondel.es5.js.map +++ b/packages/core/dist/gondel.es5.js.map @@ -1 +1 @@ -{"version":3,"file":"gondel.es5.js","sources":["GondelPluginUtils.js","GondelEventEmitter.js","GondelComponentStarter.js","GondelAutoStart.js","GondelComponentRegistry.js","GondelDomUtils.js","GondelEventRegistry.js","GondelDecorators.js","GondelComponent.js","index.js"],"sourcesContent":["var basePluginListener = function (result, data, next) { return next(result); };\n// Global plugin events registry\nexport var pluginEvents = window.__gondelPluginEvents || {};\nwindow.__gondelPluginEvents = pluginEvents;\nexport function fireGondelPluginEvent(eventName, initialValue, data, callback) {\n var isSyncron = false;\n var callbackResult;\n // Execute all bound events for the given name\n // if they exist\n (pluginEvents[eventName] || basePluginListener)(initialValue, data, function (processedResult) {\n isSyncron = true;\n callbackResult = callback ? callback(processedResult) : processedResult;\n });\n // Add a guard to prevent asyncron plugin listeners\n // to simplify the usage of fireGondelPluginEvent\n if (!isSyncron) {\n throw new Error(\"Async plugin listener\");\n }\n return callbackResult;\n}\n/**\n * Fire an async event which allows gondel plugins to add features to gondel\n */\nexport function fireAsyncGondelPluginEvent(eventName, initialValue, data) {\n return new Promise(function (resolve) {\n (pluginEvents[eventName] || basePluginListener)(initialValue, data, function (result) {\n resolve(result);\n });\n });\n}\n/**\n * Allow plugins to hook into the gondel event system\n */\nexport function addGondelPluginEventListener(eventName, eventListenerCallback) {\n if (!pluginEvents[eventName]) {\n pluginEvents[eventName] = basePluginListener;\n }\n var previousEventHandler = pluginEvents[eventName];\n pluginEvents[eventName] = function wrapCallback(result, data, next) {\n previousEventHandler(result, data, function callNextPlugin(modifiedResult, _, firstNext) {\n eventListenerCallback(modifiedResult, data, function bindData(result) {\n next(result, data, firstNext);\n });\n });\n };\n}\n//# sourceMappingURL=GondelPluginUtils.js.map","import { getFirstDomNode } from \"./GondelDomUtils\";\n/**\n * Submit an event which might be caught by foreign gondel, angular or react components\n */\nexport function triggerPublicEvent(eventName, gondelComponent, target, eventData, canBubble) {\n if (eventData === void 0) { eventData = {}; }\n if (canBubble === void 0) { canBubble = true; }\n var event = document.createEvent(\"Event\");\n var eventTarget = target ? getFirstDomNode(target) : gondelComponent._ctx;\n if (eventName[0] !== gondelComponent._namespace) {\n throw new Error(\"Invalid event name '\" +\n eventName +\n \"' - use '\" +\n gondelComponent._namespace +\n eventName.charAt(0).toUpperCase() +\n eventName.slice(1) +\n \"'\");\n }\n event.initEvent(eventName, canBubble, true);\n event.data = {\n component: gondelComponent,\n name: gondelComponent._componentName,\n namespace: gondelComponent._namespace,\n eventData: eventData\n };\n return eventTarget.dispatchEvent(event);\n}\n//# sourceMappingURL=GondelEventEmitter.js.map","import { internalGondelAsyncRefAttribute, internalGondelRefAttribute } from \"./GondelDomUtils\";\nimport { triggerPublicEvent } from \"./GondelEventEmitter\";\nimport { fireGondelPluginEvent } from \"./GondelPluginUtils\";\nvar noop = function () { };\nvar Deferred = function () {\n var _this = this;\n this.promise = new Promise(function (resolve) {\n _this.resolve = resolve;\n });\n};\n/**\n * Start all components of the gondel component registry\n * for the given dom context\n */\nexport function startComponentsFromRegistry(gondelComponentRegistry, domContext, namespace) {\n // Get an array of all nodes which match the namespace\n var gondelDomNodeList = Array.prototype.slice.call(domContext.querySelectorAll(\"[data-\" + namespace + \"-name]\"));\n if (domContext.hasAttribute(\"data-\" + namespace + \"-name\")) {\n gondelDomNodeList.push(domContext);\n }\n // Remove already booted nodes\n var pristineGondelDomNodes = gondelDomNodeList.filter(function (gondelDomNode) {\n return isPristineGondelDomNode(gondelDomNode, namespace);\n });\n var bootingDeferred = new Deferred();\n // Mark all nodes as booting\n pristineGondelDomNodes.forEach(function (gondelDomNode) {\n attachGondelBootingFlag(gondelDomNode, bootingDeferred.promise, namespace);\n });\n // Create instances\n var gondelComponents = fireGondelPluginEvent(\"boot\", pristineGondelDomNodes, { namespace: namespace }, function (pristineGondelDomNodes) {\n return pristineGondelDomNodes.map(function (gondelDomNode) {\n return constructComponent(gondelDomNode, gondelComponentRegistry, namespace);\n });\n });\n // Get all component names\n var newComponentNames = getNewComponents(gondelComponents, gondelComponentRegistry);\n newComponentNames.forEach(function (componentName) {\n return gondelComponentRegistry.setActiveState(componentName, true);\n });\n // Start all components\n var gondelComponentStartPromise = fireGondelPluginEvent(\"start\", gondelComponents, { newComponentNames: newComponentNames, namespace: namespace, gondelComponentRegistry: gondelComponentRegistry }, function (gondelComponents) {\n // Wait for async started components\n return Promise.all(gondelComponents.map(startConstructedComponent));\n })\n // Let all plugins know that the components are now all ready to use\n .then(function () {\n gondelComponents.forEach(function (gondelComponent) {\n if (gondelComponent.sync) {\n gondelComponent.sync();\n }\n });\n return fireGondelPluginEvent(\"sync\", gondelComponents, { namespace: namespace });\n });\n // Resolve the booting deferred\n gondelComponentStartPromise\n .then(bootingDeferred.resolve, bootingDeferred.resolve)\n // Rethrow errors (if any)\n // otherwise the browser dev tools won't show\n // important bootstrap errors\n .then(function () { return gondelComponentStartPromise; });\n // Return a promise of all started components\n return gondelComponentStartPromise;\n}\n/**\n * Returns true if the given domNode is neither booting nor booted\n */\nexport function isPristineGondelDomNode(domNode, namespace) {\n return !domNode.hasOwnProperty(internalGondelAsyncRefAttribute + namespace);\n}\n/**\n * Mark the given dom node as controlled by gondel\n */\nexport function attachGondelBootingFlag(domNode, bootingFlag, namespace) {\n // The name `A` mean async\n // to allow waiting for asyncronous booted components\n domNode[internalGondelAsyncRefAttribute + namespace] = bootingFlag;\n}\n/**\n * Constructs a new component\n */\nexport function constructComponent(domNode, gondelComponentRegistry, namespace) {\n var componentName = domNode.getAttribute(\"data-\" + namespace + \"-name\");\n var GondelComponent = gondelComponentRegistry.getComponent(componentName);\n if (GondelComponent === undefined) {\n throw new Error(\"Failed to boot component - \" + componentName + \" is not registred\");\n }\n var componentInstance = new GondelComponent(domNode, componentName);\n componentInstance._ctx = domNode;\n componentInstance._namespace = namespace;\n componentInstance._componentName = componentName;\n // Add stop method\n componentInstance.stop = stopStartedComponent.bind(null, componentInstance, componentInstance.stop || noop, namespace);\n // Create a circular reference which will allow access to the componentInstance from ctx\n domNode[\"_gondel_\" + namespace] = componentInstance;\n return componentInstance;\n}\n/**\n * Start a component after it was constructed\n */\nexport function startConstructedComponent(component) {\n // Skip if the start method is missing\n if (!component.start) {\n return;\n }\n var expectsNoArguments = component.start.length === 0;\n // Start the component and expect a promise or a syncronous return value\n // if the function expects no arguments\n if (expectsNoArguments) {\n return component.start();\n }\n return new Promise(function (resolve, reject) { return component.start(resolve, reject); });\n}\n/**\n * Stops a started component\n */\nexport function stopStartedComponent(component, internalStopMethod, namespace) {\n triggerPublicEvent(namespace + \"Stop\", component, component._ctx);\n // Remove the component instance from the html element\n delete component._ctx[internalGondelRefAttribute + namespace];\n delete component._ctx[internalGondelAsyncRefAttribute + namespace];\n component._stopped = true;\n fireGondelPluginEvent(\"stop\", component, { namespace: namespace }, internalStopMethod.bind(component));\n}\n/**\n * Filters the given component list and returns the names of those components which have never been started before\n */\nfunction getNewComponents(components, registry) {\n var componentNameHelper = {};\n components.forEach(function (component) { return (componentNameHelper[component._componentName] = true); });\n var componentNames = Object.keys(componentNameHelper);\n return componentNames.filter(function (componentName) { return !registry._activeComponents[componentName]; });\n}\n//# sourceMappingURL=GondelComponentStarter.js.map","import { getComponentRegistry } from \"./GondelComponentRegistry\";\nimport { startComponentsFromRegistry } from \"./GondelComponentStarter\";\n/**\n * By default Gondel will run startComponents on DOMContentLoaded\n * To gain more controll over the boot behaviour tihs function can be called\n * to disable the auto start\n */\nexport function disableAutoStart(namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n getComponentRegistry(namespace).setBootMode(1 /* manual */);\n}\n/**\n * Wait for document ready and boot the registry\n */\nexport function addRegistryToBootloader(namespace) {\n // Use new Promise to wait for the next tick\n var boot = function () {\n Promise.resolve().then(function () {\n var gondelComponentRegistry = getComponentRegistry(namespace);\n if (gondelComponentRegistry._bootMode === 2 /* onDomReady */) {\n gondelComponentRegistry.setBootMode(0 /* alreadyBooted */);\n startComponentsFromRegistry(gondelComponentRegistry, document.documentElement, namespace);\n }\n });\n };\n // Boot if document is complete or once it completes\n if (document.readyState == \"complete\") {\n boot();\n }\n else {\n document.addEventListener(\"DOMContentLoaded\", boot, false);\n }\n}\n//# sourceMappingURL=GondelAutoStart.js.map","import { fireGondelPluginEvent } from \"./GondelPluginUtils\";\nimport { addRegistryToBootloader } from \"./GondelAutoStart\";\nvar GLOBAL_GONDEL_REGISTRY_NAMESPACE = \"__\\ud83d\\udea1Registries\";\nvar GondelComponentRegistry = /** @class */ (function () {\n function GondelComponentRegistry() {\n this._components = {};\n this._activeComponents = {};\n this._bootMode = 2 /* onDomReady */;\n }\n GondelComponentRegistry.prototype.registerComponent = function (name, gondelComponent) {\n this._components[name] = gondelComponent;\n };\n GondelComponentRegistry.prototype.unregisterComponent = function (name) {\n delete this._components[name];\n };\n GondelComponentRegistry.prototype.getComponent = function (name) {\n return this._components[name];\n };\n /**\n * Set if a component is used\n */\n GondelComponentRegistry.prototype.setActiveState = function (name, isActive) {\n this._activeComponents[name] = isActive;\n };\n GondelComponentRegistry.prototype.setBootMode = function (bootMode) {\n this._bootMode = bootMode;\n };\n return GondelComponentRegistry;\n}());\nexport { GondelComponentRegistry };\nvar _componentRegistries;\nexport function getComponentRegistry(namespace) {\n if (!_componentRegistries) {\n _componentRegistries = window[GLOBAL_GONDEL_REGISTRY_NAMESPACE] || {};\n window[GLOBAL_GONDEL_REGISTRY_NAMESPACE] = _componentRegistries;\n }\n if (!_componentRegistries[namespace]) {\n _componentRegistries[namespace] = new GondelComponentRegistry();\n addRegistryToBootloader(namespace);\n }\n return _componentRegistries[namespace];\n}\nexport function registerComponent() {\n var args = arguments;\n // The componentName is always the first argument\n var componentName = args[0];\n // Use namespace from the second argument or fallback to the default \"g\" if it is missing\n var namespace = typeof args[1] === \"string\" ? args[1] : \"g\";\n // The last argument is always the component class\n var component = args[args.length - 1];\n var gondelComponentRegistry = getComponentRegistry(namespace);\n // If this component was already registered we remove the previous one\n // and notify all plugins - this is especially usefull for hot component replacement\n if (gondelComponentRegistry.getComponent(componentName)) {\n fireGondelPluginEvent(\"unregister\", component, { componentName: componentName, namespace: namespace });\n }\n // Let plugins know about the new component\n fireGondelPluginEvent(\"register\", component, {\n componentName: componentName,\n namespace: namespace,\n gondelComponentRegistry: gondelComponentRegistry\n }, function (component) {\n gondelComponentRegistry.registerComponent(componentName, component);\n });\n}\n//# sourceMappingURL=GondelComponentRegistry.js.map","import { getComponentRegistry } from \"./GondelComponentRegistry\";\nimport { startComponentsFromRegistry } from \"./GondelComponentStarter\";\nexport var internalGondelRefAttribute = \"_gondel_\";\nexport var internalGondelAsyncRefAttribute = \"_gondelA_\";\n/**\n * Returns true if the given object is a single Element\n */\nfunction isElement(domNode) {\n return domNode.nodeType !== undefined;\n}\n/**\n * This function normalizes takes one of the following:\n * + document query result\n * + dom node array\n * + jquery object\n * + a single dom node\n * and turns it into a single dom node\n */\nexport function getFirstDomNode(domNode) {\n if (isElement(domNode)) {\n return domNode;\n }\n return domNode[0];\n}\n/**\n * Start all nodes in the given context\n */\nexport function startComponents(domContext, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var registry = getComponentRegistry(namespace);\n return startComponentsFromRegistry(registry, domContext ? getFirstDomNode(domContext) : document.documentElement, namespace);\n}\n/**\n * Stop all nodes in the given context\n */\nexport function stopComponents(domContext, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var components = findComponents(domContext, undefined, namespace);\n if (domContext && hasMountedGondelComponent(domContext)) {\n components.unshift(getComponentByDomNode(domContext));\n }\n components.forEach(function (component) { return component.stop(); });\n}\n/**\n * Checks if a component is mounted on a certain DOM node\n */\nexport function hasMountedGondelComponent(domNode, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var gondelComponent = firstNode[internalGondelRefAttribute + namespace];\n if (!gondelComponent || !gondelComponent._ctx) {\n // no anchor prop found or ctx missing. function is needed\n // that we can type the `getComponentByDomNode` without possible\n // returnal of undefined.\n return false;\n }\n return true;\n}\n/**\n * Returns the gondel instance for the given HtmlELement\n */\nexport function getComponentByDomNode(domNode, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var gondelComponent = firstNode[internalGondelRefAttribute + namespace];\n // Stop if this dom node is not known to gondel\n if (gondelComponent && gondelComponent._ctx) {\n return gondelComponent;\n }\n throw new Error(\"Could not find any gondel component under \" + firstNode.nodeName + \" in namespace \\\"\" + namespace + \"\\\",\\n please check if your component is mounted via 'hasMountedGondelComponent'\");\n}\n/**\n * Returns the gondel instance for the given HtmlELement once it is booted\n */\nexport function getComponentByDomNodeAsync(domNode, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var gondelComponent = firstNode[internalGondelAsyncRefAttribute + namespace];\n // Stop if this dom node is not known to gondel\n if (!gondelComponent) {\n return Promise.reject(undefined);\n }\n // or the component is already booted up return it\n if (gondelComponent._ctx) {\n return Promise.resolve(gondelComponent);\n }\n // Wait the component to boot up and return it\n return gondelComponent.then(function () { return firstNode[internalGondelRefAttribute + namespace]; });\n}\n/**\n * Returns all components inside the given node\n */\nexport function findComponents(domNode, componentName, namespace) {\n if (domNode === void 0) { domNode = document.documentElement; }\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var components = [];\n var attribute = \"_gondel_\" + namespace;\n var nodes = firstNode.querySelectorAll(\"[data-\" + namespace + \"-name\" + (componentName ? \"=\\\"\" + componentName + \"\\\"\" : \"\") + \"]\");\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n var gondelComponentInstance = node[attribute];\n // Verify that the component is fully booted\n if (gondelComponentInstance && gondelComponentInstance._ctx === node) {\n components.push(gondelComponentInstance);\n }\n }\n return components;\n}\n//# sourceMappingURL=GondelDomUtils.js.map","/**\n * The event registry provides a way to bind events ahead of time\n * with a very small foot print during launch to improve the time to interaction\n */\nimport { getComponentByDomNode } from \"./GondelDomUtils\";\nimport { fireGondelPluginEvent } from \"./GondelPluginUtils\";\n/**\n * Only real browser events are supported.\n * Unfortunately focus and blur do not bubble so a special mapping is needed.\n */\nvar eventNameMapping = {\n focus: \"focusin\",\n blur: \"focusout\"\n};\n// Polyfill for element.prototype.matches\nvar matchesCssSelector = function (element, selector) {\n var elementPrototype = window.Element.prototype;\n /* istanbul ignore next : Browser polyfill can't be tested */\n var elementMatches = elementPrototype.matches ||\n elementPrototype.matchesSelector ||\n elementPrototype.mozMatchesSelector ||\n elementPrototype.msMatchesSelector ||\n elementPrototype.webkitMatchesSelector;\n // Cache the function and call it\n return (matchesCssSelector = function (element, selector) {\n return elementMatches.call(element, selector);\n })(element, selector);\n};\nfunction getParentElements(startElement) {\n var nodes = [];\n for (var element = startElement; element; element = element.parentElement) {\n nodes.push(element);\n }\n return nodes;\n}\n/**\n * Returns an array of all handlers which would apply for the current target\n */\nexport function getHandlers(attributeName, eventHandlerRegistry, target) {\n var parents = getParentElements(target);\n // Find all selectors which have been registred for this event type\n // and which have a gondel component in one of the parrent nodes\n var selectorsOfFoundComponents = [];\n parents.forEach(function (parent, i) {\n var componentName = parent.getAttribute(attributeName);\n var handlers = componentName && eventHandlerRegistry[componentName];\n if (handlers) {\n // Store the index where the component was found to know in which part\n // of the dom tree the selectors could be found\n selectorsOfFoundComponents.push({ index: i, handlers: handlers });\n }\n });\n // Iterate over all possible selectors to find out if the current event\n // should fire any gondel handler\n var handlerQueue = [];\n selectorsOfFoundComponents.forEach(function (_a) {\n var index = _a.index, handlers = _a.handlers;\n var selectorNames = Object.keys(handlers);\n selectorNames.forEach(function (selectorName) {\n // If no selector is given the handler does always match\n if (!selectorName) {\n return handlerQueue.push({\n index: index,\n ctx: parents[index],\n target: parents[index],\n handlerOptions: handlers[selectorName]\n });\n }\n // Iterate backwards over the children of the component to find an element\n // which matches the selector for the current handler\n for (var i = index; --i >= 0;) {\n if (matchesCssSelector(parents[i], selectorName)) {\n return handlerQueue.push({\n index: i,\n ctx: parents[index],\n target: parents[i],\n handlerOptions: handlers[selectorName]\n });\n }\n }\n });\n });\n // Break if we couldn't find any matching element\n if (handlerQueue.length === 0) {\n return [];\n }\n // Sort the queue so events which are further up the dom are fired first\n handlerQueue.sort(function (handlerA, handlerB) {\n return handlerA.index > handlerB.index ? 1 : handlerA.index === handlerB.index ? 0 : -1;\n });\n return handlerQueue;\n}\n/**\n * The handler which will catch every event at the documentElement\n */\nfunction handleEvent(namespace, attributeName, eventHandlerRegistry, event) {\n var target = event.target;\n var handlers = getHandlers(attributeName, eventHandlerRegistry, target);\n executeHandlers(handlers, event, namespace);\n}\nvar _domEventRegistry;\n/**\n * Returns the namespace registry for the given namespace..\n * This function must be used only by core or plugins\n */\nexport function getEventRegistry(namespace) {\n if (!_domEventRegistry) {\n _domEventRegistry = window[\"__\\ud83d\\udea1DomEvents\"] || {};\n window[\"__\\ud83d\\udea1DomEvents\"] = _domEventRegistry;\n }\n if (!_domEventRegistry[namespace]) {\n _domEventRegistry[namespace] = {};\n }\n return _domEventRegistry[namespace];\n}\n/**\n * Notify components\n * This function must be used by core or only by plugins\n */\nexport function executeHandlers(handlers, event, namespace) {\n /** Store wether the original Event was modified to provide the correct currentTarget */\n var eventObjectRequiresCleanup = false;\n /** Store optional callback results which are executed together to allow grouped redraws */\n var results = [];\n for (var i = 0; i < handlers.length && !event.cancelBubble; i++) {\n var handlerObject = handlers[i];\n var handlerOptions = handlerObject.handlerOptions;\n var gondelComponent = getComponentByDomNode(handlerObject.ctx, namespace);\n // Skip if the component wasn't started or if it was stopped\n if (gondelComponent) {\n // See https://stackoverflow.com/questions/52057726/what-is-the-best-way-to-alter-a-native-browser-event\n Object.defineProperty(event, \"currentTarget\", {\n value: handlerObject.target,\n configurable: true\n });\n eventObjectRequiresCleanup = true;\n for (var j = 0; j < handlerOptions.length && !event.cancelBubble; j++) {\n var handlerResult = gondelComponent[handlerOptions[j].handlerName].call(gondelComponent, event);\n if (typeof handlerResult === \"function\") {\n results.push(handlerResult);\n }\n }\n }\n }\n // Execute all callbacks to allow grouping write events\n results.forEach(function (result) {\n result();\n });\n // Cleanup the event object\n if (eventObjectRequiresCleanup) {\n // See https://stackoverflow.com/questions/52057726/what-is-the-best-way-to-alter-a-native-browser-event\n delete event.currentTarget;\n }\n}\n/**\n * Add a event lister to the element\n * The listener will always call handleEvent with the domEventRegistry for the given event\n */\nfunction startListeningForEvent(eventName, namespace) {\n document.documentElement.addEventListener(eventNameMapping[eventName] || eventName, handleEvent.bind(null, namespace, \"data-\" + namespace + \"-name\", getEventRegistry(namespace)[eventName]));\n}\n/**\n * Add an event to the Gondel EventRegistry\n */\nexport function addRootEventListener(namespace, domEventName, gondelComponentName, handlerName, handlerOption) {\n // Create namespace if neededi\n var namespacedDomEventRegistry = getEventRegistry(namespace);\n // Notify all plugins to allow taking over the event handling for a specific event name\n // This notification is only triggered if a event name e.g. 'click' is used for the first time\n if (!namespacedDomEventRegistry[domEventName]) {\n namespacedDomEventRegistry[domEventName] = {};\n fireGondelPluginEvent(\"registerEvent\", true, {\n eventName: domEventName,\n namespace: namespace,\n eventRegistry: namespacedDomEventRegistry[domEventName]\n }, function (isNativeEvent) {\n // If no plugin registered the event\n // register a native browser event\n if (isNativeEvent) {\n startListeningForEvent(domEventName, namespace);\n }\n });\n }\n if (!namespacedDomEventRegistry[domEventName][gondelComponentName]) {\n namespacedDomEventRegistry[domEventName][gondelComponentName] = {};\n }\n var handlerOptionObject = typeof handlerOption === \"object\" ? handlerOption : { selector: handlerOption };\n var selectorKey = handlerOptionObject.selector || \"\";\n if (!namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey]) {\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey] = [];\n }\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey].push(Object.assign({ handlerName: handlerName, handlerOption: handlerOption }));\n}\n/**\n * Remove an event from the Gondel EventRegistry\n */\nexport function removeRootEventListener(namespace, domEventName, gondelComponentName, handlerName, selector) {\n var selectorKey = selector || \"\";\n var namespacedDomEventRegistry = getEventRegistry(namespace);\n if (namespacedDomEventRegistry[domEventName] &&\n namespacedDomEventRegistry[domEventName][gondelComponentName] &&\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey]) {\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey] = namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey].filter(function (handlerOption) {\n return handlerOption.handlerName !== handlerName || handlerName === undefined;\n });\n }\n}\n/**\n * Remove all events for a given Component (e.g. a Button) from the Gondel EventRegistry\n */\nexport function removeRootEventListernerForComponent(namespace, gondelComponentName) {\n var namespacedDomEventRegistry = getEventRegistry(namespace);\n for (var eventName in namespacedDomEventRegistry) {\n /* istanbul ignore else: for in savety check */\n if (namespacedDomEventRegistry.hasOwnProperty(eventName)) {\n delete namespacedDomEventRegistry[eventName][gondelComponentName];\n }\n }\n}\n//# sourceMappingURL=GondelEventRegistry.js.map","import { addRootEventListener, removeRootEventListernerForComponent } from \"./GondelEventRegistry\";\n// Because of how decorators work @EventListeners is executed before the class is registred\n// so we need to provide a hrm compatible approch initialize and reinitialize the events\nimport { addGondelPluginEventListener } from \"./GondelPluginUtils\";\nimport { registerComponent } from \"./index\";\nexport function Component(componentName, namespace) {\n return function (constructor) {\n registerComponent(componentName, namespace, constructor);\n };\n}\nvar areEventsHookedIntoCore = false;\nfunction hookEventDecoratorInCore() {\n areEventsHookedIntoCore = true;\n addGondelPluginEventListener(\"register\", function (component, _a, next) {\n var componentName = _a.componentName, namespace = _a.namespace, gondelComponentRegistry = _a.gondelComponentRegistry;\n // Only apply in case the component is already active in the DOM\n // this will only happen during hot module replacement\n if (!gondelComponentRegistry._activeComponents[componentName]) {\n return next(component);\n }\n // The decorator will store the event information in two different places.\n // For ES6 classes it is using __events\n // For ES5 prototype classes and transpiled ES6 classes it is using prototype.__events\n var componentEventOptions = (component.prototype && component.prototype.__events) || component.__events;\n if (componentEventOptions) {\n componentEventOptions.forEach(function (eventOptions) {\n addRootEventListener(namespace, \n /* event name: */ eventOptions[0], componentName, \n /* handler: */ eventOptions[1], \n /* selector: */ eventOptions[2]);\n });\n }\n next(component);\n });\n addGondelPluginEventListener(\"unregister\", function (component, _a, next) {\n var componentName = _a.componentName, namespace = _a.namespace;\n removeRootEventListernerForComponent(namespace, componentName);\n next(component);\n });\n addGondelPluginEventListener(\"start\", function (gondelComponents, _a, next) {\n var newComponentNames = _a.newComponentNames, gondelComponentRegistry = _a.gondelComponentRegistry, namespace = _a.namespace;\n newComponentNames.forEach(function (componentName) {\n var gondelComponent = gondelComponentRegistry.getComponent(componentName);\n // The decorator will store the event information in two different places.\n // For ES6 classes it is using __events\n // For ES5 prototype classes and transpiled ES6 classes it is using prototype.__events\n var componentEventOptions = (gondelComponent.prototype && gondelComponent.prototype.__events) ||\n gondelComponent.__events;\n if (componentEventOptions) {\n componentEventOptions.forEach(function (eventOptions) {\n addRootEventListener(namespace, \n /* event name: */ eventOptions[0], componentName, \n /* handler: */ eventOptions[1], \n /* selector: */ eventOptions[2]);\n });\n }\n });\n next(gondelComponents);\n });\n}\n/**\n * The @EventListener decorator will add all event names to a static variable\n */\nexport function EventListener(eventName, selector) {\n return function (target, handler) {\n if (!areEventsHookedIntoCore) {\n hookEventDecoratorInCore();\n }\n if (handler.substr(0, 1) !== \"_\") {\n throw new Error(\"Invalid handler name '\" + handler + \"' use '_\" + handler + \"' instead.\");\n }\n if (!target.__events) {\n target.__events = [];\n }\n target.__events.push([eventName, handler, selector]);\n };\n}\n//# sourceMappingURL=GondelDecorators.js.map","var GondelBaseComponent = /** @class */ (function () {\n function GondelBaseComponent() {\n }\n /**\n * Stop method\n */\n GondelBaseComponent.prototype.stop = function () { };\n return GondelBaseComponent;\n}());\nexport { GondelBaseComponent };\n//# sourceMappingURL=GondelComponent.js.map","// Export helpers to hook into the gondel frameworks (should only be used by plugins)\nexport { addGondelPluginEventListener } from \"./GondelPluginUtils\";\n// Export helpers to interact with DOM e.g. start a gondel component for a given DOM node\n// or get a running gondel component instance for a given DOM node\nexport * from \"./GondelDomUtils\";\n// Export https://github.com/tc39/proposal-decorators decorators e.g. @EventListener or @Component\nexport * from \"./GondelDecorators\";\n// Export event helpers to send custom events to React/Angular or foreign gondel components\nexport * from \"./GondelEventEmitter\";\n// Export types of the Gondel Component instance\nexport * from \"./GondelComponent\";\n// Export a helper which allows registring components without using decorators\nexport { registerComponent } from \"./GondelComponentRegistry\";\n// Allow to disable the autobooting feature\nexport { disableAutoStart } from \"./GondelAutoStart\";\n//# sourceMappingURL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C,CAAC,CAAC;IAC7D,KAAK,CAAC;IACN,CAAC;;AC5EE,QAAC,mBAAmB,kBAAkB,YAAY;IACrD,IAAI,SAAS,mBAAmB,GAAG;IACnC,KAAK;IACL;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,SAAS,CAAC,IAAI,GAAG,YAAY,GAAG,CAAC;IACzD,IAAI,OAAO,mBAAmB,CAAC;IAC/B,CAAC,EAAE,CAAC;;ICRJ,qFAAqF;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gondel.es5.js","sources":["GondelPluginUtils.js","GondelEventEmitter.js","GondelComponentStarter.js","GondelAutoStart.js","GondelComponentRegistry.js","GondelDomUtils.js","GondelEventRegistry.js","GondelDecorators.js","GondelComponent.js","index.js"],"sourcesContent":["var basePluginListener = function (result, data, next) { return next(result); };\n// Global plugin events registry\nexport var pluginEvents = window.__gondelPluginEvents || {};\nwindow.__gondelPluginEvents = pluginEvents;\nexport function fireGondelPluginEvent(eventName, initialValue, data, callback) {\n var isSyncron = false;\n var callbackResult;\n // Execute all bound events for the given name\n // if they exist\n (pluginEvents[eventName] || basePluginListener)(initialValue, data, function (processedResult) {\n isSyncron = true;\n callbackResult = callback ? callback(processedResult) : processedResult;\n });\n // Add a guard to prevent asyncron plugin listeners\n // to simplify the usage of fireGondelPluginEvent\n if (!isSyncron) {\n throw new Error(\"Async plugin listener\");\n }\n return callbackResult;\n}\n/**\n * Fire an async event which allows gondel plugins to add features to gondel\n */\nexport function fireAsyncGondelPluginEvent(eventName, initialValue, data) {\n return new Promise(function (resolve) {\n (pluginEvents[eventName] || basePluginListener)(initialValue, data, function (result) {\n resolve(result);\n });\n });\n}\n/**\n * Allow plugins to hook into the gondel event system\n */\nexport function addGondelPluginEventListener(eventName, eventListenerCallback) {\n if (!pluginEvents[eventName]) {\n pluginEvents[eventName] = basePluginListener;\n }\n var previousEventHandler = pluginEvents[eventName];\n pluginEvents[eventName] = function wrapCallback(result, data, next) {\n previousEventHandler(result, data, function callNextPlugin(modifiedResult, _, firstNext) {\n eventListenerCallback(modifiedResult, data, function bindData(result) {\n next(result, data, firstNext);\n });\n });\n };\n}\n//# sourceMappingURL=GondelPluginUtils.js.map","import { getFirstDomNode } from \"./GondelDomUtils\";\n/**\n * Submit an event which might be caught by foreign gondel, angular or react components\n */\nexport function triggerPublicEvent(eventName, gondelComponent, target, eventData, canBubble) {\n if (eventData === void 0) { eventData = {}; }\n if (canBubble === void 0) { canBubble = true; }\n var event = document.createEvent(\"Event\");\n var eventTarget = target ? getFirstDomNode(target) : gondelComponent._ctx;\n if (eventName[0] !== gondelComponent._namespace) {\n throw new Error(\"Invalid event name '\" +\n eventName +\n \"' - use '\" +\n gondelComponent._namespace +\n eventName.charAt(0).toUpperCase() +\n eventName.slice(1) +\n \"'\");\n }\n event.initEvent(eventName, canBubble, true);\n event.data = {\n component: gondelComponent,\n name: gondelComponent._componentName,\n namespace: gondelComponent._namespace,\n eventData: eventData\n };\n return eventTarget.dispatchEvent(event);\n}\n//# sourceMappingURL=GondelEventEmitter.js.map","import { internalGondelAsyncRefAttribute, internalGondelRefAttribute } from \"./GondelDomUtils\";\nimport { triggerPublicEvent } from \"./GondelEventEmitter\";\nimport { fireGondelPluginEvent } from \"./GondelPluginUtils\";\nvar noop = function () { };\nvar Deferred = function () {\n var _this = this;\n this.promise = new Promise(function (resolve) {\n _this.resolve = resolve;\n });\n};\n/**\n * Start all components of the gondel component registry\n * for the given dom context\n */\nexport function startComponentsFromRegistry(gondelComponentRegistry, domContext, namespace) {\n // Get an array of all nodes which match the namespace\n var gondelDomNodeList = Array.prototype.slice.call(domContext.querySelectorAll(\"[data-\" + namespace + \"-name]\"));\n if (domContext.hasAttribute(\"data-\" + namespace + \"-name\")) {\n gondelDomNodeList.push(domContext);\n }\n // Remove already booted nodes\n var pristineGondelDomNodes = gondelDomNodeList.filter(function (gondelDomNode) {\n return isPristineGondelDomNode(gondelDomNode, namespace);\n });\n var bootingDeferred = new Deferred();\n // Mark all nodes as booting\n pristineGondelDomNodes.forEach(function (gondelDomNode) {\n attachGondelBootingFlag(gondelDomNode, bootingDeferred.promise, namespace);\n });\n // Create instances\n var gondelComponents = fireGondelPluginEvent(\"boot\", pristineGondelDomNodes, { namespace: namespace }, function (pristineGondelDomNodes) {\n return pristineGondelDomNodes.map(function (gondelDomNode) {\n return constructComponent(gondelDomNode, gondelComponentRegistry, namespace);\n });\n });\n // Get all component names\n var newComponentNames = getNewComponents(gondelComponents, gondelComponentRegistry);\n newComponentNames.forEach(function (componentName) {\n return gondelComponentRegistry.setActiveState(componentName, true);\n });\n // Start all components\n var gondelComponentStartPromise = fireGondelPluginEvent(\"start\", gondelComponents, { newComponentNames: newComponentNames, namespace: namespace, gondelComponentRegistry: gondelComponentRegistry }, function (gondelComponents) {\n // Wait for async started components\n return Promise.all(gondelComponents.map(startConstructedComponent));\n })\n // Let all plugins know that the components are now all ready to use\n .then(function () {\n gondelComponents.forEach(function (gondelComponent) {\n if (gondelComponent.sync) {\n gondelComponent.sync();\n }\n });\n return fireGondelPluginEvent(\"sync\", gondelComponents, { namespace: namespace });\n });\n // Resolve the booting deferred\n gondelComponentStartPromise\n .then(bootingDeferred.resolve, bootingDeferred.resolve)\n // Rethrow errors (if any)\n // otherwise the browser dev tools won't show\n // important bootstrap errors\n .then(function () { return gondelComponentStartPromise; });\n // Return a promise of all started components\n return gondelComponentStartPromise;\n}\n/**\n * Returns true if the given domNode is neither booting nor booted\n */\nexport function isPristineGondelDomNode(domNode, namespace) {\n return !domNode.hasOwnProperty(internalGondelAsyncRefAttribute + namespace);\n}\n/**\n * Mark the given dom node as controlled by gondel\n */\nexport function attachGondelBootingFlag(domNode, bootingFlag, namespace) {\n // The name `A` mean async\n // to allow waiting for asyncronous booted components\n domNode[internalGondelAsyncRefAttribute + namespace] = bootingFlag;\n}\n/**\n * Constructs a new component\n */\nexport function constructComponent(domNode, gondelComponentRegistry, namespace) {\n var componentName = domNode.getAttribute(\"data-\" + namespace + \"-name\");\n var GondelComponent = gondelComponentRegistry.getComponent(componentName);\n if (GondelComponent === undefined) {\n throw new Error(\"Failed to boot component - \" + componentName + \" is not registred\");\n }\n var componentInstance = new GondelComponent(domNode, componentName);\n componentInstance._ctx = domNode;\n componentInstance._namespace = namespace;\n componentInstance._componentName = componentName;\n // Add stop method\n componentInstance.stop = stopStartedComponent.bind(null, componentInstance, componentInstance.stop || noop, namespace);\n // Create a circular reference which will allow access to the componentInstance from ctx\n domNode[\"_gondel_\" + namespace] = componentInstance;\n return componentInstance;\n}\n/**\n * Start a component after it was constructed\n */\nexport function startConstructedComponent(component) {\n // Skip if the start method is missing\n if (!component.start) {\n return;\n }\n var expectsNoArguments = component.start.length === 0;\n // Start the component and expect a promise or a syncronous return value\n // if the function expects no arguments\n if (expectsNoArguments) {\n return component.start();\n }\n return new Promise(function (resolve, reject) { return component.start(resolve, reject); });\n}\n/**\n * Stops a started component\n */\nexport function stopStartedComponent(component, internalStopMethod, namespace) {\n triggerPublicEvent(namespace + \"Stop\", component, component._ctx);\n // Remove the component instance from the html element\n delete component._ctx[internalGondelRefAttribute + namespace];\n delete component._ctx[internalGondelAsyncRefAttribute + namespace];\n component._stopped = true;\n fireGondelPluginEvent(\"stop\", component, { namespace: namespace }, internalStopMethod.bind(component));\n}\n/**\n * Filters the given component list and returns the names of those components which have never been started before\n */\nfunction getNewComponents(components, registry) {\n var componentNameHelper = {};\n components.forEach(function (component) { return (componentNameHelper[component._componentName] = true); });\n var componentNames = Object.keys(componentNameHelper);\n return componentNames.filter(function (componentName) { return !registry._activeComponents[componentName]; });\n}\n//# sourceMappingURL=GondelComponentStarter.js.map","import { getComponentRegistry } from \"./GondelComponentRegistry\";\nimport { startComponentsFromRegistry } from \"./GondelComponentStarter\";\n/**\n * By default Gondel will run startComponents on DOMContentLoaded\n * To gain more controll over the boot behaviour tihs function can be called\n * to disable the auto start\n */\nexport function disableAutoStart(namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n getComponentRegistry(namespace).setBootMode(1 /* manual */);\n}\n/**\n * Wait for document ready and boot the registry\n */\nexport function addRegistryToBootloader(namespace) {\n // Use new Promise to wait for the next tick\n var boot = function () {\n Promise.resolve().then(function () {\n var gondelComponentRegistry = getComponentRegistry(namespace);\n if (gondelComponentRegistry._bootMode === 2 /* onDomReady */) {\n gondelComponentRegistry.setBootMode(0 /* alreadyBooted */);\n startComponentsFromRegistry(gondelComponentRegistry, document.documentElement, namespace);\n }\n });\n };\n // Boot if document is complete or once it completes\n if (document.readyState == \"complete\") {\n boot();\n }\n else {\n document.addEventListener(\"DOMContentLoaded\", boot, false);\n }\n}\n//# sourceMappingURL=GondelAutoStart.js.map","import { fireGondelPluginEvent } from \"./GondelPluginUtils\";\nimport { addRegistryToBootloader } from \"./GondelAutoStart\";\nvar GLOBAL_GONDEL_REGISTRY_NAMESPACE = \"__\\ud83d\\udea1Registries\";\nvar GondelComponentRegistry = /** @class */ (function () {\n function GondelComponentRegistry() {\n this._components = {};\n this._activeComponents = {};\n this._bootMode = 2 /* onDomReady */;\n }\n GondelComponentRegistry.prototype.registerComponent = function (name, gondelComponent) {\n this._components[name] = gondelComponent;\n };\n GondelComponentRegistry.prototype.unregisterComponent = function (name) {\n delete this._components[name];\n };\n GondelComponentRegistry.prototype.getComponent = function (name) {\n return this._components[name];\n };\n /**\n * Set if a component is used\n */\n GondelComponentRegistry.prototype.setActiveState = function (name, isActive) {\n this._activeComponents[name] = isActive;\n };\n GondelComponentRegistry.prototype.setBootMode = function (bootMode) {\n this._bootMode = bootMode;\n };\n return GondelComponentRegistry;\n}());\nexport { GondelComponentRegistry };\nvar _componentRegistries;\nexport function getComponentRegistry(namespace) {\n if (!_componentRegistries) {\n _componentRegistries = window[GLOBAL_GONDEL_REGISTRY_NAMESPACE] || {};\n window[GLOBAL_GONDEL_REGISTRY_NAMESPACE] = _componentRegistries;\n }\n if (!_componentRegistries[namespace]) {\n _componentRegistries[namespace] = new GondelComponentRegistry();\n addRegistryToBootloader(namespace);\n }\n return _componentRegistries[namespace];\n}\nexport function registerComponent() {\n var args = arguments;\n // The componentName is always the first argument\n var componentName = args[0];\n // Use namespace from the second argument or fallback to the default \"g\" if it is missing\n var namespace = typeof args[1] === \"string\" ? args[1] : \"g\";\n // The last argument is always the component class\n var component = args[args.length - 1];\n var gondelComponentRegistry = getComponentRegistry(namespace);\n // If this component was already registered we remove the previous one\n // and notify all plugins - this is especially usefull for hot component replacement\n if (gondelComponentRegistry.getComponent(componentName)) {\n fireGondelPluginEvent(\"unregister\", component, { componentName: componentName, namespace: namespace });\n }\n // Let plugins know about the new component\n fireGondelPluginEvent(\"register\", component, {\n componentName: componentName,\n namespace: namespace,\n gondelComponentRegistry: gondelComponentRegistry\n }, function (component) {\n gondelComponentRegistry.registerComponent(componentName, component);\n });\n}\n//# sourceMappingURL=GondelComponentRegistry.js.map","import { getComponentRegistry } from \"./GondelComponentRegistry\";\nimport { startComponentsFromRegistry } from \"./GondelComponentStarter\";\nexport var internalGondelRefAttribute = \"_gondel_\";\nexport var internalGondelAsyncRefAttribute = \"_gondelA_\";\n/**\n * Returns true if the given object is a single Element\n */\nfunction isElement(domNode) {\n return domNode.nodeType !== undefined;\n}\n/**\n * This function normalizes takes one of the following:\n * + document query result\n * + dom node array\n * + jquery object\n * + a single dom node\n * and turns it into a single dom node\n */\nexport function getFirstDomNode(domNode) {\n if (isElement(domNode)) {\n return domNode;\n }\n return domNode[0];\n}\n/**\n * Start all nodes in the given context\n */\nexport function startComponents(domContext, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var registry = getComponentRegistry(namespace);\n return startComponentsFromRegistry(registry, domContext ? getFirstDomNode(domContext) : document.documentElement, namespace);\n}\n/**\n * Stop all nodes in the given context\n */\nexport function stopComponents(domContext, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var components = findComponents(domContext, undefined, namespace);\n if (domContext && hasMountedGondelComponent(domContext)) {\n components.unshift(getComponentByDomNode(domContext));\n }\n components.forEach(function (component) { return component.stop(); });\n}\n/**\n * Checks if a component is mounted on a certain DOM node\n */\nexport function hasMountedGondelComponent(domNode, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var gondelComponent = firstNode[internalGondelRefAttribute + namespace];\n if (!gondelComponent || !gondelComponent._ctx) {\n // no anchor prop found or ctx missing. function is needed\n // that we can type the `getComponentByDomNode` without possible\n // returnal of undefined.\n return false;\n }\n return true;\n}\n/**\n * Returns the gondel instance for the given HtmlELement\n */\nexport function getComponentByDomNode(domNode, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var gondelComponent = firstNode[internalGondelRefAttribute + namespace];\n // Stop if this dom node is not known to gondel\n if (gondelComponent && gondelComponent._ctx) {\n return gondelComponent;\n }\n throw new Error(\"Could not find any gondel component under \" + firstNode.nodeName + \" in namespace \\\"\" + namespace + \"\\\",\\n please check if your component is mounted via 'hasMountedGondelComponent'\");\n}\n/**\n * Returns the gondel instance for the given HtmlELement once it is booted\n */\nexport function getComponentByDomNodeAsync(domNode, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var gondelComponent = firstNode[internalGondelAsyncRefAttribute + namespace];\n // Stop if this dom node is not known to gondel\n if (!gondelComponent) {\n return Promise.reject(undefined);\n }\n // or the component is already booted up return it\n if (gondelComponent._ctx) {\n return Promise.resolve(gondelComponent);\n }\n // Wait the component to boot up and return it\n return gondelComponent.then(function () { return firstNode[internalGondelRefAttribute + namespace]; });\n}\n/**\n * Returns all components inside the given node\n */\nexport function findComponents(domNode, componentName, namespace) {\n if (domNode === void 0) { domNode = document.documentElement; }\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var components = [];\n var attribute = \"_gondel_\" + namespace;\n var nodes = firstNode.querySelectorAll(\"[data-\" + namespace + \"-name\" + (componentName ? \"=\\\"\" + componentName + \"\\\"\" : \"\") + \"]\");\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n var gondelComponentInstance = node[attribute];\n // Verify that the component is fully booted\n if (gondelComponentInstance && gondelComponentInstance._ctx === node) {\n components.push(gondelComponentInstance);\n }\n }\n return components;\n}\n//# sourceMappingURL=GondelDomUtils.js.map","/**\n * The event registry provides a way to bind events ahead of time\n * with a very small foot print during launch to improve the time to interaction\n */\nimport { getComponentByDomNode } from \"./GondelDomUtils\";\nimport { fireGondelPluginEvent } from \"./GondelPluginUtils\";\n/**\n * Only real browser events are supported.\n * Unfortunately focus and blur do not bubble so a special mapping is needed.\n */\nvar eventNameMapping = {\n focus: \"focusin\",\n blur: \"focusout\"\n};\n// Polyfill for element.prototype.matches\nvar matchesCssSelector = function (element, selector) {\n var elementPrototype = window.Element.prototype;\n /* istanbul ignore next : Browser polyfill can't be tested */\n var elementMatches = elementPrototype.matches ||\n elementPrototype.matchesSelector ||\n elementPrototype.mozMatchesSelector ||\n elementPrototype.msMatchesSelector ||\n elementPrototype.webkitMatchesSelector;\n // Cache the function and call it\n return (matchesCssSelector = function (element, selector) {\n return elementMatches.call(element, selector);\n })(element, selector);\n};\nfunction getParentElements(startElement) {\n var nodes = [];\n for (var element = startElement; element; element = element.parentElement) {\n nodes.push(element);\n }\n return nodes;\n}\n/**\n * Returns an array of all handlers which would apply for the current target\n */\nexport function getHandlers(attributeName, eventHandlerRegistry, target) {\n var parents = getParentElements(target);\n // Find all selectors which have been registred for this event type\n // and which have a gondel component in one of the parrent nodes\n var selectorsOfFoundComponents = [];\n parents.forEach(function (parent, i) {\n var componentName = parent.getAttribute(attributeName);\n var handlers = componentName && eventHandlerRegistry[componentName];\n if (handlers) {\n // Store the index where the component was found to know in which part\n // of the dom tree the selectors could be found\n selectorsOfFoundComponents.push({ index: i, handlers: handlers });\n }\n });\n // Iterate over all possible selectors to find out if the current event\n // should fire any gondel handler\n var handlerQueue = [];\n selectorsOfFoundComponents.forEach(function (_a) {\n var index = _a.index, handlers = _a.handlers;\n var selectorNames = Object.keys(handlers);\n selectorNames.forEach(function (selectorName) {\n // If no selector is given the handler does always match\n if (!selectorName) {\n return handlerQueue.push({\n index: index,\n ctx: parents[index],\n target: parents[index],\n handlerOptions: handlers[selectorName]\n });\n }\n // Iterate backwards over the children of the component to find an element\n // which matches the selector for the current handler\n for (var i = index; --i >= 0;) {\n if (matchesCssSelector(parents[i], selectorName)) {\n return handlerQueue.push({\n index: i,\n ctx: parents[index],\n target: parents[i],\n handlerOptions: handlers[selectorName]\n });\n }\n }\n });\n });\n // Break if we couldn't find any matching element\n if (handlerQueue.length === 0) {\n return [];\n }\n // Sort the queue so events which are further up the dom are fired first\n handlerQueue.sort(function (handlerA, handlerB) {\n return handlerA.index > handlerB.index ? 1 : handlerA.index === handlerB.index ? 0 : -1;\n });\n return handlerQueue;\n}\n/**\n * The handler which will catch every event at the documentElement\n */\nfunction handleEvent(namespace, attributeName, eventHandlerRegistry, event) {\n var target = event.target;\n var handlers = getHandlers(attributeName, eventHandlerRegistry, target);\n executeHandlers(handlers, event, namespace);\n}\nvar _domEventRegistry;\n/**\n * Returns the namespace registry for the given namespace..\n * This function must be used only by core or plugins\n */\nexport function getEventRegistry(namespace) {\n if (!_domEventRegistry) {\n _domEventRegistry = window[\"__\\ud83d\\udea1DomEvents\"] || {};\n window[\"__\\ud83d\\udea1DomEvents\"] = _domEventRegistry;\n }\n if (!_domEventRegistry[namespace]) {\n _domEventRegistry[namespace] = {};\n }\n return _domEventRegistry[namespace];\n}\n/**\n * Notify components\n * This function must be used by core or only by plugins\n */\nexport function executeHandlers(handlers, event, namespace) {\n /** Store wether the original Event was modified to provide the correct currentTarget */\n var eventObjectRequiresCleanup = false;\n /** Store optional callback results which are executed together to allow grouped redraws */\n var results = [];\n for (var i = 0; i < handlers.length && !event.cancelBubble; i++) {\n var handlerObject = handlers[i];\n var handlerOptions = handlerObject.handlerOptions;\n var gondelComponent = getComponentByDomNode(handlerObject.ctx, namespace);\n // Skip if the component wasn't started or if it was stopped\n if (gondelComponent) {\n // See https://stackoverflow.com/questions/52057726/what-is-the-best-way-to-alter-a-native-browser-event\n Object.defineProperty(event, \"currentTarget\", {\n value: handlerObject.target,\n configurable: true\n });\n eventObjectRequiresCleanup = true;\n for (var j = 0; j < handlerOptions.length && !event.cancelBubble; j++) {\n var handlerResult = gondelComponent[handlerOptions[j].handlerName].call(gondelComponent, event);\n if (typeof handlerResult === \"function\") {\n results.push(handlerResult);\n }\n }\n }\n }\n // Execute all callbacks to allow grouping write events\n results.forEach(function (result) {\n result();\n });\n // Cleanup the event object\n if (eventObjectRequiresCleanup) {\n // See https://stackoverflow.com/questions/52057726/what-is-the-best-way-to-alter-a-native-browser-event\n delete event.currentTarget;\n }\n}\n/**\n * Add a event lister to the element\n * The listener will always call handleEvent with the domEventRegistry for the given event\n */\nfunction startListeningForEvent(eventName, namespace) {\n document.documentElement.addEventListener(eventNameMapping[eventName] || eventName, handleEvent.bind(null, namespace, \"data-\" + namespace + \"-name\", getEventRegistry(namespace)[eventName]));\n}\n/**\n * Add an event to the Gondel EventRegistry\n */\nexport function addRootEventListener(namespace, domEventName, gondelComponentName, handlerName, handlerOption) {\n // Create namespace if neededi\n var namespacedDomEventRegistry = getEventRegistry(namespace);\n // Notify all plugins to allow taking over the event handling for a specific event name\n // This notification is only triggered if a event name e.g. 'click' is used for the first time\n if (!namespacedDomEventRegistry[domEventName]) {\n namespacedDomEventRegistry[domEventName] = {};\n fireGondelPluginEvent(\"registerEvent\", true, {\n eventName: domEventName,\n namespace: namespace,\n eventRegistry: namespacedDomEventRegistry[domEventName]\n }, function (isNativeEvent) {\n // If no plugin registered the event\n // register a native browser event\n if (isNativeEvent) {\n startListeningForEvent(domEventName, namespace);\n }\n });\n }\n if (!namespacedDomEventRegistry[domEventName][gondelComponentName]) {\n namespacedDomEventRegistry[domEventName][gondelComponentName] = {};\n }\n var handlerOptionObject = typeof handlerOption === \"object\" ? handlerOption : { selector: handlerOption };\n var selectorKey = handlerOptionObject.selector || \"\";\n if (!namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey]) {\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey] = [];\n }\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey].push(Object.assign({ handlerName: handlerName, handlerOption: handlerOption }));\n}\n/**\n * Remove an event from the Gondel EventRegistry\n */\nexport function removeRootEventListener(namespace, domEventName, gondelComponentName, handlerName, selector) {\n var selectorKey = selector || \"\";\n var namespacedDomEventRegistry = getEventRegistry(namespace);\n if (namespacedDomEventRegistry[domEventName] &&\n namespacedDomEventRegistry[domEventName][gondelComponentName] &&\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey]) {\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey] = namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey].filter(function (handlerOption) {\n return handlerOption.handlerName !== handlerName || handlerName === undefined;\n });\n }\n}\n/**\n * Remove all events for a given Component (e.g. a Button) from the Gondel EventRegistry\n */\nexport function removeRootEventListernerForComponent(namespace, gondelComponentName) {\n var namespacedDomEventRegistry = getEventRegistry(namespace);\n for (var eventName in namespacedDomEventRegistry) {\n /* istanbul ignore else: for in savety check */\n if (namespacedDomEventRegistry.hasOwnProperty(eventName)) {\n delete namespacedDomEventRegistry[eventName][gondelComponentName];\n }\n }\n}\n//# sourceMappingURL=GondelEventRegistry.js.map","import { addRootEventListener, removeRootEventListernerForComponent } from \"./GondelEventRegistry\";\n// Because of how decorators work @EventListeners is executed before the class is registred\n// so we need to provide a hrm compatible approch initialize and reinitialize the events\nimport { addGondelPluginEventListener } from \"./GondelPluginUtils\";\nimport { registerComponent } from \"./index\";\nexport function Component(componentName, namespace) {\n return function (constructor) {\n registerComponent(componentName, namespace, constructor);\n };\n}\nvar areEventsHookedIntoCore = false;\nfunction hookEventDecoratorInCore() {\n areEventsHookedIntoCore = true;\n addGondelPluginEventListener(\"register\", function (component, _a, next) {\n var componentName = _a.componentName, namespace = _a.namespace, gondelComponentRegistry = _a.gondelComponentRegistry;\n // Only apply in case the component is already active in the DOM\n // this will only happen during hot module replacement\n if (!gondelComponentRegistry._activeComponents[componentName]) {\n return next(component);\n }\n // The decorator will store the event information in two different places.\n // For ES6 classes it is using __events\n // For ES5 prototype classes and transpiled ES6 classes it is using prototype.__events\n var componentEventOptions = (component.prototype && component.prototype.__events) || component.__events;\n if (componentEventOptions) {\n componentEventOptions.forEach(function (eventOptions) {\n addRootEventListener(namespace, \n /* event name: */ eventOptions[0], componentName, \n /* handler: */ eventOptions[1], \n /* selector: */ eventOptions[2]);\n });\n }\n next(component);\n });\n addGondelPluginEventListener(\"unregister\", function (component, _a, next) {\n var componentName = _a.componentName, namespace = _a.namespace;\n removeRootEventListernerForComponent(namespace, componentName);\n next(component);\n });\n addGondelPluginEventListener(\"start\", function (gondelComponents, _a, next) {\n var newComponentNames = _a.newComponentNames, gondelComponentRegistry = _a.gondelComponentRegistry, namespace = _a.namespace;\n newComponentNames.forEach(function (componentName) {\n var gondelComponent = gondelComponentRegistry.getComponent(componentName);\n // The decorator will store the event information in two different places.\n // For ES6 classes it is using __events\n // For ES5 prototype classes and transpiled ES6 classes it is using prototype.__events\n var componentEventOptions = (gondelComponent.prototype && gondelComponent.prototype.__events) ||\n gondelComponent.__events;\n if (componentEventOptions) {\n componentEventOptions.forEach(function (eventOptions) {\n addRootEventListener(namespace, \n /* event name: */ eventOptions[0], componentName, \n /* handler: */ eventOptions[1], \n /* selector: */ eventOptions[2]);\n });\n }\n });\n next(gondelComponents);\n });\n}\n/**\n * The @EventListener decorator will add all event names to a static variable\n */\nexport function EventListener(eventName, selector) {\n return function (target, handler) {\n if (!areEventsHookedIntoCore) {\n hookEventDecoratorInCore();\n }\n if (handler.substr(0, 1) !== \"_\") {\n throw new Error(\"Invalid handler name '\" + handler + \"' use '_\" + handler + \"' instead.\");\n }\n if (!target.__events) {\n target.__events = [];\n }\n target.__events.push([eventName, handler, selector]);\n };\n}\n//# sourceMappingURL=GondelDecorators.js.map","var GondelBaseComponent = /** @class */ (function () {\n function GondelBaseComponent(domNode, componentName) {\n }\n /**\n * Stop method\n */\n GondelBaseComponent.prototype.stop = function () { };\n return GondelBaseComponent;\n}());\nexport { GondelBaseComponent };\n//# sourceMappingURL=GondelComponent.js.map","// Export helpers to hook into the gondel frameworks (should only be used by plugins)\nexport { addGondelPluginEventListener } from \"./GondelPluginUtils\";\n// Export helpers to interact with DOM e.g. start a gondel component for a given DOM node\n// or get a running gondel component instance for a given DOM node\nexport * from \"./GondelDomUtils\";\n// Export https://github.com/tc39/proposal-decorators decorators e.g. @EventListener or @Component\nexport * from \"./GondelDecorators\";\n// Export event helpers to send custom events to React/Angular or foreign gondel components\nexport * from \"./GondelEventEmitter\";\n// Export types of the Gondel Component instance\nexport * from \"./GondelComponent\";\n// Export a helper which allows registring components without using decorators\nexport { registerComponent } from \"./GondelComponentRegistry\";\n// Allow to disable the autobooting feature\nexport { disableAutoStart } from \"./GondelAutoStart\";\n//# sourceMappingURL=index.js.map"],"names":["Component","EventListener"],"mappings":";;;;;;;IAAA,IAAI,kBAAkB,GAAG,UAAU,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAChF;AACA,IAAO,IAAI,YAAY,GAAG,MAAM,CAAC,oBAAoB,IAAI,EAAE,CAAC;IAC5D,MAAM,CAAC,oBAAoB,GAAG,YAAY,CAAC;AAC3C,IAAO,SAAS,qBAAqB,CAAC,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC/E,IAAI,IAAI,SAAS,GAAG,KAAK,CAAC;IAC1B,IAAI,IAAI,cAAc,CAAC;IACvB;IACA;IACA,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,kBAAkB,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,eAAe,EAAE;IACnG,QAAQ,SAAS,GAAG,IAAI,CAAC;IACzB,QAAQ,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAA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AACA,IAAO,SAASC,gBAAa,CAAC,SAAS,EAAE,QAAQ,EAAE;IACnD,IAAI,OAAO,UAAU,MAAM,EAAE,OAAO,EAAE;IACtC,QAAQ,IAAI,CAAC,uBAAuB,EAAE;IACtC,YAAY,wBAAwB,EAAE,CAAC;IACvC,SAAS;IACT,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,EAAE;IAC1C,YAAY,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,CAAC,CAAC;IACtG,SAAS;IACT,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC9B,YAAY,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;IACjC,SAAS;IACT,QAAQ,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC7D,KAAK,CAAC;IACN,CAAC;;AC5EE,QAAC,mBAAmB,kBAAkB,YAAY;IACrD,IAAI,SAAS,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAE;IACzD,KAAK;IACL;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,SAAS,CAAC,IAAI,GAAG,YAAY,GAAG,CAAC;IACzD,IAAI,OAAO,mBAAmB,CAAC;IAC/B,CAAC,EAAE,CAAC;;ICRJ,qFAAqF;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/packages/core/dist/gondel.es5.min.js b/packages/core/dist/gondel.es5.min.js index ddca8739..170ca399 100644 --- a/packages/core/dist/gondel.es5.min.js +++ b/packages/core/dist/gondel.es5.min.js @@ -1,2 +1,2 @@ -!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(n.gondel={})}(this,function(n){"use strict";var c=function(n,e,t){return t(n)},a=window.__gondelPluginEvents||{};function p(n,e,t,o){var r,i=!1;if((a[n]||c)(e,t,function(n){i=!0,r=o?o(n):n}),!i)throw new Error("Async plugin listener");return r}function e(n,i){a[n]||(a[n]=c);var e=a[n];a[n]=function(n,o,r){e(n,o,function(n,e,t){i(n,o,function(n){r(n,o,t)})})}}function d(n,e,t,o,r){void 0===o&&(o={}),void 0===r&&(r=!0);var i=document.createEvent("Event"),c=t?_(t):e._ctx;if(n[0]!==e._namespace)throw new Error("Invalid event name '"+n+"' - use '"+e._namespace+n.charAt(0).toUpperCase()+n.slice(1)+"'");return i.initEvent(n,r,!0),i.data={component:e,name:e._componentName,namespace:e._namespace,eventData:o},c.dispatchEvent(i)}window.__gondelPluginEvents=a;var m=function(){},v=function(){var e=this;this.promise=new Promise(function(n){e.resolve=n})};function o(e,n,o){var t=Array.prototype.slice.call(n.querySelectorAll("[data-"+o+"-name]"));n.hasAttribute("data-"+o+"-name")&&t.push(n);var r=t.filter(function(n){return e=o,!n.hasOwnProperty(g+e);var e}),i=new v;r.forEach(function(n){var e,t;e=n,t=i.promise,e[g+o]=t});var c,a,u=p("boot",r,{namespace:o},function(n){return n.map(function(n){return function(n,e,t){var o=n.getAttribute("data-"+t+"-name"),r=e.getComponent(o);if(void 0===r)throw new Error("Failed to boot component - "+o+" is not registred");var i=new r(n,o);return i._ctx=n,i._namespace=t,i._componentName=o,i.stop=function(n,e,t){d(t+"Stop",n,n._ctx),delete n._ctx[h+t],delete n._ctx[g+t],n._stopped=!0,p("stop",n,{namespace:t},e.bind(n))}.bind(null,i,i.stop||m,t),n["_gondel_"+t]=i}(n,e,o)})}),s=(c=e,a={},u.forEach(function(n){return a[n._componentName]=!0}),Object.keys(a).filter(function(n){return!c._activeComponents[n]}));s.forEach(function(n){return e.setActiveState(n,!0)});var f=p("start",u,{newComponentNames:s,namespace:o,gondelComponentRegistry:e},function(n){return Promise.all(n.map(l))}).then(function(){return u.forEach(function(n){n.sync&&n.sync()}),p("sync",u,{namespace:o})});return f.then(i.resolve,i.resolve).then(function(){return f}),f}function l(t){if(t.start)return 0===t.start.length?t.start():new Promise(function(n,e){return t.start(n,e)})}var r,i="__🚡Registries",u=function(){function n(){this._components={},this._activeComponents={},this._bootMode=2}return n.prototype.registerComponent=function(n,e){this._components[n]=e},n.prototype.unregisterComponent=function(n){delete this._components[n]},n.prototype.getComponent=function(n){return this._components[n]},n.prototype.setActiveState=function(n,e){this._activeComponents[n]=e},n.prototype.setBootMode=function(n){this._bootMode=n},n}();function s(n){var e,t;return r||(r=window[i]||{},window[i]=r),r[n]||(r[n]=new u,e=n,t=function(){Promise.resolve().then(function(){var n=s(e);2===n._bootMode&&(n.setBootMode(0),o(n,document.documentElement,e))})},"complete"==document.readyState?t():document.addEventListener("DOMContentLoaded",t,!1)),r[n]}function f(){var n=arguments,e=n[0],t="string"==typeof n[1]?n[1]:"g",o=n[n.length-1],r=s(t);r.getComponent(e)&&p("unregister",o,{componentName:e,namespace:t}),p("register",o,{componentName:e,namespace:t,gondelComponentRegistry:r},function(n){r.registerComponent(e,n)})}var h="_gondel_",g="_gondelA_";function _(n){return void 0!==n.nodeType?n:n[0]}function y(n,e){void 0===e&&(e="g");var t=_(n)[h+e];return!(!t||!t._ctx)}function E(n,e){void 0===e&&(e="g");var t=_(n),o=t[h+e];if(o&&o._ctx)return o;throw new Error("Could not find any gondel component under "+t.nodeName+' in namespace "'+e+"\",\n please check if your component is mounted via 'hasMountedGondelComponent'")}function w(n,e,t){void 0===n&&(n=document.documentElement),void 0===t&&(t="g");for(var o=[],r="_gondel_"+t,i=_(n).querySelectorAll("[data-"+t+"-name"+(e?'="'+e+'"':"")+"]"),c=0;ce.index?1:n.index===e.index?0:-1}),u)}(e,t,o.target),o,n)}function A(n){return t||(t=window["__🚡DomEvents"]||{},window["__🚡DomEvents"]=t),t[n]||(t[n]={}),t[n]}function N(o,r,n,e,t){var i=A(o);i[r]||(i[r]={},p("registerEvent",!0,{eventName:r,namespace:o,eventRegistry:i[r]},function(n){var e,t;n&&(e=r,t=o,document.documentElement.addEventListener(b[e]||e,x.bind(null,t,"data-"+t+"-name",A(t)[e])))})),i[r][n]||(i[r][n]={});var c=("object"==typeof t?t:{selector:t}).selector||"";i[r][n][c]||(i[r][n][c]=[]),i[r][n][c].push(Object.assign({handlerName:e,handlerOption:t}))}var P=!1;function M(){P=!0,e("register",function(n,e,t){var o=e.componentName,r=e.namespace;if(!e.gondelComponentRegistry._activeComponents[o])return t(n);var i=n.prototype&&n.prototype.__events||n.__events;i&&i.forEach(function(n){N(r,n[0],o,n[1],n[2])}),t(n)}),e("unregister",function(n,e,t){var o=e.componentName;!function(n,e){var t=A(n);for(var o in t)t.hasOwnProperty(o)&&delete t[o][e]}(e.namespace,o),t(n)}),e("start",function(n,e,t){var o=e.newComponentNames,r=e.gondelComponentRegistry,i=e.namespace;o.forEach(function(e){var n=r.getComponent(e),t=n.prototype&&n.prototype.__events||n.__events;t&&t.forEach(function(n){N(i,n[0],e,n[1],n[2])})}),t(n)})}var O=function(){function n(){}return n.prototype.stop=function(){},n}();n.addGondelPluginEventListener=e,n.registerComponent=f,n.disableAutoStart=function(n){void 0===n&&(n="g"),s(n).setBootMode(1)},n.internalGondelRefAttribute=h,n.internalGondelAsyncRefAttribute=g,n.getFirstDomNode=_,n.startComponents=function(n,e){return void 0===e&&(e="g"),o(s(e),n?_(n):document.documentElement,e)},n.stopComponents=function(n,e){void 0===e&&(e="g");var t=w(n,void 0,e);n&&y(n)&&t.unshift(E(n)),t.forEach(function(n){return n.stop()})},n.hasMountedGondelComponent=y,n.getComponentByDomNode=E,n.getComponentByDomNodeAsync=function(n,e){void 0===e&&(e="g");var t=_(n),o=t[g+e];return o?o._ctx?Promise.resolve(o):o.then(function(){return t[h+e]}):Promise.reject(void 0)},n.findComponents=w,n.Component=function(e,t){return function(n){f(e,t,n)}},n.EventListener=function(t,o){return function(n,e){if(P||M(),"_"!==e.substr(0,1))throw new Error("Invalid handler name '"+e+"' use '_"+e+"' instead.");n.__events||(n.__events=[]),n.__events.push([t,e,o])}},n.triggerPublicEvent=d,n.GondelBaseComponent=O,Object.defineProperty(n,"__esModule",{value:!0})}); +!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(n.gondel={})}(this,function(n){"use strict";var c=function(n,e,t){return t(n)},a=window.__gondelPluginEvents||{};function p(n,e,t,o){var r,i=!1;if((a[n]||c)(e,t,function(n){i=!0,r=o?o(n):n}),!i)throw new Error("Async plugin listener");return r}function e(n,i){a[n]||(a[n]=c);var e=a[n];a[n]=function(n,o,r){e(n,o,function(n,e,t){i(n,o,function(n){r(n,o,t)})})}}function d(n,e,t,o,r){void 0===o&&(o={}),void 0===r&&(r=!0);var i=document.createEvent("Event"),c=t?_(t):e._ctx;if(n[0]!==e._namespace)throw new Error("Invalid event name '"+n+"' - use '"+e._namespace+n.charAt(0).toUpperCase()+n.slice(1)+"'");return i.initEvent(n,r,!0),i.data={component:e,name:e._componentName,namespace:e._namespace,eventData:o},c.dispatchEvent(i)}window.__gondelPluginEvents=a;var m=function(){},v=function(){var e=this;this.promise=new Promise(function(n){e.resolve=n})};function o(e,n,o){var t=Array.prototype.slice.call(n.querySelectorAll("[data-"+o+"-name]"));n.hasAttribute("data-"+o+"-name")&&t.push(n);var r=t.filter(function(n){return e=o,!n.hasOwnProperty(g+e);var e}),i=new v;r.forEach(function(n){var e,t;e=n,t=i.promise,e[g+o]=t});var c,a,u=p("boot",r,{namespace:o},function(n){return n.map(function(n){return function(n,e,t){var o=n.getAttribute("data-"+t+"-name"),r=e.getComponent(o);if(void 0===r)throw new Error("Failed to boot component - "+o+" is not registred");var i=new r(n,o);return i._ctx=n,i._namespace=t,i._componentName=o,i.stop=function(n,e,t){d(t+"Stop",n,n._ctx),delete n._ctx[h+t],delete n._ctx[g+t],n._stopped=!0,p("stop",n,{namespace:t},e.bind(n))}.bind(null,i,i.stop||m,t),n["_gondel_"+t]=i}(n,e,o)})}),s=(c=e,a={},u.forEach(function(n){return a[n._componentName]=!0}),Object.keys(a).filter(function(n){return!c._activeComponents[n]}));s.forEach(function(n){return e.setActiveState(n,!0)});var f=p("start",u,{newComponentNames:s,namespace:o,gondelComponentRegistry:e},function(n){return Promise.all(n.map(l))}).then(function(){return u.forEach(function(n){n.sync&&n.sync()}),p("sync",u,{namespace:o})});return f.then(i.resolve,i.resolve).then(function(){return f}),f}function l(t){if(t.start)return 0===t.start.length?t.start():new Promise(function(n,e){return t.start(n,e)})}var r,i="__🚡Registries",u=function(){function n(){this._components={},this._activeComponents={},this._bootMode=2}return n.prototype.registerComponent=function(n,e){this._components[n]=e},n.prototype.unregisterComponent=function(n){delete this._components[n]},n.prototype.getComponent=function(n){return this._components[n]},n.prototype.setActiveState=function(n,e){this._activeComponents[n]=e},n.prototype.setBootMode=function(n){this._bootMode=n},n}();function s(n){var e,t;return r||(r=window[i]||{},window[i]=r),r[n]||(r[n]=new u,e=n,t=function(){Promise.resolve().then(function(){var n=s(e);2===n._bootMode&&(n.setBootMode(0),o(n,document.documentElement,e))})},"complete"==document.readyState?t():document.addEventListener("DOMContentLoaded",t,!1)),r[n]}function f(){var n=arguments,e=n[0],t="string"==typeof n[1]?n[1]:"g",o=n[n.length-1],r=s(t);r.getComponent(e)&&p("unregister",o,{componentName:e,namespace:t}),p("register",o,{componentName:e,namespace:t,gondelComponentRegistry:r},function(n){r.registerComponent(e,n)})}var h="_gondel_",g="_gondelA_";function _(n){return void 0!==n.nodeType?n:n[0]}function y(n,e){void 0===e&&(e="g");var t=_(n)[h+e];return!(!t||!t._ctx)}function E(n,e){void 0===e&&(e="g");var t=_(n),o=t[h+e];if(o&&o._ctx)return o;throw new Error("Could not find any gondel component under "+t.nodeName+' in namespace "'+e+"\",\n please check if your component is mounted via 'hasMountedGondelComponent'")}function w(n,e,t){void 0===n&&(n=document.documentElement),void 0===t&&(t="g");for(var o=[],r="_gondel_"+t,i=_(n).querySelectorAll("[data-"+t+"-name"+(e?'="'+e+'"':"")+"]"),c=0;ce.index?1:n.index===e.index?0:-1}),u)}(e,t,o.target),o,n)}function A(n){return t||(t=window["__🚡DomEvents"]||{},window["__🚡DomEvents"]=t),t[n]||(t[n]={}),t[n]}function N(o,r,n,e,t){var i=A(o);i[r]||(i[r]={},p("registerEvent",!0,{eventName:r,namespace:o,eventRegistry:i[r]},function(n){var e,t;n&&(e=r,t=o,document.documentElement.addEventListener(b[e]||e,x.bind(null,t,"data-"+t+"-name",A(t)[e])))})),i[r][n]||(i[r][n]={});var c=("object"==typeof t?t:{selector:t}).selector||"";i[r][n][c]||(i[r][n][c]=[]),i[r][n][c].push(Object.assign({handlerName:e,handlerOption:t}))}var P=!1;function M(){P=!0,e("register",function(n,e,t){var o=e.componentName,r=e.namespace;if(!e.gondelComponentRegistry._activeComponents[o])return t(n);var i=n.prototype&&n.prototype.__events||n.__events;i&&i.forEach(function(n){N(r,n[0],o,n[1],n[2])}),t(n)}),e("unregister",function(n,e,t){var o=e.componentName;!function(n,e){var t=A(n);for(var o in t)t.hasOwnProperty(o)&&delete t[o][e]}(e.namespace,o),t(n)}),e("start",function(n,e,t){var o=e.newComponentNames,r=e.gondelComponentRegistry,i=e.namespace;o.forEach(function(e){var n=r.getComponent(e),t=n.prototype&&n.prototype.__events||n.__events;t&&t.forEach(function(n){N(i,n[0],e,n[1],n[2])})}),t(n)})}var O=function(){function n(n,e){}return n.prototype.stop=function(){},n}();n.addGondelPluginEventListener=e,n.registerComponent=f,n.disableAutoStart=function(n){void 0===n&&(n="g"),s(n).setBootMode(1)},n.internalGondelRefAttribute=h,n.internalGondelAsyncRefAttribute=g,n.getFirstDomNode=_,n.startComponents=function(n,e){return void 0===e&&(e="g"),o(s(e),n?_(n):document.documentElement,e)},n.stopComponents=function(n,e){void 0===e&&(e="g");var t=w(n,void 0,e);n&&y(n)&&t.unshift(E(n)),t.forEach(function(n){return n.stop()})},n.hasMountedGondelComponent=y,n.getComponentByDomNode=E,n.getComponentByDomNodeAsync=function(n,e){void 0===e&&(e="g");var t=_(n),o=t[g+e];return o?o._ctx?Promise.resolve(o):o.then(function(){return t[h+e]}):Promise.reject(void 0)},n.findComponents=w,n.Component=function(e,t){return function(n){f(e,t,n)}},n.EventListener=function(t,o){return function(n,e){if(P||M(),"_"!==e.substr(0,1))throw new Error("Invalid handler name '"+e+"' use '_"+e+"' instead.");n.__events||(n.__events=[]),n.__events.push([t,e,o])}},n.triggerPublicEvent=d,n.GondelBaseComponent=O,Object.defineProperty(n,"__esModule",{value:!0})}); //# sourceMappingURL=gondel.es5.min.js.map diff --git a/packages/core/dist/gondel.es5.min.js.map b/packages/core/dist/gondel.es5.min.js.map index 31781f0f..5996d370 100644 --- a/packages/core/dist/gondel.es5.min.js.map +++ b/packages/core/dist/gondel.es5.min.js.map @@ -1 +1 @@ -{"version":3,"file":"gondel.es5.min.js","sources":["GondelPluginUtils.js","GondelEventEmitter.js","GondelComponentStarter.js","GondelComponentRegistry.js","GondelAutoStart.js","GondelDomUtils.js","GondelEventRegistry.js","GondelDecorators.js","GondelComponent.js"],"sourcesContent":["var basePluginListener = function (result, data, next) { return next(result); };\n// Global plugin events registry\nexport var pluginEvents = window.__gondelPluginEvents || {};\nwindow.__gondelPluginEvents = pluginEvents;\nexport function fireGondelPluginEvent(eventName, initialValue, data, callback) {\n var isSyncron = false;\n var callbackResult;\n // Execute all bound events for the given name\n // if they exist\n (pluginEvents[eventName] || basePluginListener)(initialValue, data, function (processedResult) {\n isSyncron = true;\n callbackResult = callback ? callback(processedResult) : processedResult;\n });\n // Add a guard to prevent asyncron plugin listeners\n // to simplify the usage of fireGondelPluginEvent\n if (!isSyncron) {\n throw new Error(\"Async plugin listener\");\n }\n return callbackResult;\n}\n/**\n * Fire an async event which allows gondel plugins to add features to gondel\n */\nexport function fireAsyncGondelPluginEvent(eventName, initialValue, data) {\n return new Promise(function (resolve) {\n (pluginEvents[eventName] || basePluginListener)(initialValue, data, function (result) {\n resolve(result);\n });\n });\n}\n/**\n * Allow plugins to hook into the gondel event system\n */\nexport function addGondelPluginEventListener(eventName, eventListenerCallback) {\n if (!pluginEvents[eventName]) {\n pluginEvents[eventName] = basePluginListener;\n }\n var previousEventHandler = pluginEvents[eventName];\n pluginEvents[eventName] = function wrapCallback(result, data, next) {\n previousEventHandler(result, data, function callNextPlugin(modifiedResult, _, firstNext) {\n eventListenerCallback(modifiedResult, data, function bindData(result) {\n next(result, data, firstNext);\n });\n });\n };\n}\n//# sourceMappingURL=GondelPluginUtils.js.map","import { getFirstDomNode } from \"./GondelDomUtils\";\n/**\n * Submit an event which might be caught by foreign gondel, angular or react components\n */\nexport function triggerPublicEvent(eventName, gondelComponent, target, eventData, canBubble) {\n if (eventData === void 0) { eventData = {}; }\n if (canBubble === void 0) { canBubble = true; }\n var event = document.createEvent(\"Event\");\n var eventTarget = target ? getFirstDomNode(target) : gondelComponent._ctx;\n if (eventName[0] !== gondelComponent._namespace) {\n throw new Error(\"Invalid event name '\" +\n eventName +\n \"' - use '\" +\n gondelComponent._namespace +\n eventName.charAt(0).toUpperCase() +\n eventName.slice(1) +\n \"'\");\n }\n event.initEvent(eventName, canBubble, true);\n event.data = {\n component: gondelComponent,\n name: gondelComponent._componentName,\n namespace: gondelComponent._namespace,\n eventData: eventData\n };\n return eventTarget.dispatchEvent(event);\n}\n//# sourceMappingURL=GondelEventEmitter.js.map","import { internalGondelAsyncRefAttribute, internalGondelRefAttribute } from \"./GondelDomUtils\";\nimport { triggerPublicEvent } from \"./GondelEventEmitter\";\nimport { fireGondelPluginEvent } from \"./GondelPluginUtils\";\nvar noop = function () { };\nvar Deferred = function () {\n var _this = this;\n this.promise = new Promise(function (resolve) {\n _this.resolve = resolve;\n });\n};\n/**\n * Start all components of the gondel component registry\n * for the given dom context\n */\nexport function startComponentsFromRegistry(gondelComponentRegistry, domContext, namespace) {\n // Get an array of all nodes which match the namespace\n var gondelDomNodeList = Array.prototype.slice.call(domContext.querySelectorAll(\"[data-\" + namespace + \"-name]\"));\n if (domContext.hasAttribute(\"data-\" + namespace + \"-name\")) {\n gondelDomNodeList.push(domContext);\n }\n // Remove already booted nodes\n var pristineGondelDomNodes = gondelDomNodeList.filter(function (gondelDomNode) {\n return isPristineGondelDomNode(gondelDomNode, namespace);\n });\n var bootingDeferred = new Deferred();\n // Mark all nodes as booting\n pristineGondelDomNodes.forEach(function (gondelDomNode) {\n attachGondelBootingFlag(gondelDomNode, bootingDeferred.promise, namespace);\n });\n // Create instances\n var gondelComponents = fireGondelPluginEvent(\"boot\", pristineGondelDomNodes, { namespace: namespace }, function (pristineGondelDomNodes) {\n return pristineGondelDomNodes.map(function (gondelDomNode) {\n return constructComponent(gondelDomNode, gondelComponentRegistry, namespace);\n });\n });\n // Get all component names\n var newComponentNames = getNewComponents(gondelComponents, gondelComponentRegistry);\n newComponentNames.forEach(function (componentName) {\n return gondelComponentRegistry.setActiveState(componentName, true);\n });\n // Start all components\n var gondelComponentStartPromise = fireGondelPluginEvent(\"start\", gondelComponents, { newComponentNames: newComponentNames, namespace: namespace, gondelComponentRegistry: gondelComponentRegistry }, function (gondelComponents) {\n // Wait for async started components\n return Promise.all(gondelComponents.map(startConstructedComponent));\n })\n // Let all plugins know that the components are now all ready to use\n .then(function () {\n gondelComponents.forEach(function (gondelComponent) {\n if (gondelComponent.sync) {\n gondelComponent.sync();\n }\n });\n return fireGondelPluginEvent(\"sync\", gondelComponents, { namespace: namespace });\n });\n // Resolve the booting deferred\n gondelComponentStartPromise\n .then(bootingDeferred.resolve, bootingDeferred.resolve)\n // Rethrow errors (if any)\n // otherwise the browser dev tools won't show\n // important bootstrap errors\n .then(function () { return gondelComponentStartPromise; });\n // Return a promise of all started components\n return gondelComponentStartPromise;\n}\n/**\n * Returns true if the given domNode is neither booting nor booted\n */\nexport function isPristineGondelDomNode(domNode, namespace) {\n return !domNode.hasOwnProperty(internalGondelAsyncRefAttribute + namespace);\n}\n/**\n * Mark the given dom node as controlled by gondel\n */\nexport function attachGondelBootingFlag(domNode, bootingFlag, namespace) {\n // The name `A` mean async\n // to allow waiting for asyncronous booted components\n domNode[internalGondelAsyncRefAttribute + namespace] = bootingFlag;\n}\n/**\n * Constructs a new component\n */\nexport function constructComponent(domNode, gondelComponentRegistry, namespace) {\n var componentName = domNode.getAttribute(\"data-\" + namespace + \"-name\");\n var GondelComponent = gondelComponentRegistry.getComponent(componentName);\n if (GondelComponent === undefined) {\n throw new Error(\"Failed to boot component - \" + componentName + \" is not registred\");\n }\n var componentInstance = new GondelComponent(domNode, componentName);\n componentInstance._ctx = domNode;\n componentInstance._namespace = namespace;\n componentInstance._componentName = componentName;\n // Add stop method\n componentInstance.stop = stopStartedComponent.bind(null, componentInstance, componentInstance.stop || noop, namespace);\n // Create a circular reference which will allow access to the componentInstance from ctx\n domNode[\"_gondel_\" + namespace] = componentInstance;\n return componentInstance;\n}\n/**\n * Start a component after it was constructed\n */\nexport function startConstructedComponent(component) {\n // Skip if the start method is missing\n if (!component.start) {\n return;\n }\n var expectsNoArguments = component.start.length === 0;\n // Start the component and expect a promise or a syncronous return value\n // if the function expects no arguments\n if (expectsNoArguments) {\n return component.start();\n }\n return new Promise(function (resolve, reject) { return component.start(resolve, reject); });\n}\n/**\n * Stops a started component\n */\nexport function stopStartedComponent(component, internalStopMethod, namespace) {\n triggerPublicEvent(namespace + \"Stop\", component, component._ctx);\n // Remove the component instance from the html element\n delete component._ctx[internalGondelRefAttribute + namespace];\n delete component._ctx[internalGondelAsyncRefAttribute + namespace];\n component._stopped = true;\n fireGondelPluginEvent(\"stop\", component, { namespace: namespace }, internalStopMethod.bind(component));\n}\n/**\n * Filters the given component list and returns the names of those components which have never been started before\n */\nfunction getNewComponents(components, registry) {\n var componentNameHelper = {};\n components.forEach(function (component) { return (componentNameHelper[component._componentName] = true); });\n var componentNames = Object.keys(componentNameHelper);\n return componentNames.filter(function (componentName) { return !registry._activeComponents[componentName]; });\n}\n//# sourceMappingURL=GondelComponentStarter.js.map","import { fireGondelPluginEvent } from \"./GondelPluginUtils\";\nimport { addRegistryToBootloader } from \"./GondelAutoStart\";\nvar GLOBAL_GONDEL_REGISTRY_NAMESPACE = \"__\\ud83d\\udea1Registries\";\nvar GondelComponentRegistry = /** @class */ (function () {\n function GondelComponentRegistry() {\n this._components = {};\n this._activeComponents = {};\n this._bootMode = 2 /* onDomReady */;\n }\n GondelComponentRegistry.prototype.registerComponent = function (name, gondelComponent) {\n this._components[name] = gondelComponent;\n };\n GondelComponentRegistry.prototype.unregisterComponent = function (name) {\n delete this._components[name];\n };\n GondelComponentRegistry.prototype.getComponent = function (name) {\n return this._components[name];\n };\n /**\n * Set if a component is used\n */\n GondelComponentRegistry.prototype.setActiveState = function (name, isActive) {\n this._activeComponents[name] = isActive;\n };\n GondelComponentRegistry.prototype.setBootMode = function (bootMode) {\n this._bootMode = bootMode;\n };\n return GondelComponentRegistry;\n}());\nexport { GondelComponentRegistry };\nvar _componentRegistries;\nexport function getComponentRegistry(namespace) {\n if (!_componentRegistries) {\n _componentRegistries = window[GLOBAL_GONDEL_REGISTRY_NAMESPACE] || {};\n window[GLOBAL_GONDEL_REGISTRY_NAMESPACE] = _componentRegistries;\n }\n if (!_componentRegistries[namespace]) {\n _componentRegistries[namespace] = new GondelComponentRegistry();\n addRegistryToBootloader(namespace);\n }\n return _componentRegistries[namespace];\n}\nexport function registerComponent() {\n var args = arguments;\n // The componentName is always the first argument\n var componentName = args[0];\n // Use namespace from the second argument or fallback to the default \"g\" if it is missing\n var namespace = typeof args[1] === \"string\" ? args[1] : \"g\";\n // The last argument is always the component class\n var component = args[args.length - 1];\n var gondelComponentRegistry = getComponentRegistry(namespace);\n // If this component was already registered we remove the previous one\n // and notify all plugins - this is especially usefull for hot component replacement\n if (gondelComponentRegistry.getComponent(componentName)) {\n fireGondelPluginEvent(\"unregister\", component, { componentName: componentName, namespace: namespace });\n }\n // Let plugins know about the new component\n fireGondelPluginEvent(\"register\", component, {\n componentName: componentName,\n namespace: namespace,\n gondelComponentRegistry: gondelComponentRegistry\n }, function (component) {\n gondelComponentRegistry.registerComponent(componentName, component);\n });\n}\n//# sourceMappingURL=GondelComponentRegistry.js.map","import { getComponentRegistry } from \"./GondelComponentRegistry\";\nimport { startComponentsFromRegistry } from \"./GondelComponentStarter\";\n/**\n * By default Gondel will run startComponents on DOMContentLoaded\n * To gain more controll over the boot behaviour tihs function can be called\n * to disable the auto start\n */\nexport function disableAutoStart(namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n getComponentRegistry(namespace).setBootMode(1 /* manual */);\n}\n/**\n * Wait for document ready and boot the registry\n */\nexport function addRegistryToBootloader(namespace) {\n // Use new Promise to wait for the next tick\n var boot = function () {\n Promise.resolve().then(function () {\n var gondelComponentRegistry = getComponentRegistry(namespace);\n if (gondelComponentRegistry._bootMode === 2 /* onDomReady */) {\n gondelComponentRegistry.setBootMode(0 /* alreadyBooted */);\n startComponentsFromRegistry(gondelComponentRegistry, document.documentElement, namespace);\n }\n });\n };\n // Boot if document is complete or once it completes\n if (document.readyState == \"complete\") {\n boot();\n }\n else {\n document.addEventListener(\"DOMContentLoaded\", boot, false);\n }\n}\n//# sourceMappingURL=GondelAutoStart.js.map","import { getComponentRegistry } from \"./GondelComponentRegistry\";\nimport { startComponentsFromRegistry } from \"./GondelComponentStarter\";\nexport var internalGondelRefAttribute = \"_gondel_\";\nexport var internalGondelAsyncRefAttribute = \"_gondelA_\";\n/**\n * Returns true if the given object is a single Element\n */\nfunction isElement(domNode) {\n return domNode.nodeType !== undefined;\n}\n/**\n * This function normalizes takes one of the following:\n * + document query result\n * + dom node array\n * + jquery object\n * + a single dom node\n * and turns it into a single dom node\n */\nexport function getFirstDomNode(domNode) {\n if (isElement(domNode)) {\n return domNode;\n }\n return domNode[0];\n}\n/**\n * Start all nodes in the given context\n */\nexport function startComponents(domContext, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var registry = getComponentRegistry(namespace);\n return startComponentsFromRegistry(registry, domContext ? getFirstDomNode(domContext) : document.documentElement, namespace);\n}\n/**\n * Stop all nodes in the given context\n */\nexport function stopComponents(domContext, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var components = findComponents(domContext, undefined, namespace);\n if (domContext && hasMountedGondelComponent(domContext)) {\n components.unshift(getComponentByDomNode(domContext));\n }\n components.forEach(function (component) { return component.stop(); });\n}\n/**\n * Checks if a component is mounted on a certain DOM node\n */\nexport function hasMountedGondelComponent(domNode, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var gondelComponent = firstNode[internalGondelRefAttribute + namespace];\n if (!gondelComponent || !gondelComponent._ctx) {\n // no anchor prop found or ctx missing. function is needed\n // that we can type the `getComponentByDomNode` without possible\n // returnal of undefined.\n return false;\n }\n return true;\n}\n/**\n * Returns the gondel instance for the given HtmlELement\n */\nexport function getComponentByDomNode(domNode, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var gondelComponent = firstNode[internalGondelRefAttribute + namespace];\n // Stop if this dom node is not known to gondel\n if (gondelComponent && gondelComponent._ctx) {\n return gondelComponent;\n }\n throw new Error(\"Could not find any gondel component under \" + firstNode.nodeName + \" in namespace \\\"\" + namespace + \"\\\",\\n please check if your component is mounted via 'hasMountedGondelComponent'\");\n}\n/**\n * Returns the gondel instance for the given HtmlELement once it is booted\n */\nexport function getComponentByDomNodeAsync(domNode, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var gondelComponent = firstNode[internalGondelAsyncRefAttribute + namespace];\n // Stop if this dom node is not known to gondel\n if (!gondelComponent) {\n return Promise.reject(undefined);\n }\n // or the component is already booted up return it\n if (gondelComponent._ctx) {\n return Promise.resolve(gondelComponent);\n }\n // Wait the component to boot up and return it\n return gondelComponent.then(function () { return firstNode[internalGondelRefAttribute + namespace]; });\n}\n/**\n * Returns all components inside the given node\n */\nexport function findComponents(domNode, componentName, namespace) {\n if (domNode === void 0) { domNode = document.documentElement; }\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var components = [];\n var attribute = \"_gondel_\" + namespace;\n var nodes = firstNode.querySelectorAll(\"[data-\" + namespace + \"-name\" + (componentName ? \"=\\\"\" + componentName + \"\\\"\" : \"\") + \"]\");\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n var gondelComponentInstance = node[attribute];\n // Verify that the component is fully booted\n if (gondelComponentInstance && gondelComponentInstance._ctx === node) {\n components.push(gondelComponentInstance);\n }\n }\n return components;\n}\n//# sourceMappingURL=GondelDomUtils.js.map","/**\n * The event registry provides a way to bind events ahead of time\n * with a very small foot print during launch to improve the time to interaction\n */\nimport { getComponentByDomNode } from \"./GondelDomUtils\";\nimport { fireGondelPluginEvent } from \"./GondelPluginUtils\";\n/**\n * Only real browser events are supported.\n * Unfortunately focus and blur do not bubble so a special mapping is needed.\n */\nvar eventNameMapping = {\n focus: \"focusin\",\n blur: \"focusout\"\n};\n// Polyfill for element.prototype.matches\nvar matchesCssSelector = function (element, selector) {\n var elementPrototype = window.Element.prototype;\n /* istanbul ignore next : Browser polyfill can't be tested */\n var elementMatches = elementPrototype.matches ||\n elementPrototype.matchesSelector ||\n elementPrototype.mozMatchesSelector ||\n elementPrototype.msMatchesSelector ||\n elementPrototype.webkitMatchesSelector;\n // Cache the function and call it\n return (matchesCssSelector = function (element, selector) {\n return elementMatches.call(element, selector);\n })(element, selector);\n};\nfunction getParentElements(startElement) {\n var nodes = [];\n for (var element = startElement; element; element = element.parentElement) {\n nodes.push(element);\n }\n return nodes;\n}\n/**\n * Returns an array of all handlers which would apply for the current target\n */\nexport function getHandlers(attributeName, eventHandlerRegistry, target) {\n var parents = getParentElements(target);\n // Find all selectors which have been registred for this event type\n // and which have a gondel component in one of the parrent nodes\n var selectorsOfFoundComponents = [];\n parents.forEach(function (parent, i) {\n var componentName = parent.getAttribute(attributeName);\n var handlers = componentName && eventHandlerRegistry[componentName];\n if (handlers) {\n // Store the index where the component was found to know in which part\n // of the dom tree the selectors could be found\n selectorsOfFoundComponents.push({ index: i, handlers: handlers });\n }\n });\n // Iterate over all possible selectors to find out if the current event\n // should fire any gondel handler\n var handlerQueue = [];\n selectorsOfFoundComponents.forEach(function (_a) {\n var index = _a.index, handlers = _a.handlers;\n var selectorNames = Object.keys(handlers);\n selectorNames.forEach(function (selectorName) {\n // If no selector is given the handler does always match\n if (!selectorName) {\n return handlerQueue.push({\n index: index,\n ctx: parents[index],\n target: parents[index],\n handlerOptions: handlers[selectorName]\n });\n }\n // Iterate backwards over the children of the component to find an element\n // which matches the selector for the current handler\n for (var i = index; --i >= 0;) {\n if (matchesCssSelector(parents[i], selectorName)) {\n return handlerQueue.push({\n index: i,\n ctx: parents[index],\n target: parents[i],\n handlerOptions: handlers[selectorName]\n });\n }\n }\n });\n });\n // Break if we couldn't find any matching element\n if (handlerQueue.length === 0) {\n return [];\n }\n // Sort the queue so events which are further up the dom are fired first\n handlerQueue.sort(function (handlerA, handlerB) {\n return handlerA.index > handlerB.index ? 1 : handlerA.index === handlerB.index ? 0 : -1;\n });\n return handlerQueue;\n}\n/**\n * The handler which will catch every event at the documentElement\n */\nfunction handleEvent(namespace, attributeName, eventHandlerRegistry, event) {\n var target = event.target;\n var handlers = getHandlers(attributeName, eventHandlerRegistry, target);\n executeHandlers(handlers, event, namespace);\n}\nvar _domEventRegistry;\n/**\n * Returns the namespace registry for the given namespace..\n * This function must be used only by core or plugins\n */\nexport function getEventRegistry(namespace) {\n if (!_domEventRegistry) {\n _domEventRegistry = window[\"__\\ud83d\\udea1DomEvents\"] || {};\n window[\"__\\ud83d\\udea1DomEvents\"] = _domEventRegistry;\n }\n if (!_domEventRegistry[namespace]) {\n _domEventRegistry[namespace] = {};\n }\n return _domEventRegistry[namespace];\n}\n/**\n * Notify components\n * This function must be used by core or only by plugins\n */\nexport function executeHandlers(handlers, event, namespace) {\n /** Store wether the original Event was modified to provide the correct currentTarget */\n var eventObjectRequiresCleanup = false;\n /** Store optional callback results which are executed together to allow grouped redraws */\n var results = [];\n for (var i = 0; i < handlers.length && !event.cancelBubble; i++) {\n var handlerObject = handlers[i];\n var handlerOptions = handlerObject.handlerOptions;\n var gondelComponent = getComponentByDomNode(handlerObject.ctx, namespace);\n // Skip if the component wasn't started or if it was stopped\n if (gondelComponent) {\n // See https://stackoverflow.com/questions/52057726/what-is-the-best-way-to-alter-a-native-browser-event\n Object.defineProperty(event, \"currentTarget\", {\n value: handlerObject.target,\n configurable: true\n });\n eventObjectRequiresCleanup = true;\n for (var j = 0; j < handlerOptions.length && !event.cancelBubble; j++) {\n var handlerResult = gondelComponent[handlerOptions[j].handlerName].call(gondelComponent, event);\n if (typeof handlerResult === \"function\") {\n results.push(handlerResult);\n }\n }\n }\n }\n // Execute all callbacks to allow grouping write events\n results.forEach(function (result) {\n result();\n });\n // Cleanup the event object\n if (eventObjectRequiresCleanup) {\n // See https://stackoverflow.com/questions/52057726/what-is-the-best-way-to-alter-a-native-browser-event\n delete event.currentTarget;\n }\n}\n/**\n * Add a event lister to the element\n * The listener will always call handleEvent with the domEventRegistry for the given event\n */\nfunction startListeningForEvent(eventName, namespace) {\n document.documentElement.addEventListener(eventNameMapping[eventName] || eventName, handleEvent.bind(null, namespace, \"data-\" + namespace + \"-name\", getEventRegistry(namespace)[eventName]));\n}\n/**\n * Add an event to the Gondel EventRegistry\n */\nexport function addRootEventListener(namespace, domEventName, gondelComponentName, handlerName, handlerOption) {\n // Create namespace if neededi\n var namespacedDomEventRegistry = getEventRegistry(namespace);\n // Notify all plugins to allow taking over the event handling for a specific event name\n // This notification is only triggered if a event name e.g. 'click' is used for the first time\n if (!namespacedDomEventRegistry[domEventName]) {\n namespacedDomEventRegistry[domEventName] = {};\n fireGondelPluginEvent(\"registerEvent\", true, {\n eventName: domEventName,\n namespace: namespace,\n eventRegistry: namespacedDomEventRegistry[domEventName]\n }, function (isNativeEvent) {\n // If no plugin registered the event\n // register a native browser event\n if (isNativeEvent) {\n startListeningForEvent(domEventName, namespace);\n }\n });\n }\n if (!namespacedDomEventRegistry[domEventName][gondelComponentName]) {\n namespacedDomEventRegistry[domEventName][gondelComponentName] = {};\n }\n var handlerOptionObject = typeof handlerOption === \"object\" ? handlerOption : { selector: handlerOption };\n var selectorKey = handlerOptionObject.selector || \"\";\n if (!namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey]) {\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey] = [];\n }\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey].push(Object.assign({ handlerName: handlerName, handlerOption: handlerOption }));\n}\n/**\n * Remove an event from the Gondel EventRegistry\n */\nexport function removeRootEventListener(namespace, domEventName, gondelComponentName, handlerName, selector) {\n var selectorKey = selector || \"\";\n var namespacedDomEventRegistry = getEventRegistry(namespace);\n if (namespacedDomEventRegistry[domEventName] &&\n namespacedDomEventRegistry[domEventName][gondelComponentName] &&\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey]) {\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey] = namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey].filter(function (handlerOption) {\n return handlerOption.handlerName !== handlerName || handlerName === undefined;\n });\n }\n}\n/**\n * Remove all events for a given Component (e.g. a Button) from the Gondel EventRegistry\n */\nexport function removeRootEventListernerForComponent(namespace, gondelComponentName) {\n var namespacedDomEventRegistry = getEventRegistry(namespace);\n for (var eventName in namespacedDomEventRegistry) {\n /* istanbul ignore else: for in savety check */\n if (namespacedDomEventRegistry.hasOwnProperty(eventName)) {\n delete namespacedDomEventRegistry[eventName][gondelComponentName];\n }\n }\n}\n//# sourceMappingURL=GondelEventRegistry.js.map","import { addRootEventListener, removeRootEventListernerForComponent } from \"./GondelEventRegistry\";\n// Because of how decorators work @EventListeners is executed before the class is registred\n// so we need to provide a hrm compatible approch initialize and reinitialize the events\nimport { addGondelPluginEventListener } from \"./GondelPluginUtils\";\nimport { registerComponent } from \"./index\";\nexport function Component(componentName, namespace) {\n return function (constructor) {\n registerComponent(componentName, namespace, constructor);\n };\n}\nvar areEventsHookedIntoCore = false;\nfunction hookEventDecoratorInCore() {\n areEventsHookedIntoCore = true;\n addGondelPluginEventListener(\"register\", function (component, _a, next) {\n var componentName = _a.componentName, namespace = _a.namespace, gondelComponentRegistry = _a.gondelComponentRegistry;\n // Only apply in case the component is already active in the DOM\n // this will only happen during hot module replacement\n if (!gondelComponentRegistry._activeComponents[componentName]) {\n return next(component);\n }\n // The decorator will store the event information in two different places.\n // For ES6 classes it is using __events\n // For ES5 prototype classes and transpiled ES6 classes it is using prototype.__events\n var componentEventOptions = (component.prototype && component.prototype.__events) || component.__events;\n if (componentEventOptions) {\n componentEventOptions.forEach(function (eventOptions) {\n addRootEventListener(namespace, \n /* event name: */ eventOptions[0], componentName, \n /* handler: */ eventOptions[1], \n /* selector: */ eventOptions[2]);\n });\n }\n next(component);\n });\n addGondelPluginEventListener(\"unregister\", function (component, _a, next) {\n var componentName = _a.componentName, namespace = _a.namespace;\n removeRootEventListernerForComponent(namespace, componentName);\n next(component);\n });\n addGondelPluginEventListener(\"start\", function (gondelComponents, _a, next) {\n var newComponentNames = _a.newComponentNames, gondelComponentRegistry = _a.gondelComponentRegistry, namespace = _a.namespace;\n newComponentNames.forEach(function (componentName) {\n var gondelComponent = gondelComponentRegistry.getComponent(componentName);\n // The decorator will store the event information in two different places.\n // For ES6 classes it is using __events\n // For ES5 prototype classes and transpiled ES6 classes it is using prototype.__events\n var componentEventOptions = (gondelComponent.prototype && gondelComponent.prototype.__events) ||\n gondelComponent.__events;\n if (componentEventOptions) {\n componentEventOptions.forEach(function (eventOptions) {\n addRootEventListener(namespace, \n /* event name: */ eventOptions[0], componentName, \n /* handler: */ eventOptions[1], \n /* selector: */ eventOptions[2]);\n });\n }\n });\n next(gondelComponents);\n });\n}\n/**\n * The @EventListener decorator will add all event names to a static variable\n */\nexport function EventListener(eventName, selector) {\n return function (target, handler) {\n if (!areEventsHookedIntoCore) {\n hookEventDecoratorInCore();\n }\n if (handler.substr(0, 1) !== \"_\") {\n throw new Error(\"Invalid handler name '\" + handler + \"' use '_\" + handler + \"' instead.\");\n }\n if (!target.__events) {\n target.__events = [];\n }\n target.__events.push([eventName, handler, selector]);\n };\n}\n//# sourceMappingURL=GondelDecorators.js.map","var GondelBaseComponent = /** @class */ (function () {\n function GondelBaseComponent() {\n }\n /**\n * Stop method\n */\n GondelBaseComponent.prototype.stop = function () { };\n return GondelBaseComponent;\n}());\nexport { GondelBaseComponent };\n//# sourceMappingURL=GondelComponent.js.map"],"names":["basePluginListener","result","data","next","pluginEvents","window","__gondelPluginEvents","fireGondelPluginEvent","eventName","initialValue","callback","callbackResult","isSyncron","processedResult","Error","addGondelPluginEventListener","eventListenerCallback","previousEventHandler","modifiedResult","_","firstNext","triggerPublicEvent","gondelComponent","target","eventData","canBubble","event","document","createEvent","eventTarget","getFirstDomNode","_ctx","_namespace","charAt","toUpperCase","slice","initEvent","component","name","_componentName","namespace","dispatchEvent","noop","Deferred","_this","this","promise","Promise","resolve","startComponentsFromRegistry","gondelComponentRegistry","domContext","gondelDomNodeList","Array","prototype","call","querySelectorAll","hasAttribute","push","pristineGondelDomNodes","filter","gondelDomNode","hasOwnProperty","internalGondelAsyncRefAttribute","bootingDeferred","forEach","domNode","bootingFlag","registry","componentNameHelper","gondelComponents","map","componentName","getAttribute","GondelComponent","getComponent","undefined","componentInstance","stop","internalStopMethod","internalGondelRefAttribute","_stopped","bind","constructComponent","newComponentNames","Object","keys","_activeComponents","setActiveState","gondelComponentStartPromise","all","startConstructedComponent","then","sync","start","length","reject","_componentRegistries","GLOBAL_GONDEL_REGISTRY_NAMESPACE","GondelComponentRegistry","_components","_bootMode","registerComponent","unregisterComponent","isActive","setBootMode","bootMode","getComponentRegistry","boot","documentElement","readyState","addEventListener","args","arguments","nodeType","hasMountedGondelComponent","getComponentByDomNode","firstNode","nodeName","findComponents","components","attribute","nodes","i","node","gondelComponentInstance","_domEventRegistry","eventNameMapping","focus","blur","matchesCssSelector","element","selector","elementPrototype","Element","elementMatches","matches","matchesSelector","mozMatchesSelector","msMatchesSelector","webkitMatchesSelector","handleEvent","attributeName","eventHandlerRegistry","handlers","eventObjectRequiresCleanup","results","cancelBubble","handlerObject","handlerOptions","ctx","defineProperty","value","configurable","j","handlerResult","handlerName","currentTarget","executeHandlers","parents","startElement","parentElement","getParentElements","selectorsOfFoundComponents","parent","index","handlerQueue","_a","selectorName","sort","handlerA","handlerB","getHandlers","getEventRegistry","addRootEventListener","domEventName","gondelComponentName","handlerOption","namespacedDomEventRegistry","eventRegistry","isNativeEvent","selectorKey","assign","areEventsHookedIntoCore","hookEventDecoratorInCore","componentEventOptions","__events","eventOptions","removeRootEventListernerForComponent","GondelBaseComponent","unshift","constructor","handler","substr"],"mappings":"yLAAA,IAAIA,EAAqB,SAAUC,EAAQC,EAAMC,GAAQ,OAAOA,EAAKF,IAE1DG,EAAeC,OAAOC,sBAAwB,GAElD,SAASC,EAAsBC,EAAWC,EAAcP,EAAMQ,GACjE,IACIC,EADAC,GAAY,EAUhB,IANCR,EAAaI,IAAcR,GAAoBS,EAAcP,EAAM,SAAUW,GAC1ED,GAAY,EACZD,EAAiBD,EAAWA,EAASG,GAAmBA,KAIvDD,EACD,MAAM,IAAIE,MAAM,yBAEpB,OAAOH,EAeJ,SAASI,EAA6BP,EAAWQ,GAC/CZ,EAAaI,KACdJ,EAAaI,GAAaR,GAE9B,IAAIiB,EAAuBb,EAAaI,GACxCJ,EAAaI,GAAa,SAAsBP,EAAQC,EAAMC,GAC1Dc,EAAqBhB,EAAQC,EAAM,SAAwBgB,EAAgBC,EAAGC,GAC1EJ,EAAsBE,EAAgBhB,EAAM,SAAkBD,GAC1DE,EAAKF,EAAQC,EAAMkB,QCrC5B,SAASC,EAAmBb,EAAWc,EAAiBC,EAAQC,EAAWC,QAC5D,IAAdD,IAAwBA,EAAY,SACtB,IAAdC,IAAwBA,GAAY,GACxC,IAAIC,EAAQC,SAASC,YAAY,SAC7BC,EAAcN,EAASO,EAAgBP,GAAUD,EAAgBS,KACrE,GAAIvB,EAAU,KAAOc,E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QC,OAAO,EAAG,GAClB,MAAM,IAAInL,MAAM,yBAA2BkL,EAAU,WAAaA,EAAU,cAE3EzK,EAAOmK,WACRnK,EAAOmK,SAAW,IAEtBnK,EAAOmK,SAAShI,KAAK,CAAClD,EAAWwL,EAAS5D"} \ No newline at end of file +{"version":3,"file":"gondel.es5.min.js","sources":["GondelPluginUtils.js","GondelEventEmitter.js","GondelComponentStarter.js","GondelComponentRegistry.js","GondelAutoStart.js","GondelDomUtils.js","GondelEventRegistry.js","GondelDecorators.js","GondelComponent.js"],"sourcesContent":["var basePluginListener = function (result, data, next) { return next(result); };\n// Global plugin events registry\nexport var pluginEvents = window.__gondelPluginEvents || {};\nwindow.__gondelPluginEvents = pluginEvents;\nexport function fireGondelPluginEvent(eventName, initialValue, data, callback) {\n var isSyncron = false;\n var callbackResult;\n // Execute all bound events for the given name\n // if they exist\n (pluginEvents[eventName] || basePluginListener)(initialValue, data, function (processedResult) {\n isSyncron = true;\n callbackResult = callback ? callback(processedResult) : processedResult;\n });\n // Add a guard to prevent asyncron plugin listeners\n // to simplify the usage of fireGondelPluginEvent\n if (!isSyncron) {\n throw new Error(\"Async plugin listener\");\n }\n return callbackResult;\n}\n/**\n * Fire an async event which allows gondel plugins to add features to gondel\n */\nexport function fireAsyncGondelPluginEvent(eventName, initialValue, data) {\n return new Promise(function (resolve) {\n (pluginEvents[eventName] || basePluginListener)(initialValue, data, function (result) {\n resolve(result);\n });\n });\n}\n/**\n * Allow plugins to hook into the gondel event system\n */\nexport function addGondelPluginEventListener(eventName, eventListenerCallback) {\n if (!pluginEvents[eventName]) {\n pluginEvents[eventName] = basePluginListener;\n }\n var previousEventHandler = pluginEvents[eventName];\n pluginEvents[eventName] = function wrapCallback(result, data, next) {\n previousEventHandler(result, data, function callNextPlugin(modifiedResult, _, firstNext) {\n eventListenerCallback(modifiedResult, data, function bindData(result) {\n next(result, data, firstNext);\n });\n });\n };\n}\n//# sourceMappingURL=GondelPluginUtils.js.map","import { getFirstDomNode } from \"./GondelDomUtils\";\n/**\n * Submit an event which might be caught by foreign gondel, angular or react components\n */\nexport function triggerPublicEvent(eventName, gondelComponent, target, eventData, canBubble) {\n if (eventData === void 0) { eventData = {}; }\n if (canBubble === void 0) { canBubble = true; }\n var event = document.createEvent(\"Event\");\n var eventTarget = target ? getFirstDomNode(target) : gondelComponent._ctx;\n if (eventName[0] !== gondelComponent._namespace) {\n throw new Error(\"Invalid event name '\" +\n eventName +\n \"' - use '\" +\n gondelComponent._namespace +\n eventName.charAt(0).toUpperCase() +\n eventName.slice(1) +\n \"'\");\n }\n event.initEvent(eventName, canBubble, true);\n event.data = {\n component: gondelComponent,\n name: gondelComponent._componentName,\n namespace: gondelComponent._namespace,\n eventData: eventData\n };\n return eventTarget.dispatchEvent(event);\n}\n//# sourceMappingURL=GondelEventEmitter.js.map","import { internalGondelAsyncRefAttribute, internalGondelRefAttribute } from \"./GondelDomUtils\";\nimport { triggerPublicEvent } from \"./GondelEventEmitter\";\nimport { fireGondelPluginEvent } from \"./GondelPluginUtils\";\nvar noop = function () { };\nvar Deferred = function () {\n var _this = this;\n this.promise = new Promise(function (resolve) {\n _this.resolve = resolve;\n });\n};\n/**\n * Start all components of the gondel component registry\n * for the given dom context\n */\nexport function startComponentsFromRegistry(gondelComponentRegistry, domContext, namespace) {\n // Get an array of all nodes which match the namespace\n var gondelDomNodeList = Array.prototype.slice.call(domContext.querySelectorAll(\"[data-\" + namespace + \"-name]\"));\n if (domContext.hasAttribute(\"data-\" + namespace + \"-name\")) {\n gondelDomNodeList.push(domContext);\n }\n // Remove already booted nodes\n var pristineGondelDomNodes = gondelDomNodeList.filter(function (gondelDomNode) {\n return isPristineGondelDomNode(gondelDomNode, namespace);\n });\n var bootingDeferred = new Deferred();\n // Mark all nodes as booting\n pristineGondelDomNodes.forEach(function (gondelDomNode) {\n attachGondelBootingFlag(gondelDomNode, bootingDeferred.promise, namespace);\n });\n // Create instances\n var gondelComponents = fireGondelPluginEvent(\"boot\", pristineGondelDomNodes, { namespace: namespace }, function (pristineGondelDomNodes) {\n return pristineGondelDomNodes.map(function (gondelDomNode) {\n return constructComponent(gondelDomNode, gondelComponentRegistry, namespace);\n });\n });\n // Get all component names\n var newComponentNames = getNewComponents(gondelComponents, gondelComponentRegistry);\n newComponentNames.forEach(function (componentName) {\n return gondelComponentRegistry.setActiveState(componentName, true);\n });\n // Start all components\n var gondelComponentStartPromise = fireGondelPluginEvent(\"start\", gondelComponents, { newComponentNames: newComponentNames, namespace: namespace, gondelComponentRegistry: gondelComponentRegistry }, function (gondelComponents) {\n // Wait for async started components\n return Promise.all(gondelComponents.map(startConstructedComponent));\n })\n // Let all plugins know that the components are now all ready to use\n .then(function () {\n gondelComponents.forEach(function (gondelComponent) {\n if (gondelComponent.sync) {\n gondelComponent.sync();\n }\n });\n return fireGondelPluginEvent(\"sync\", gondelComponents, { namespace: namespace });\n });\n // Resolve the booting deferred\n gondelComponentStartPromise\n .then(bootingDeferred.resolve, bootingDeferred.resolve)\n // Rethrow errors (if any)\n // otherwise the browser dev tools won't show\n // important bootstrap errors\n .then(function () { return gondelComponentStartPromise; });\n // Return a promise of all started components\n return gondelComponentStartPromise;\n}\n/**\n * Returns true if the given domNode is neither booting nor booted\n */\nexport function isPristineGondelDomNode(domNode, namespace) {\n return !domNode.hasOwnProperty(internalGondelAsyncRefAttribute + namespace);\n}\n/**\n * Mark the given dom node as controlled by gondel\n */\nexport function attachGondelBootingFlag(domNode, bootingFlag, namespace) {\n // The name `A` mean async\n // to allow waiting for asyncronous booted components\n domNode[internalGondelAsyncRefAttribute + namespace] = bootingFlag;\n}\n/**\n * Constructs a new component\n */\nexport function constructComponent(domNode, gondelComponentRegistry, namespace) {\n var componentName = domNode.getAttribute(\"data-\" + namespace + \"-name\");\n var GondelComponent = gondelComponentRegistry.getComponent(componentName);\n if (GondelComponent === undefined) {\n throw new Error(\"Failed to boot component - \" + componentName + \" is not registred\");\n }\n var componentInstance = new GondelComponent(domNode, componentName);\n componentInstance._ctx = domNode;\n componentInstance._namespace = namespace;\n componentInstance._componentName = componentName;\n // Add stop method\n componentInstance.stop = stopStartedComponent.bind(null, componentInstance, componentInstance.stop || noop, namespace);\n // Create a circular reference which will allow access to the componentInstance from ctx\n domNode[\"_gondel_\" + namespace] = componentInstance;\n return componentInstance;\n}\n/**\n * Start a component after it was constructed\n */\nexport function startConstructedComponent(component) {\n // Skip if the start method is missing\n if (!component.start) {\n return;\n }\n var expectsNoArguments = component.start.length === 0;\n // Start the component and expect a promise or a syncronous return value\n // if the function expects no arguments\n if (expectsNoArguments) {\n return component.start();\n }\n return new Promise(function (resolve, reject) { return component.start(resolve, reject); });\n}\n/**\n * Stops a started component\n */\nexport function stopStartedComponent(component, internalStopMethod, namespace) {\n triggerPublicEvent(namespace + \"Stop\", component, component._ctx);\n // Remove the component instance from the html element\n delete component._ctx[internalGondelRefAttribute + namespace];\n delete component._ctx[internalGondelAsyncRefAttribute + namespace];\n component._stopped = true;\n fireGondelPluginEvent(\"stop\", component, { namespace: namespace }, internalStopMethod.bind(component));\n}\n/**\n * Filters the given component list and returns the names of those components which have never been started before\n */\nfunction getNewComponents(components, registry) {\n var componentNameHelper = {};\n components.forEach(function (component) { return (componentNameHelper[component._componentName] = true); });\n var componentNames = Object.keys(componentNameHelper);\n return componentNames.filter(function (componentName) { return !registry._activeComponents[componentName]; });\n}\n//# sourceMappingURL=GondelComponentStarter.js.map","import { fireGondelPluginEvent } from \"./GondelPluginUtils\";\nimport { addRegistryToBootloader } from \"./GondelAutoStart\";\nvar GLOBAL_GONDEL_REGISTRY_NAMESPACE = \"__\\ud83d\\udea1Registries\";\nvar GondelComponentRegistry = /** @class */ (function () {\n function GondelComponentRegistry() {\n this._components = {};\n this._activeComponents = {};\n this._bootMode = 2 /* onDomReady */;\n }\n GondelComponentRegistry.prototype.registerComponent = function (name, gondelComponent) {\n this._components[name] = gondelComponent;\n };\n GondelComponentRegistry.prototype.unregisterComponent = function (name) {\n delete this._components[name];\n };\n GondelComponentRegistry.prototype.getComponent = function (name) {\n return this._components[name];\n };\n /**\n * Set if a component is used\n */\n GondelComponentRegistry.prototype.setActiveState = function (name, isActive) {\n this._activeComponents[name] = isActive;\n };\n GondelComponentRegistry.prototype.setBootMode = function (bootMode) {\n this._bootMode = bootMode;\n };\n return GondelComponentRegistry;\n}());\nexport { GondelComponentRegistry };\nvar _componentRegistries;\nexport function getComponentRegistry(namespace) {\n if (!_componentRegistries) {\n _componentRegistries = window[GLOBAL_GONDEL_REGISTRY_NAMESPACE] || {};\n window[GLOBAL_GONDEL_REGISTRY_NAMESPACE] = _componentRegistries;\n }\n if (!_componentRegistries[namespace]) {\n _componentRegistries[namespace] = new GondelComponentRegistry();\n addRegistryToBootloader(namespace);\n }\n return _componentRegistries[namespace];\n}\nexport function registerComponent() {\n var args = arguments;\n // The componentName is always the first argument\n var componentName = args[0];\n // Use namespace from the second argument or fallback to the default \"g\" if it is missing\n var namespace = typeof args[1] === \"string\" ? args[1] : \"g\";\n // The last argument is always the component class\n var component = args[args.length - 1];\n var gondelComponentRegistry = getComponentRegistry(namespace);\n // If this component was already registered we remove the previous one\n // and notify all plugins - this is especially usefull for hot component replacement\n if (gondelComponentRegistry.getComponent(componentName)) {\n fireGondelPluginEvent(\"unregister\", component, { componentName: componentName, namespace: namespace });\n }\n // Let plugins know about the new component\n fireGondelPluginEvent(\"register\", component, {\n componentName: componentName,\n namespace: namespace,\n gondelComponentRegistry: gondelComponentRegistry\n }, function (component) {\n gondelComponentRegistry.registerComponent(componentName, component);\n });\n}\n//# sourceMappingURL=GondelComponentRegistry.js.map","import { getComponentRegistry } from \"./GondelComponentRegistry\";\nimport { startComponentsFromRegistry } from \"./GondelComponentStarter\";\n/**\n * By default Gondel will run startComponents on DOMContentLoaded\n * To gain more controll over the boot behaviour tihs function can be called\n * to disable the auto start\n */\nexport function disableAutoStart(namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n getComponentRegistry(namespace).setBootMode(1 /* manual */);\n}\n/**\n * Wait for document ready and boot the registry\n */\nexport function addRegistryToBootloader(namespace) {\n // Use new Promise to wait for the next tick\n var boot = function () {\n Promise.resolve().then(function () {\n var gondelComponentRegistry = getComponentRegistry(namespace);\n if (gondelComponentRegistry._bootMode === 2 /* onDomReady */) {\n gondelComponentRegistry.setBootMode(0 /* alreadyBooted */);\n startComponentsFromRegistry(gondelComponentRegistry, document.documentElement, namespace);\n }\n });\n };\n // Boot if document is complete or once it completes\n if (document.readyState == \"complete\") {\n boot();\n }\n else {\n document.addEventListener(\"DOMContentLoaded\", boot, false);\n }\n}\n//# sourceMappingURL=GondelAutoStart.js.map","import { getComponentRegistry } from \"./GondelComponentRegistry\";\nimport { startComponentsFromRegistry } from \"./GondelComponentStarter\";\nexport var internalGondelRefAttribute = \"_gondel_\";\nexport var internalGondelAsyncRefAttribute = \"_gondelA_\";\n/**\n * Returns true if the given object is a single Element\n */\nfunction isElement(domNode) {\n return domNode.nodeType !== undefined;\n}\n/**\n * This function normalizes takes one of the following:\n * + document query result\n * + dom node array\n * + jquery object\n * + a single dom node\n * and turns it into a single dom node\n */\nexport function getFirstDomNode(domNode) {\n if (isElement(domNode)) {\n return domNode;\n }\n return domNode[0];\n}\n/**\n * Start all nodes in the given context\n */\nexport function startComponents(domContext, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var registry = getComponentRegistry(namespace);\n return startComponentsFromRegistry(registry, domContext ? getFirstDomNode(domContext) : document.documentElement, namespace);\n}\n/**\n * Stop all nodes in the given context\n */\nexport function stopComponents(domContext, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var components = findComponents(domContext, undefined, namespace);\n if (domContext && hasMountedGondelComponent(domContext)) {\n components.unshift(getComponentByDomNode(domContext));\n }\n components.forEach(function (component) { return component.stop(); });\n}\n/**\n * Checks if a component is mounted on a certain DOM node\n */\nexport function hasMountedGondelComponent(domNode, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var gondelComponent = firstNode[internalGondelRefAttribute + namespace];\n if (!gondelComponent || !gondelComponent._ctx) {\n // no anchor prop found or ctx missing. function is needed\n // that we can type the `getComponentByDomNode` without possible\n // returnal of undefined.\n return false;\n }\n return true;\n}\n/**\n * Returns the gondel instance for the given HtmlELement\n */\nexport function getComponentByDomNode(domNode, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var gondelComponent = firstNode[internalGondelRefAttribute + namespace];\n // Stop if this dom node is not known to gondel\n if (gondelComponent && gondelComponent._ctx) {\n return gondelComponent;\n }\n throw new Error(\"Could not find any gondel component under \" + firstNode.nodeName + \" in namespace \\\"\" + namespace + \"\\\",\\n please check if your component is mounted via 'hasMountedGondelComponent'\");\n}\n/**\n * Returns the gondel instance for the given HtmlELement once it is booted\n */\nexport function getComponentByDomNodeAsync(domNode, namespace) {\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var gondelComponent = firstNode[internalGondelAsyncRefAttribute + namespace];\n // Stop if this dom node is not known to gondel\n if (!gondelComponent) {\n return Promise.reject(undefined);\n }\n // or the component is already booted up return it\n if (gondelComponent._ctx) {\n return Promise.resolve(gondelComponent);\n }\n // Wait the component to boot up and return it\n return gondelComponent.then(function () { return firstNode[internalGondelRefAttribute + namespace]; });\n}\n/**\n * Returns all components inside the given node\n */\nexport function findComponents(domNode, componentName, namespace) {\n if (domNode === void 0) { domNode = document.documentElement; }\n if (namespace === void 0) { namespace = \"g\"; }\n var firstNode = getFirstDomNode(domNode);\n var components = [];\n var attribute = \"_gondel_\" + namespace;\n var nodes = firstNode.querySelectorAll(\"[data-\" + namespace + \"-name\" + (componentName ? \"=\\\"\" + componentName + \"\\\"\" : \"\") + \"]\");\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n var gondelComponentInstance = node[attribute];\n // Verify that the component is fully booted\n if (gondelComponentInstance && gondelComponentInstance._ctx === node) {\n components.push(gondelComponentInstance);\n }\n }\n return components;\n}\n//# sourceMappingURL=GondelDomUtils.js.map","/**\n * The event registry provides a way to bind events ahead of time\n * with a very small foot print during launch to improve the time to interaction\n */\nimport { getComponentByDomNode } from \"./GondelDomUtils\";\nimport { fireGondelPluginEvent } from \"./GondelPluginUtils\";\n/**\n * Only real browser events are supported.\n * Unfortunately focus and blur do not bubble so a special mapping is needed.\n */\nvar eventNameMapping = {\n focus: \"focusin\",\n blur: \"focusout\"\n};\n// Polyfill for element.prototype.matches\nvar matchesCssSelector = function (element, selector) {\n var elementPrototype = window.Element.prototype;\n /* istanbul ignore next : Browser polyfill can't be tested */\n var elementMatches = elementPrototype.matches ||\n elementPrototype.matchesSelector ||\n elementPrototype.mozMatchesSelector ||\n elementPrototype.msMatchesSelector ||\n elementPrototype.webkitMatchesSelector;\n // Cache the function and call it\n return (matchesCssSelector = function (element, selector) {\n return elementMatches.call(element, selector);\n })(element, selector);\n};\nfunction getParentElements(startElement) {\n var nodes = [];\n for (var element = startElement; element; element = element.parentElement) {\n nodes.push(element);\n }\n return nodes;\n}\n/**\n * Returns an array of all handlers which would apply for the current target\n */\nexport function getHandlers(attributeName, eventHandlerRegistry, target) {\n var parents = getParentElements(target);\n // Find all selectors which have been registred for this event type\n // and which have a gondel component in one of the parrent nodes\n var selectorsOfFoundComponents = [];\n parents.forEach(function (parent, i) {\n var componentName = parent.getAttribute(attributeName);\n var handlers = componentName && eventHandlerRegistry[componentName];\n if (handlers) {\n // Store the index where the component was found to know in which part\n // of the dom tree the selectors could be found\n selectorsOfFoundComponents.push({ index: i, handlers: handlers });\n }\n });\n // Iterate over all possible selectors to find out if the current event\n // should fire any gondel handler\n var handlerQueue = [];\n selectorsOfFoundComponents.forEach(function (_a) {\n var index = _a.index, handlers = _a.handlers;\n var selectorNames = Object.keys(handlers);\n selectorNames.forEach(function (selectorName) {\n // If no selector is given the handler does always match\n if (!selectorName) {\n return handlerQueue.push({\n index: index,\n ctx: parents[index],\n target: parents[index],\n handlerOptions: handlers[selectorName]\n });\n }\n // Iterate backwards over the children of the component to find an element\n // which matches the selector for the current handler\n for (var i = index; --i >= 0;) {\n if (matchesCssSelector(parents[i], selectorName)) {\n return handlerQueue.push({\n index: i,\n ctx: parents[index],\n target: parents[i],\n handlerOptions: handlers[selectorName]\n });\n }\n }\n });\n });\n // Break if we couldn't find any matching element\n if (handlerQueue.length === 0) {\n return [];\n }\n // Sort the queue so events which are further up the dom are fired first\n handlerQueue.sort(function (handlerA, handlerB) {\n return handlerA.index > handlerB.index ? 1 : handlerA.index === handlerB.index ? 0 : -1;\n });\n return handlerQueue;\n}\n/**\n * The handler which will catch every event at the documentElement\n */\nfunction handleEvent(namespace, attributeName, eventHandlerRegistry, event) {\n var target = event.target;\n var handlers = getHandlers(attributeName, eventHandlerRegistry, target);\n executeHandlers(handlers, event, namespace);\n}\nvar _domEventRegistry;\n/**\n * Returns the namespace registry for the given namespace..\n * This function must be used only by core or plugins\n */\nexport function getEventRegistry(namespace) {\n if (!_domEventRegistry) {\n _domEventRegistry = window[\"__\\ud83d\\udea1DomEvents\"] || {};\n window[\"__\\ud83d\\udea1DomEvents\"] = _domEventRegistry;\n }\n if (!_domEventRegistry[namespace]) {\n _domEventRegistry[namespace] = {};\n }\n return _domEventRegistry[namespace];\n}\n/**\n * Notify components\n * This function must be used by core or only by plugins\n */\nexport function executeHandlers(handlers, event, namespace) {\n /** Store wether the original Event was modified to provide the correct currentTarget */\n var eventObjectRequiresCleanup = false;\n /** Store optional callback results which are executed together to allow grouped redraws */\n var results = [];\n for (var i = 0; i < handlers.length && !event.cancelBubble; i++) {\n var handlerObject = handlers[i];\n var handlerOptions = handlerObject.handlerOptions;\n var gondelComponent = getComponentByDomNode(handlerObject.ctx, namespace);\n // Skip if the component wasn't started or if it was stopped\n if (gondelComponent) {\n // See https://stackoverflow.com/questions/52057726/what-is-the-best-way-to-alter-a-native-browser-event\n Object.defineProperty(event, \"currentTarget\", {\n value: handlerObject.target,\n configurable: true\n });\n eventObjectRequiresCleanup = true;\n for (var j = 0; j < handlerOptions.length && !event.cancelBubble; j++) {\n var handlerResult = gondelComponent[handlerOptions[j].handlerName].call(gondelComponent, event);\n if (typeof handlerResult === \"function\") {\n results.push(handlerResult);\n }\n }\n }\n }\n // Execute all callbacks to allow grouping write events\n results.forEach(function (result) {\n result();\n });\n // Cleanup the event object\n if (eventObjectRequiresCleanup) {\n // See https://stackoverflow.com/questions/52057726/what-is-the-best-way-to-alter-a-native-browser-event\n delete event.currentTarget;\n }\n}\n/**\n * Add a event lister to the element\n * The listener will always call handleEvent with the domEventRegistry for the given event\n */\nfunction startListeningForEvent(eventName, namespace) {\n document.documentElement.addEventListener(eventNameMapping[eventName] || eventName, handleEvent.bind(null, namespace, \"data-\" + namespace + \"-name\", getEventRegistry(namespace)[eventName]));\n}\n/**\n * Add an event to the Gondel EventRegistry\n */\nexport function addRootEventListener(namespace, domEventName, gondelComponentName, handlerName, handlerOption) {\n // Create namespace if neededi\n var namespacedDomEventRegistry = getEventRegistry(namespace);\n // Notify all plugins to allow taking over the event handling for a specific event name\n // This notification is only triggered if a event name e.g. 'click' is used for the first time\n if (!namespacedDomEventRegistry[domEventName]) {\n namespacedDomEventRegistry[domEventName] = {};\n fireGondelPluginEvent(\"registerEvent\", true, {\n eventName: domEventName,\n namespace: namespace,\n eventRegistry: namespacedDomEventRegistry[domEventName]\n }, function (isNativeEvent) {\n // If no plugin registered the event\n // register a native browser event\n if (isNativeEvent) {\n startListeningForEvent(domEventName, namespace);\n }\n });\n }\n if (!namespacedDomEventRegistry[domEventName][gondelComponentName]) {\n namespacedDomEventRegistry[domEventName][gondelComponentName] = {};\n }\n var handlerOptionObject = typeof handlerOption === \"object\" ? handlerOption : { selector: handlerOption };\n var selectorKey = handlerOptionObject.selector || \"\";\n if (!namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey]) {\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey] = [];\n }\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey].push(Object.assign({ handlerName: handlerName, handlerOption: handlerOption }));\n}\n/**\n * Remove an event from the Gondel EventRegistry\n */\nexport function removeRootEventListener(namespace, domEventName, gondelComponentName, handlerName, selector) {\n var selectorKey = selector || \"\";\n var namespacedDomEventRegistry = getEventRegistry(namespace);\n if (namespacedDomEventRegistry[domEventName] &&\n namespacedDomEventRegistry[domEventName][gondelComponentName] &&\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey]) {\n namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey] = namespacedDomEventRegistry[domEventName][gondelComponentName][selectorKey].filter(function (handlerOption) {\n return handlerOption.handlerName !== handlerName || handlerName === undefined;\n });\n }\n}\n/**\n * Remove all events for a given Component (e.g. a Button) from the Gondel EventRegistry\n */\nexport function removeRootEventListernerForComponent(namespace, gondelComponentName) {\n var namespacedDomEventRegistry = getEventRegistry(namespace);\n for (var eventName in namespacedDomEventRegistry) {\n /* istanbul ignore else: for in savety check */\n if (namespacedDomEventRegistry.hasOwnProperty(eventName)) {\n delete namespacedDomEventRegistry[eventName][gondelComponentName];\n }\n }\n}\n//# sourceMappingURL=GondelEventRegistry.js.map","import { addRootEventListener, removeRootEventListernerForComponent } from \"./GondelEventRegistry\";\n// Because of how decorators work @EventListeners is executed before the class is registred\n// so we need to provide a hrm compatible approch initialize and reinitialize the events\nimport { addGondelPluginEventListener } from \"./GondelPluginUtils\";\nimport { registerComponent } from \"./index\";\nexport function Component(componentName, namespace) {\n return function (constructor) {\n registerComponent(componentName, namespace, constructor);\n };\n}\nvar areEventsHookedIntoCore = false;\nfunction hookEventDecoratorInCore() {\n areEventsHookedIntoCore = true;\n addGondelPluginEventListener(\"register\", function (component, _a, next) {\n var componentName = _a.componentName, namespace = _a.namespace, gondelComponentRegistry = _a.gondelComponentRegistry;\n // Only apply in case the component is already active in the DOM\n // this will only happen during hot module replacement\n if (!gondelComponentRegistry._activeComponents[componentName]) {\n return next(component);\n }\n // The decorator will store the event information in two different places.\n // For ES6 classes it is using __events\n // For ES5 prototype classes and transpiled ES6 classes it is using prototype.__events\n var componentEventOptions = (component.prototype && component.prototype.__events) || component.__events;\n if (componentEventOptions) {\n componentEventOptions.forEach(function (eventOptions) {\n addRootEventListener(namespace, \n /* event name: */ eventOptions[0], componentName, \n /* handler: */ eventOptions[1], \n /* selector: */ eventOptions[2]);\n });\n }\n next(component);\n });\n addGondelPluginEventListener(\"unregister\", function (component, _a, next) {\n var componentName = _a.componentName, namespace = _a.namespace;\n removeRootEventListernerForComponent(namespace, componentName);\n next(component);\n });\n addGondelPluginEventListener(\"start\", function (gondelComponents, _a, next) {\n var newComponentNames = _a.newComponentNames, gondelComponentRegistry = _a.gondelComponentRegistry, namespace = _a.namespace;\n newComponentNames.forEach(function (componentName) {\n var gondelComponent = gondelComponentRegistry.getComponent(componentName);\n // The decorator will store the event information in two different places.\n // For ES6 classes it is using __events\n // For ES5 prototype classes and transpiled ES6 classes it is using prototype.__events\n var componentEventOptions = (gondelComponent.prototype && gondelComponent.prototype.__events) ||\n gondelComponent.__events;\n if (componentEventOptions) {\n componentEventOptions.forEach(function (eventOptions) {\n addRootEventListener(namespace, \n /* event name: */ eventOptions[0], componentName, \n /* handler: */ eventOptions[1], \n /* selector: */ eventOptions[2]);\n });\n }\n });\n next(gondelComponents);\n });\n}\n/**\n * The @EventListener decorator will add all event names to a static variable\n */\nexport function EventListener(eventName, selector) {\n return function (target, handler) {\n if (!areEventsHookedIntoCore) {\n hookEventDecoratorInCore();\n }\n if (handler.substr(0, 1) !== \"_\") {\n throw new Error(\"Invalid handler name '\" + handler + \"' use '_\" + handler + \"' instead.\");\n }\n if (!target.__events) {\n target.__events = [];\n }\n target.__events.push([eventName, handler, selector]);\n };\n}\n//# sourceMappingURL=GondelDecorators.js.map","var GondelBaseComponent = /** @class */ (function () {\n function GondelBaseComponent(domNode, componentName) {\n }\n /**\n * Stop method\n */\n GondelBaseComponent.prototype.stop = function () { };\n return GondelBaseComponent;\n}());\nexport { GondelBaseComponent };\n//# sourceMappingURL=GondelComponent.js.map"],"names":["basePluginListener","result","data","next","pluginEvents","window","__gondelPluginEvents","fireGondelPluginEvent","eventName","initialValue","callback","callbackResult","isSyncron","processedResult","Error","addGondelPluginEventListener","eventListenerCallback","previousEventHandler","modifiedResult","_","firstNext","triggerPublicEvent","gondelComponent","target","eventData","canBubble","event","document","createEvent","eventTarget","getFirstDomNode","_ctx","_namespace","charAt","toUpperCase","slice","initEvent","component","name","_componentName","namespace","dispatchEvent","noop","Deferred","_this","this","promise","Promise","resolve","startComponentsFromRegistry","gondelComponentRegistry","domContext","gondelDomNodeList","Array","prototype","call","querySelectorAll","hasAttribute","push","pristineGondelDomNodes","filter","gondelDomNode","hasOwnProperty","internalGondelAsyncRefAttribute","bootingDeferred","forEach","domNode","bootingFlag","registry","componentNameHelper","gondelComponents","map","componentName","getAttribute","GondelComponent","getComponent","undefined","componentInstance","stop","internalStopMethod","internalGondelRefAttribute","_stopped","bind","constructComponent","newComponentNames","Object","keys","_activeComponents","setActiveState","gondelComponentStartPromise","all","startConstructedComponent","then","sync","start","length","reject","_componentRegistries","GLOBAL_GONDEL_REGISTRY_NAMESPACE","GondelComponentRegistry","_components","_bootMode","registerComponent","unregisterComponent","isActive","setBootMode","bootMode","getComponentRegistry","boot","documentElement","readyState","addEventListener","args","arguments","nodeType","hasMountedGondelComponent","getComponentByDomNode","firstNode","nodeName","findComponents","components","attribute","nodes","i","node","gondelComponentInstance","_domEventRegistry","eventNameMapping","focus","blur","matchesCssSelector","element","selector","elementPrototype","Element","elementMatches","matches","matchesSelector","mozMatchesSelector","msMatchesSelector","webkitMatchesSelector","handleEvent","attributeName","eventHandlerRegistry","handlers","eventObjectRequiresCleanup","results","cancelBubble","handlerObject","handlerOptions","ctx","defineProperty","value","configurable","j","handlerResult","handlerName","currentTarget","executeHandlers","parents","startElement","parentElement","getParentElements","selectorsOfFoundComponents","parent","index","handlerQueue","_a","selectorName","sort","handlerA","handlerB","getHandlers","getEventRegistry","addRootEventListener","domEventName","gondelComponentName","handlerOption","namespacedDomEventRegistry","eventRegistry","isNativeEvent","selectorKey","assign","areEventsHookedIntoCore","hookEventDecoratorInCore","componentEventOptions","__events","eventOptions","removeRootEventListernerForComponent","GondelBaseComponent","unshift","constructor","handler","substr"],"mappings":"yLAAA,IAAIA,EAAqB,SAAUC,EAAQC,EAAMC,GAAQ,OAAOA,EAAKF,IAE1DG,EAAeC,OAAOC,sBAAwB,GAElD,SAASC,EAAsBC,EAAWC,EAAcP,EAAMQ,GACjE,IACIC,EADAC,GAAY,EAUhB,IANCR,EAAaI,IAAcR,GAAoBS,EAAcP,EAAM,SAAUW,GAC1ED,GAAY,EACZD,EAAiBD,EAAWA,EAASG,GAAmBA,KAIvDD,EACD,MAAM,IAAIE,MAAM,yBAEpB,OAAOH,EAeJ,SAASI,EAA6BP,EAAWQ,GAC/CZ,EAAaI,KACdJ,EAAaI,GAAaR,GAE9B,IAAIiB,EAAuBb,EAAaI,GACxCJ,EAAaI,GAAa,SAAsBP,EAAQC,EAAMC,GAC1Dc,EAAqBhB,EAAQC,EAAM,SAAwBgB,EAAgBC,EAAGC,GAC1EJ,EAAsBE,EAAgBhB,EAAM,SAAkBD,GAC1DE,EAAKF,EAAQC,EAAMkB,QCrC5B,SAASC,EAAmBb,EAAWc,EAAiBC,EAAQC,EAAWC,QAC5D,IAAdD,IAAwBA,EAAY,SACtB,IAAdC,IAAwBA,GAAY,GACxC,IAAIC,EAAQC,SAASC,YAAY,SAC7BC,EAAcN,EAASO,EAAgBP,GAAUD,EAAgBS,KACrE,GAAIvB,EAAU,KAAOc,EAAgBU,WACjC,MAAM,IAAIlB,MAAM,uBACZN,EACA,YACAc,EAAgBU,WAChBxB,EAAUyB,OAAO,GAAGC,cACpB1B,EAAU2B,MAAM,GAChB,KASR,OAPAT,EAAMU,UAAU5B,EAAWiB,GAAW,GACtCC,EAAMxB,KAAO,CACTmC,UAAWf,EACXgB,KAAMhB,EAAgBiB,eACtBC,UAAWlB,EAAgBU,WAC3BR,UAAWA,GAERK,EAAYY,cA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AAKmE,SCzDTuH,EAAqC,WACrC,SAASA,EAAoB3H,EAASM,IAMtC,OADAqH,EAAoBvI,UAAUwB,KAAO,aAC9B+G,+EJAJ,SAA0BrJ,QACX,IAAdA,IAAwBA,EAAY,KACxCmE,EAAqBnE,GAAWiE,YAAY,6GCkBzC,SAAyBtD,EAAYX,GAGxC,YAFkB,IAAdA,IAAwBA,EAAY,KAEjCS,EADQ0D,EAAqBnE,GACSW,EAAarB,EAAgBqB,GAAcxB,SAASkF,gBAAiBrE,qBAK/G,SAAwBW,EAAYX,QACrB,IAAdA,IAAwBA,EAAY,KACxC,IAAIgF,EAAaD,EAAepE,OAAYyB,EAAWpC,GACnDW,GAAcgE,EAA0BhE,IACxCqE,EAAWsE,QAAQ1E,EAAsBjE,IAE7CqE,EAAWvD,QAAQ,SAAU5B,GAAa,OAAOA,EAAUyC,+FAiCxD,SAAoCZ,EAAS1B,QAC9B,IAAdA,IAAwBA,EAAY,KACxC,IAAI6E,EAAYvF,EAAgBoC,GAC5B5C,EAAkB+F,EAAUtD,EAAkCvB,GAElE,OAAKlB,EAIDA,EAAgBS,KACTgB,QAAQC,QAAQ1B,GAGpBA,EAAgBsE,KAAK,WAAc,OAAOyB,EAAUrC,EAA6BxC,KAP7EO,QAAQiD,YAAOpB,mCE3EvB,SAAmBJ,EAAehC,GACrC,OAAO,SAAUuJ,GACbzF,EAAkB9B,EAAehC,EAAWuJ,qBAwD7C,SAAuBvL,EAAW4H,GACrC,OAAO,SAAU7G,EAAQyK,GAIrB,GAHKT,GACDC,IAEyB,MAAzBQ,EAAQC,OAAO,EAAG,GAClB,MAAM,IAAInL,MAAM,yBAA2BkL,EAAU,WAAaA,EAAU,cAE3EzK,EAAOmK,WACRnK,EAAOmK,SAAW,IAEtBnK,EAAOmK,SAAShI,KAAK,CAAClD,EAAWwL,EAAS5D"} \ No newline at end of file diff --git a/packages/core/src/GondelComponent.ts b/packages/core/src/GondelComponent.ts index da83c452..eee0f011 100644 --- a/packages/core/src/GondelComponent.ts +++ b/packages/core/src/GondelComponent.ts @@ -8,9 +8,9 @@ export type StartMethod = // Sync boot | (() => void); -export interface GondelComponent { +export interface GondelComponent { // The component context - _ctx: HTMLElement; + _ctx: TElement; // The namespace e.g. 'g' _namespace: string; // The componentname e.g. 'Input' @@ -25,11 +25,12 @@ export interface GondelComponent { sync?(): void; } -export class GondelBaseComponent implements GondelComponent { +export class GondelBaseComponent implements GondelComponent { + constructor(domNode: TElement, componentName: string) {} /** * The component context */ - _ctx: HTMLElement; + _ctx: TElement; /** * The namespace e.g. 'g' */ diff --git a/packages/core/src/GondelComponentStarter.test.ts b/packages/core/src/GondelComponentStarter.test.ts index c39a8401..447c8c94 100644 --- a/packages/core/src/GondelComponentStarter.test.ts +++ b/packages/core/src/GondelComponentStarter.test.ts @@ -31,8 +31,8 @@ describe("GondelComponentStarter", () => { @Component("Button") class Button extends GondelBaseComponent { _wasConstructed: boolean; - constructor() { - super(); + constructor(ctx: HTMLElement, componentName: string) { + super(ctx, componentName); this._wasConstructed = true; } } diff --git a/packages/plugins/jquery/dist/index.d.ts b/packages/plugins/jquery/dist/index.d.ts index 3898767e..a22fc556 100644 --- a/packages/plugins/jquery/dist/index.d.ts +++ b/packages/plugins/jquery/dist/index.d.ts @@ -28,6 +28,7 @@ class MyComponent extends GondelJqueryComponent { } ``` */ -export declare const GondelJqueryComponent: new (context: HTMLElement, componentName: string) => GondelBaseComponent & { - $ctx: JQuery; -}; +export declare class GondelJqueryComponent extends GondelBaseComponent { + $ctx: JQuery; + constructor(ctx: TElement, componentName: string); +} diff --git a/packages/plugins/jquery/dist/index.es5.js b/packages/plugins/jquery/dist/index.es5.js index 3b8fd788..d9dad70b 100644 --- a/packages/plugins/jquery/dist/index.es5.js +++ b/packages/plugins/jquery/dist/index.es5.js @@ -1,2 +1,2 @@ -!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("jquery")):"function"==typeof define&&define.amd?define(["exports","jquery"],t):t(n.gondelPluginJQuery={},n.$)}(this,function(n,r){"use strict";r=r&&r.hasOwnProperty("default")?r.default:r;var u=function(n,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(n,t)};var t=window.__gondelPluginEvents||{};function e(n){return function(o){function n(n,t){var e=o.call(this,n,t)||this;return e.$ctx=r(n),e}return function(n,t){function e(){this.constructor=n}u(n,t),n.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)}(n,o),n}(n)}window.__gondelPluginEvents=t;var o=e(function(){function n(){}return n.prototype.stop=function(){},n}());n.gondelJQueryMixin=e,n.GondelJqueryComponent=o,Object.defineProperty(n,"__esModule",{value:!0})}); +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("jquery")):"function"==typeof define&&define.amd?define(["exports","jquery"],n):n(t.gondelPluginJQuery={},t.$)}(this,function(t,r){"use strict";r=r&&r.hasOwnProperty("default")?r.default:r;var o=function(t,n){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)};function n(t,n){function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var e=window.__gondelPluginEvents||{};window.__gondelPluginEvents=e;var u=function(o){function t(t,n){var e=o.call(this,t,n)||this;return e.$ctx=r(t),e}return n(t,o),t}(function(){function t(t,n){}return t.prototype.stop=function(){},t}());t.gondelJQueryMixin=function(t){return function(o){function t(t,n){var e=o.call(this,t,n)||this;return e.$ctx=r(t),e}return n(t,o),t}(t)},t.GondelJqueryComponent=u,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=index.es5.js.map diff --git a/packages/plugins/jquery/dist/index.es5.js.map b/packages/plugins/jquery/dist/index.es5.js.map index 8bc39d97..4cf81977 100644 --- a/packages/plugins/jquery/dist/index.es5.js.map +++ b/packages/plugins/jquery/dist/index.es5.js.map @@ -1 +1 @@ -{"version":3,"file":"index.es5.js","sources":["../../../../node_modules/tslib/tslib.es6.js","../../../core/dist/GondelPluginUtils.js","index.js","../../../core/dist/GondelComponent.js"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","var basePluginListener = function (result, data, next) { return next(result); };\n// Global plugin events registry\nexport var pluginEvents = window.__gondelPluginEvents || {};\nwindow.__gondelPluginEvents = pluginEvents;\nexport function fireGondelPluginEvent(eventName, initialValue, data, callback) {\n var isSyncron = false;\n var callbackResult;\n // Execute all bound events for the given name\n // if they exist\n (pluginEvents[eventName] || basePluginListener)(initialValue, data, function (processedResult) {\n isSyncron = true;\n callbackResult = callback ? callback(processedResult) : processedResult;\n });\n // Add a guard to prevent asyncron plugin listeners\n // to simplify the usage of fireGondelPluginEvent\n if (!isSyncron) {\n throw new Error(\"Async plugin listener\");\n }\n return callbackResult;\n}\n/**\n * Fire an async event which allows gondel plugins to add features to gondel\n */\nexport function fireAsyncGondelPluginEvent(eventName, initialValue, data) {\n return new Promise(function (resolve) {\n (pluginEvents[eventName] || basePluginListener)(initialValue, data, function (result) {\n resolve(result);\n });\n });\n}\n/**\n * Allow plugins to hook into the gondel event system\n */\nexport function addGondelPluginEventListener(eventName, eventListenerCallback) {\n if (!pluginEvents[eventName]) {\n pluginEvents[eventName] = basePluginListener;\n }\n var previousEventHandler = pluginEvents[eventName];\n pluginEvents[eventName] = function wrapCallback(result, data, next) {\n previousEventHandler(result, data, function callNextPlugin(modifiedResult, _, firstNext) {\n eventListenerCallback(modifiedResult, data, function bindData(result) {\n next(result, data, firstNext);\n });\n });\n };\n}\n//# sourceMappingURL=GondelPluginUtils.js.map","import * as tslib_1 from \"tslib\";\n/**\n * This plugin provides utils for Gondel jQuery integrations\n */\nimport { GondelBaseComponent } from \"@gondel/core\";\nimport $ from \"jquery\";\n/**\n * Class mixin https://basarat.gitbooks.io/typescript/docs/types/mixins.html\n * Usage:\n ```\nclass MyComponent extends gondelJQueryMixin(GondelBaseComponent) {\n start() {\n console.log(this.$ctx);\n }\n}\n ```\n */\nexport function gondelJQueryMixin(BaseClass) {\n var WithJquery = /** @class */ (function (_super) {\n tslib_1.__extends(WithJquery, _super);\n function WithJquery(ctx, componentName) {\n var _this = _super.call(this, ctx, componentName) || this;\n _this.$ctx = $(ctx);\n return _this;\n }\n return WithJquery;\n }(BaseClass));\n return WithJquery;\n}\n/**\n * BaseComponent with JqueryMixin\n * Usage:\n ```\nclass MyComponent extends GondelJqueryComponent {\n start() {\n console.log(this.$ctx);\n }\n}\n ```\n */\nexport var GondelJqueryComponent = gondelJQueryMixin(GondelBaseComponent);\n//# sourceMappingURL=index.js.map","var GondelBaseComponent = /** @class */ (function () {\n function GondelBaseComponent() {\n }\n /**\n * Stop method\n */\n GondelBaseComponent.prototype.stop = function () { };\n return GondelBaseComponent;\n}());\nexport { GondelBaseComponent };\n//# sourceMappingURL=GondelComponent.js.map"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","pluginEvents","window","__gondelPluginEvents","gondelJQueryMixin","BaseClass","_super","WithJquery","ctx","componentName","_this","call","this","$ctx","$","__","constructor","prototype","create","tslib_1.__extends","GondelJqueryComponent","GondelBaseComponent","stop"],"mappings":"mRAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,MACpDN,EAAGC,IClBrB,IAAIO,EAAeC,OAAOC,sBAAwB,GCelD,SAASC,EAAkBC,GAU9B,OATgC,SAAUC,GAEtC,SAASC,EAAWC,EAAKC,GACrB,IAAIC,EAAQJ,EAAOK,KAAKC,KAAMJ,EAAKC,IAAkBG,KAErD,OADAF,EAAMG,KAAOC,EAAEN,GACRE,EAEX,OFFD,SAAmBjB,EAAGC,GAEzB,SAASqB,IAAOH,KAAKI,YAAcvB,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEwB,UAAkB,OAANvB,EAAaC,OAAOuB,OAAOxB,IAAMqB,EAAGE,UAAYvB,EAAEuB,UAAW,IAAIF,GEP3EI,CAAkBZ,EAAYD,GAMvBC,GACTF,GDvBNH,OAAOC,qBAAuBF,MCqCnBmB,EAAwBhB,ECxCM,WACrC,SAASiB,KAMT,OADAA,EAAoBJ,UAAUK,KAAO,aAC9BD"} \ No newline at end of file +{"version":3,"file":"index.es5.js","sources":["../../../../node_modules/tslib/tslib.es6.js","../../../core/dist/GondelPluginUtils.js","index.js","../../../core/dist/GondelComponent.js"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","var basePluginListener = function (result, data, next) { return next(result); };\n// Global plugin events registry\nexport var pluginEvents = window.__gondelPluginEvents || {};\nwindow.__gondelPluginEvents = pluginEvents;\nexport function fireGondelPluginEvent(eventName, initialValue, data, callback) {\n var isSyncron = false;\n var callbackResult;\n // Execute all bound events for the given name\n // if they exist\n (pluginEvents[eventName] || basePluginListener)(initialValue, data, function (processedResult) {\n isSyncron = true;\n callbackResult = callback ? callback(processedResult) : processedResult;\n });\n // Add a guard to prevent asyncron plugin listeners\n // to simplify the usage of fireGondelPluginEvent\n if (!isSyncron) {\n throw new Error(\"Async plugin listener\");\n }\n return callbackResult;\n}\n/**\n * Fire an async event which allows gondel plugins to add features to gondel\n */\nexport function fireAsyncGondelPluginEvent(eventName, initialValue, data) {\n return new Promise(function (resolve) {\n (pluginEvents[eventName] || basePluginListener)(initialValue, data, function (result) {\n resolve(result);\n });\n });\n}\n/**\n * Allow plugins to hook into the gondel event system\n */\nexport function addGondelPluginEventListener(eventName, eventListenerCallback) {\n if (!pluginEvents[eventName]) {\n pluginEvents[eventName] = basePluginListener;\n }\n var previousEventHandler = pluginEvents[eventName];\n pluginEvents[eventName] = function wrapCallback(result, data, next) {\n previousEventHandler(result, data, function callNextPlugin(modifiedResult, _, firstNext) {\n eventListenerCallback(modifiedResult, data, function bindData(result) {\n next(result, data, firstNext);\n });\n });\n };\n}\n//# sourceMappingURL=GondelPluginUtils.js.map","import * as tslib_1 from \"tslib\";\n/**\n * This plugin provides utils for Gondel jQuery integrations\n */\nimport { GondelBaseComponent } from \"@gondel/core\";\nimport $ from \"jquery\";\n/**\n * Class mixin https://basarat.gitbooks.io/typescript/docs/types/mixins.html\n * Usage:\n ```\nclass MyComponent extends gondelJQueryMixin(GondelBaseComponent) {\n start() {\n console.log(this.$ctx);\n }\n}\n ```\n */\nexport function gondelJQueryMixin(BaseClass) {\n var WithJquery = /** @class */ (function (_super) {\n tslib_1.__extends(WithJquery, _super);\n function WithJquery(ctx, componentName) {\n var _this = _super.call(this, ctx, componentName) || this;\n _this.$ctx = $(ctx);\n return _this;\n }\n return WithJquery;\n }(BaseClass));\n return WithJquery;\n}\n/**\n * BaseComponent with JqueryMixin\n * Usage:\n ```\nclass MyComponent extends GondelJqueryComponent {\n start() {\n console.log(this.$ctx);\n }\n}\n ```\n */\nvar GondelJqueryComponent = /** @class */ (function (_super) {\n tslib_1.__extends(GondelJqueryComponent, _super);\n function GondelJqueryComponent(ctx, componentName) {\n var _this = _super.call(this, ctx, componentName) || this;\n _this.$ctx = $(ctx);\n return _this;\n }\n return GondelJqueryComponent;\n}(GondelBaseComponent));\nexport { GondelJqueryComponent };\n//# sourceMappingURL=index.js.map","var GondelBaseComponent = /** @class */ (function () {\n function GondelBaseComponent(domNode, componentName) {\n }\n /**\n * Stop method\n */\n GondelBaseComponent.prototype.stop = function () { };\n return GondelBaseComponent;\n}());\nexport { GondelBaseComponent };\n//# sourceMappingURL=GondelComponent.js.map"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","pluginEvents","window","__gondelPluginEvents","GondelJqueryComponent","_super","ctx","componentName","_this","call","$ctx","$","tslib_1.__extends","GondelBaseComponent","domNode","stop","BaseClass","WithJquery"],"mappings":"mRAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,MACpDN,EAAGC,IAGrB,SAASO,EAAUR,EAAGC,GAEzB,SAASQ,IAAOC,KAAKC,YAAcX,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEY,UAAkB,OAANX,EAAaC,OAAOW,OAAOZ,IAAMQ,EAAGG,UAAYX,EAAEW,UAAW,IAAIH,GCxB5E,IAAIK,EAAeC,OAAOC,sBAAwB,GACzDD,OAAOC,qBAAuBF,MCqC1BG,EAAuC,SAAUC,GAEjD,SAASD,EAAsBE,EAAKC,GAChC,IAAIC,EAAQH,EAAOI,KAAKZ,KAAMS,EAAKC,IAAkBV,KAErD,OADAW,EAAME,KAAOC,EAAEL,GACRE,EAEX,OANAI,EAAkBR,EAAuBC,GAMlCD,GC/C8B,WACrC,SAASS,EAAoBC,EAASP,IAMtC,OADAM,EAAoBd,UAAUgB,KAAO,aAC9BF,0BDUJ,SAA2BG,GAU9B,OATgC,SAAUX,GAEtC,SAASY,EAAWX,EAAKC,GACrB,IAAIC,EAAQH,EAAOI,KAAKZ,KAAMS,EAAKC,IAAkBV,KAErD,OADAW,EAAME,KAAOC,EAAEL,GACRE,EAEX,OANAI,EAAkBK,EAAYZ,GAMvBY,GACTD"} \ No newline at end of file diff --git a/packages/plugins/jquery/dist/index.js b/packages/plugins/jquery/dist/index.js index 46946187..571bfe69 100644 --- a/packages/plugins/jquery/dist/index.js +++ b/packages/plugins/jquery/dist/index.js @@ -38,5 +38,14 @@ class MyComponent extends GondelJqueryComponent { } ``` */ -export var GondelJqueryComponent = gondelJQueryMixin(GondelBaseComponent); +var GondelJqueryComponent = /** @class */ (function (_super) { + tslib_1.__extends(GondelJqueryComponent, _super); + function GondelJqueryComponent(ctx, componentName) { + var _this = _super.call(this, ctx, componentName) || this; + _this.$ctx = $(ctx); + return _this; + } + return GondelJqueryComponent; +}(GondelBaseComponent)); +export { GondelJqueryComponent }; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/plugins/jquery/dist/index.js.map b/packages/plugins/jquery/dist/index.js.map index bc20d8ec..cfea41b5 100644 --- a/packages/plugins/jquery/dist/index.js.map +++ b/packages/plugins/jquery/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAoB,MAAM,cAAc,CAAC;AACrE,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAG/B,SAAY;IACZ;QAAyB,sCAA+B;QACtD,oBAAY,GAAgB,EAAE,aAAqB;YAAnD,YACE,kBAAM,GAAG,EAAE,aAAa,CAAC,SAE1B;YADE,KAAY,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;;QAC9B,CAAC;QACH,iBAAC;IAAD,CAAC,AALD,CAA0B,SAA8B,GAKvD;IACD,OAAO,UAAuF,CAAC;AACjG,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,IAAM,qBAAqB,GAAG,iBAAiB,CAAC,mBAAmB,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAoB,MAAM,cAAc,CAAC;AACrE,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAG/B,SAAY;IACZ;QAAyB,sCAA+B;QAEtD,oBAAY,GAAgB,EAAE,aAAqB;YAAnD,YACE,kBAAM,GAAG,EAAE,aAAa,CAAC,SAE1B;YADC,KAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;;QACrB,CAAC;QACH,iBAAC;IAAD,CAAC,AAND,CAA0B,SAA8B,GAMvD;IACD,OAAO,UAAuF,CAAC;AACjG,CAAC;AAED;;;;;;;;;;GAUG;AACH;IAAmE,iDAA6B;IAE9F,+BAAY,GAAa,EAAE,aAAqB;QAAhD,YACE,kBAAM,GAAG,EAAE,aAAa,CAAC,SAE1B;QADC,KAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;;IACrB,CAAC;IACH,4BAAC;AAAD,CAAC,AAND,CAAmE,mBAAmB,GAMrF"} \ No newline at end of file diff --git a/packages/plugins/jquery/src/index.ts b/packages/plugins/jquery/src/index.ts index 80514fd0..3e30eb36 100644 --- a/packages/plugins/jquery/src/index.ts +++ b/packages/plugins/jquery/src/index.ts @@ -20,9 +20,10 @@ export function gondelJQueryMixin< U extends new (context: HTMLElement, componentName: string) => T >(BaseClass: U) { class WithJquery extends (BaseClass as IGondelComponent) { + $ctx: JQuery; constructor(ctx: HTMLElement, componentName: string) { super(ctx, componentName); - (this as any).$ctx = $(ctx); + this.$ctx = $(ctx); } } return WithJquery as new (context: HTMLElement, componentName: string) => T & { $ctx: JQuery }; @@ -39,4 +40,10 @@ class MyComponent extends GondelJqueryComponent { } ``` */ -export const GondelJqueryComponent = gondelJQueryMixin(GondelBaseComponent); +export class GondelJqueryComponent extends GondelBaseComponent { + $ctx: JQuery; + constructor(ctx: TElement, componentName: string) { + super(ctx, componentName); + this.$ctx = $(ctx); + } +} diff --git a/packages/plugins/react/dist/index.d.ts b/packages/plugins/react/dist/index.d.ts index d9ca67e7..c47ef63f 100644 --- a/packages/plugins/react/dist/index.d.ts +++ b/packages/plugins/react/dist/index.d.ts @@ -7,7 +7,7 @@ export declare class GondelReactComponent extends GondelBaseComponent impleme _setInternalState: (config: S) => void | undefined; state: S; protected setState(state: S): void; - constructor(ctx: HTMLElement); + constructor(ctx: HTMLElement, componentName: string); /** * Called immediately before mounting occurs, and before `Component#render`. * Avoid introducing any side-effects or subscriptions in this method. diff --git a/packages/plugins/react/dist/index.js b/packages/plugins/react/dist/index.js index 40deac5a..1e29bbeb 100644 --- a/packages/plugins/react/dist/index.js +++ b/packages/plugins/react/dist/index.js @@ -24,8 +24,8 @@ function isPromise(obj) { } var GondelReactComponent = /** @class */ (function (_super) { __extends(GondelReactComponent, _super); - function GondelReactComponent(ctx) { - var _this = _super.call(this) || this; + function GondelReactComponent(ctx, componentName) { + var _this = _super.call(this, ctx, componentName) || this; // Overwrite the current start method var originalStart = _this.start; var ReactDOMPromise = import(/* webpackPrefetch: true, webpackChunkName: 'ReactDom' */ "react-dom").then(function (ReactDOM) { return ReactDOM.default; }); diff --git a/packages/plugins/react/dist/index.js.map b/packages/plugins/react/dist/index.js.map index cf1944c6..3a64f3d6 100644 --- a/packages/plugins/react/dist/index.js.map +++ b/packages/plugins/react/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sour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,KAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAI,CAAC;oBAC9E,yBAAyB,EACvB,KAAI,CAAC,yBAAyB,IAAI,KAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,KAAI,CAAC;oBAC7E,qBAAqB,EACnB,KAAI,CAAC,qBAAqB,IAAI,KAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAI,CAAC;oBACrE,mBAAmB,EAAE,KAAI,CAAC,mBAAmB,IAAI,KAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAI,CAAC;oBACpF,kBAAkB,EAAE,KAAI,CAAC,kBAAkB,IAAI,KAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAI,CAAC;oBACjF,iBAAiB,EAAE,KAAI,CAAC,iBAAiB,IAAI,KAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAI,CAAC;oBAC9E,MAAM,EAAE,KAAI,CAAC,KAAK;iBACnB,CAAC,EACF,KAAI,CAAC,IAAI,CACV,CAAC;YACJ,CAAC,CAAC,CAAC;YACH,OAAO,gBAAgB,CAAC;QAC1B,CAAC,CAAC;;IACJ,CAAC;IAxDS,uCAAQ,GAAlB,UAAmB,KAAQ;QACzB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAClD,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACpC;IACH,CAAC;IA0GS,qCAAM,GAAhB;QACE,MAAM,IAAI,KAAK,CAAI,IAAI,CAAC,cAAc,wCAAqC,CAAC,CAAC;IAC/E,CAAC;IACH,2BAAC;AAAD,CAAC,AAvHD,CAA6C,mBAAmB,GAuH/D"} \ No newline at end of file diff --git a/packages/plugins/react/src/index.ts b/packages/plugins/react/src/index.ts index dad8cf89..2d460a05 100644 --- a/packages/plugins/react/src/index.ts +++ b/packages/plugins/react/src/index.ts @@ -24,8 +24,8 @@ export class GondelReactComponent extends GondelBaseComponent } } - constructor(ctx: HTMLElement) { - super(); + constructor(ctx: HTMLElement, componentName: string) { + super(ctx, componentName); // Overwrite the current start method const originalStart = (this as any).start; const ReactDOMPromise = import(/* webpackPrefetch: true, webpackChunkName: 'ReactDom' */ "react-dom").then(