marko-widgets
Version:
<h1 align="center"> <!-- Logo --> <br/> marko-widgets@8 <br/>
56 lines (55 loc) • 2.16 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var w_config_directive_exports = {};
__export(w_config_directive_exports, {
default: () => w_config_directive_default
});
module.exports = __toCommonJS(w_config_directive_exports);
var import_compiler = require("@marko/compiler");
var import_babel_utils = require("@marko/babel-utils");
var import_compat_utils = require("@marko/compat-utils");
var w_config_directive_default = {
MarkoAttribute(attr) {
const { node } = attr;
if (node.name !== "w-config") return;
(0, import_babel_utils.diagnosticDeprecate)(attr, {
label: 'The "w-config" attribute is deprecated. See: https://github.com/marko-js/marko/wiki/Deprecation:-w\u2010config',
fix() {
const tag = attr.parentPath;
attr.remove();
if (!(0, import_compat_utils.isSourceBooleanAttribute)(node)) {
tag.insertBefore(
import_compiler.types.markoScriptlet([
import_compiler.types.expressionStatement(
import_compiler.types.assignmentExpression(
"=",
import_compiler.types.memberExpression(
import_compiler.types.identifier("component"),
import_compiler.types.identifier("widgetConfig")
),
node.value
)
)
])
);
}
}
});
}
};