marko-widgets
Version:
<h1 align="center"> <!-- Logo --> <br/> marko-widgets@8 <br/>
48 lines (47 loc) • 1.76 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_on_exports = {};
__export(w_on_exports, {
default: () => w_on_default
});
module.exports = __toCommonJS(w_on_exports);
var import_compiler = require("@marko/compiler");
var import_babel_utils = require("@marko/babel-utils");
var w_on_default = {
MarkoAttribute(attr) {
var _a;
const { node } = attr;
if (!node.name.startsWith("w-on")) return;
(_a = attr.hub.file.metadata.marko).widgetBind || (_a.widgetBind = true);
(0, import_babel_utils.diagnosticDeprecate)(attr, {
label: `The "w-on*" attributes are deprecated. Please use "on*()" instead. See: https://github.com/marko-js/marko/wiki/Deprecation:-w\u2010*-Attributes`,
fix() {
attr.replaceWith(
import_compiler.types.markoAttribute(
node.name.slice(2),
import_compiler.types.booleanLiteral(true),
node.modifier,
[node.value],
node.default
)
);
}
});
}
};