$
This commit is contained in:
21
node_modules/riot/esm/api/__.js
generated
vendored
Normal file
21
node_modules/riot/esm/api/__.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import { template, createBinding, createExpression, bindingTypes, expressionTypes } from '@riotjs/dom-bindings';
|
||||
import { DOM_COMPONENT_INSTANCE_PROPERTY, PARENT_KEY_SYMBOL } from '@riotjs/util';
|
||||
import cssManager from '../core/css-manager.js';
|
||||
|
||||
const __ = {
|
||||
cssManager,
|
||||
DOMBindings: {
|
||||
template,
|
||||
createBinding,
|
||||
createExpression,
|
||||
bindingTypes,
|
||||
expressionTypes
|
||||
},
|
||||
globals: {
|
||||
DOM_COMPONENT_INSTANCE_PROPERTY,
|
||||
PARENT_KEY_SYMBOL
|
||||
}
|
||||
};
|
||||
|
||||
export { __ };
|
26
node_modules/riot/esm/api/component.js
generated
vendored
Normal file
26
node_modules/riot/esm/api/component.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import compose from 'cumpa';
|
||||
import { createComponentFromWrapper } from '../core/create-component-from-wrapper.js';
|
||||
|
||||
/**
|
||||
* Helper method to create component without relying on the registered ones
|
||||
* @param {Object} implementation - component implementation
|
||||
* @returns {Function} function that will allow you to mount a riot component on a DOM node
|
||||
*/
|
||||
|
||||
function component(implementation) {
|
||||
return function (el, props, _temp) {
|
||||
let {
|
||||
slots,
|
||||
attributes,
|
||||
parentScope
|
||||
} = _temp === void 0 ? {} : _temp;
|
||||
return compose(c => c.mount(el, parentScope), c => c({
|
||||
props,
|
||||
slots,
|
||||
attributes
|
||||
}), createComponentFromWrapper)(implementation);
|
||||
};
|
||||
}
|
||||
|
||||
export { component };
|
17
node_modules/riot/esm/api/install.js
generated
vendored
Normal file
17
node_modules/riot/esm/api/install.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import { isFunction, panic, PLUGINS_SET } from '@riotjs/util';
|
||||
|
||||
/**
|
||||
* Define a riot plugin
|
||||
* @param {Function} plugin - function that will receive all the components created
|
||||
* @returns {Set} the set containing all the plugins installed
|
||||
*/
|
||||
|
||||
function install(plugin) {
|
||||
if (!isFunction(plugin)) panic('Plugins must be of type function');
|
||||
if (PLUGINS_SET.has(plugin)) panic('This plugin was already installed');
|
||||
PLUGINS_SET.add(plugin);
|
||||
return PLUGINS_SET;
|
||||
}
|
||||
|
||||
export { install };
|
17
node_modules/riot/esm/api/mount.js
generated
vendored
Normal file
17
node_modules/riot/esm/api/mount.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import $ from 'bianco.query';
|
||||
import { mountComponent } from '../core/mount-component.js';
|
||||
|
||||
/**
|
||||
* Mounting function that will work only for the components that were globally registered
|
||||
* @param {string|HTMLElement} selector - query for the selection or a DOM element
|
||||
* @param {Object} initialProps - the initial component properties
|
||||
* @param {string} name - optional component name
|
||||
* @returns {Array} list of riot components
|
||||
*/
|
||||
|
||||
function mount(selector, initialProps, name) {
|
||||
return $(selector).map(element => mountComponent(element, initialProps, name));
|
||||
}
|
||||
|
||||
export { mount };
|
16
node_modules/riot/esm/api/pure.js
generated
vendored
Normal file
16
node_modules/riot/esm/api/pure.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import { isFunction, panic, IS_PURE_SYMBOL } from '@riotjs/util';
|
||||
|
||||
/**
|
||||
* Lift a riot component Interface into a pure riot object
|
||||
* @param {Function} func - RiotPureComponent factory function
|
||||
* @returns {Function} the lifted original function received as argument
|
||||
*/
|
||||
|
||||
function pure(func) {
|
||||
if (!isFunction(func)) panic('riot.pure accepts only arguments of type "function"');
|
||||
func[IS_PURE_SYMBOL] = true;
|
||||
return func;
|
||||
}
|
||||
|
||||
export { pure };
|
28
node_modules/riot/esm/api/register.js
generated
vendored
Normal file
28
node_modules/riot/esm/api/register.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import { COMPONENTS_IMPLEMENTATION_MAP, panic } from '@riotjs/util';
|
||||
import { createComponentFromWrapper } from '../core/create-component-from-wrapper.js';
|
||||
|
||||
/**
|
||||
* Register a custom tag by name
|
||||
* @param {string} name - component name
|
||||
* @param {Object} implementation - tag implementation
|
||||
* @returns {Map} map containing all the components implementations
|
||||
*/
|
||||
|
||||
function register(name, _ref) {
|
||||
let {
|
||||
css,
|
||||
template,
|
||||
exports
|
||||
} = _ref;
|
||||
if (COMPONENTS_IMPLEMENTATION_MAP.has(name)) panic(`The component "${name}" was already registered`);
|
||||
COMPONENTS_IMPLEMENTATION_MAP.set(name, createComponentFromWrapper({
|
||||
name,
|
||||
css,
|
||||
template,
|
||||
exports
|
||||
}));
|
||||
return COMPONENTS_IMPLEMENTATION_MAP;
|
||||
}
|
||||
|
||||
export { register };
|
16
node_modules/riot/esm/api/uninstall.js
generated
vendored
Normal file
16
node_modules/riot/esm/api/uninstall.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import { PLUGINS_SET, panic } from '@riotjs/util';
|
||||
|
||||
/**
|
||||
* Uninstall a riot plugin
|
||||
* @param {Function} plugin - plugin previously installed
|
||||
* @returns {Set} the set containing all the plugins installed
|
||||
*/
|
||||
|
||||
function uninstall(plugin) {
|
||||
if (!PLUGINS_SET.has(plugin)) panic('This plugin was never installed');
|
||||
PLUGINS_SET.delete(plugin);
|
||||
return PLUGINS_SET;
|
||||
}
|
||||
|
||||
export { uninstall };
|
22
node_modules/riot/esm/api/unmount.js
generated
vendored
Normal file
22
node_modules/riot/esm/api/unmount.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import $ from 'bianco.query';
|
||||
import { DOM_COMPONENT_INSTANCE_PROPERTY } from '@riotjs/util';
|
||||
|
||||
/**
|
||||
* Sweet unmounting helper function for the DOM node mounted manually by the user
|
||||
* @param {string|HTMLElement} selector - query for the selection or a DOM element
|
||||
* @param {boolean|null} keepRootElement - if true keep the root element
|
||||
* @returns {Array} list of nodes unmounted
|
||||
*/
|
||||
|
||||
function unmount(selector, keepRootElement) {
|
||||
return $(selector).map(element => {
|
||||
if (element[DOM_COMPONENT_INSTANCE_PROPERTY]) {
|
||||
element[DOM_COMPONENT_INSTANCE_PROPERTY].unmount(keepRootElement);
|
||||
}
|
||||
|
||||
return element;
|
||||
});
|
||||
}
|
||||
|
||||
export { unmount };
|
18
node_modules/riot/esm/api/unregister.js
generated
vendored
Normal file
18
node_modules/riot/esm/api/unregister.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import { COMPONENTS_IMPLEMENTATION_MAP, panic } from '@riotjs/util';
|
||||
import cssManager from '../core/css-manager.js';
|
||||
|
||||
/**
|
||||
* Unregister a riot web component
|
||||
* @param {string} name - component name
|
||||
* @returns {Map} map containing all the components implementations
|
||||
*/
|
||||
|
||||
function unregister(name) {
|
||||
if (!COMPONENTS_IMPLEMENTATION_MAP.has(name)) panic(`The component "${name}" was never registered`);
|
||||
COMPONENTS_IMPLEMENTATION_MAP.delete(name);
|
||||
cssManager.remove(name);
|
||||
return COMPONENTS_IMPLEMENTATION_MAP;
|
||||
}
|
||||
|
||||
export { unregister };
|
5
node_modules/riot/esm/api/version.js
generated
vendored
Normal file
5
node_modules/riot/esm/api/version.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
/** @type {string} current riot version */
|
||||
const version = 'WIP';
|
||||
|
||||
export { version };
|
11
node_modules/riot/esm/api/with-types.js
generated
vendored
Normal file
11
node_modules/riot/esm/api/with-types.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
/**
|
||||
* no-op function needed to add the proper types to your component via typescript
|
||||
* @param {Function|Object} component - component default export
|
||||
* @returns {Function|Object} returns exactly what it has received
|
||||
*/
|
||||
|
||||
/* istanbul ignore next */
|
||||
const withTypes = component => component;
|
||||
|
||||
export { withTypes };
|
Reference in New Issue
Block a user