progress on migrating to heex templates and font-icons
This commit is contained in:
parent
d43daafdb7
commit
3eff955672
21793 changed files with 2161968 additions and 16895 deletions
assets_old/node_modules/@babel/plugin-transform-computed-properties
22
assets_old/node_modules/@babel/plugin-transform-computed-properties/LICENSE
generated
vendored
Normal file
22
assets_old/node_modules/@babel/plugin-transform-computed-properties/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
assets_old/node_modules/@babel/plugin-transform-computed-properties/README.md
generated
vendored
Normal file
19
assets_old/node_modules/@babel/plugin-transform-computed-properties/README.md
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
# @babel/plugin-transform-computed-properties
|
||||
|
||||
> Compile ES2015 computed properties to ES5
|
||||
|
||||
See our website [@babel/plugin-transform-computed-properties](https://babeljs.io/docs/en/babel-plugin-transform-computed-properties) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-transform-computed-properties
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-transform-computed-properties --dev
|
||||
```
|
171
assets_old/node_modules/@babel/plugin-transform-computed-properties/lib/index.js
generated
vendored
Normal file
171
assets_old/node_modules/@babel/plugin-transform-computed-properties/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,171 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
||||
|
||||
var _core = require("@babel/core");
|
||||
|
||||
var _default = (0, _helperPluginUtils.declare)((api, options) => {
|
||||
var _api$assumption;
|
||||
|
||||
api.assertVersion(7);
|
||||
const setComputedProperties = (_api$assumption = api.assumption("setComputedProperties")) != null ? _api$assumption : options.loose;
|
||||
const pushComputedProps = setComputedProperties ? pushComputedPropsLoose : pushComputedPropsSpec;
|
||||
const buildMutatorMapAssign = (0, _core.template)(`
|
||||
MUTATOR_MAP_REF[KEY] = MUTATOR_MAP_REF[KEY] || {};
|
||||
MUTATOR_MAP_REF[KEY].KIND = VALUE;
|
||||
`);
|
||||
|
||||
function getValue(prop) {
|
||||
if (_core.types.isObjectProperty(prop)) {
|
||||
return prop.value;
|
||||
} else if (_core.types.isObjectMethod(prop)) {
|
||||
return _core.types.functionExpression(null, prop.params, prop.body, prop.generator, prop.async);
|
||||
}
|
||||
}
|
||||
|
||||
function pushAssign(objId, prop, body) {
|
||||
if (prop.kind === "get" && prop.kind === "set") {
|
||||
pushMutatorDefine(objId, prop, body);
|
||||
} else {
|
||||
body.push(_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.memberExpression(_core.types.cloneNode(objId), prop.key, prop.computed || _core.types.isLiteral(prop.key)), getValue(prop))));
|
||||
}
|
||||
}
|
||||
|
||||
function pushMutatorDefine({
|
||||
body,
|
||||
getMutatorId,
|
||||
scope
|
||||
}, prop) {
|
||||
let key = !prop.computed && _core.types.isIdentifier(prop.key) ? _core.types.stringLiteral(prop.key.name) : prop.key;
|
||||
const maybeMemoise = scope.maybeGenerateMemoised(key);
|
||||
|
||||
if (maybeMemoise) {
|
||||
body.push(_core.types.expressionStatement(_core.types.assignmentExpression("=", maybeMemoise, key)));
|
||||
key = maybeMemoise;
|
||||
}
|
||||
|
||||
body.push(...buildMutatorMapAssign({
|
||||
MUTATOR_MAP_REF: getMutatorId(),
|
||||
KEY: _core.types.cloneNode(key),
|
||||
VALUE: getValue(prop),
|
||||
KIND: _core.types.identifier(prop.kind)
|
||||
}));
|
||||
}
|
||||
|
||||
function pushComputedPropsLoose(info) {
|
||||
for (const prop of info.computedProps) {
|
||||
if (prop.kind === "get" || prop.kind === "set") {
|
||||
pushMutatorDefine(info, prop);
|
||||
} else {
|
||||
pushAssign(_core.types.cloneNode(info.objId), prop, info.body);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function pushComputedPropsSpec(info) {
|
||||
const {
|
||||
objId,
|
||||
body,
|
||||
computedProps,
|
||||
state
|
||||
} = info;
|
||||
|
||||
for (const prop of computedProps) {
|
||||
const key = _core.types.toComputedKey(prop);
|
||||
|
||||
if (prop.kind === "get" || prop.kind === "set") {
|
||||
pushMutatorDefine(info, prop);
|
||||
} else {
|
||||
if (computedProps.length === 1) {
|
||||
return _core.types.callExpression(state.addHelper("defineProperty"), [info.initPropExpression, key, getValue(prop)]);
|
||||
} else {
|
||||
body.push(_core.types.expressionStatement(_core.types.callExpression(state.addHelper("defineProperty"), [_core.types.cloneNode(objId), key, getValue(prop)])));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
name: "transform-computed-properties",
|
||||
visitor: {
|
||||
ObjectExpression: {
|
||||
exit(path, state) {
|
||||
const {
|
||||
node,
|
||||
parent,
|
||||
scope
|
||||
} = path;
|
||||
let hasComputed = false;
|
||||
|
||||
for (const prop of node.properties) {
|
||||
hasComputed = prop.computed === true;
|
||||
if (hasComputed) break;
|
||||
}
|
||||
|
||||
if (!hasComputed) return;
|
||||
const initProps = [];
|
||||
const computedProps = [];
|
||||
let foundComputed = false;
|
||||
|
||||
for (const prop of node.properties) {
|
||||
if (prop.computed) {
|
||||
foundComputed = true;
|
||||
}
|
||||
|
||||
if (foundComputed) {
|
||||
computedProps.push(prop);
|
||||
} else {
|
||||
initProps.push(prop);
|
||||
}
|
||||
}
|
||||
|
||||
const objId = scope.generateUidIdentifierBasedOnNode(parent);
|
||||
|
||||
const initPropExpression = _core.types.objectExpression(initProps);
|
||||
|
||||
const body = [];
|
||||
body.push(_core.types.variableDeclaration("var", [_core.types.variableDeclarator(objId, initPropExpression)]));
|
||||
let mutatorRef;
|
||||
|
||||
const getMutatorId = function () {
|
||||
if (!mutatorRef) {
|
||||
mutatorRef = scope.generateUidIdentifier("mutatorMap");
|
||||
body.push(_core.types.variableDeclaration("var", [_core.types.variableDeclarator(mutatorRef, _core.types.objectExpression([]))]));
|
||||
}
|
||||
|
||||
return _core.types.cloneNode(mutatorRef);
|
||||
};
|
||||
|
||||
const single = pushComputedProps({
|
||||
scope,
|
||||
objId,
|
||||
body,
|
||||
computedProps,
|
||||
initPropExpression,
|
||||
getMutatorId,
|
||||
state
|
||||
});
|
||||
|
||||
if (mutatorRef) {
|
||||
body.push(_core.types.expressionStatement(_core.types.callExpression(state.addHelper("defineEnumerableProperties"), [_core.types.cloneNode(objId), _core.types.cloneNode(mutatorRef)])));
|
||||
}
|
||||
|
||||
if (single) {
|
||||
path.replaceWith(single);
|
||||
} else {
|
||||
body.push(_core.types.expressionStatement(_core.types.cloneNode(objId)));
|
||||
path.replaceWithMultiple(body);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
exports.default = _default;
|
29
assets_old/node_modules/@babel/plugin-transform-computed-properties/package.json
generated
vendored
Normal file
29
assets_old/node_modules/@babel/plugin-transform-computed-properties/package.json
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"name": "@babel/plugin-transform-computed-properties",
|
||||
"version": "7.13.0",
|
||||
"description": "Compile ES2015 computed properties to ES5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-plugin-transform-computed-properties"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-computed-properties",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.13.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.13.0",
|
||||
"@babel/helper-plugin-test-runner": "7.12.13"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue