@awesome-fe/translate
Version:
Translation utils
39 lines • 1.97 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.BlockResourceRenderer = void 0;
var block_node_renderer_1 = require("./block-node-renderer");
var BlockResourceRenderer = /** @class */ (function (_super) {
__extends(BlockResourceRenderer, _super);
function BlockResourceRenderer(type, internalAttributes) {
var _this = _super.call(this) || this;
_this.type = type;
_this.positionalAttributes = internalAttributes.filter((function (it) { return it.position; }));
_this.inlineAttributeNames = internalAttributes.map(function (it) { return it.name; });
return _this;
}
BlockResourceRenderer.prototype.getBlockTitle = function (node) {
return node.getTitle();
};
BlockResourceRenderer.prototype.renderBody = function (node) {
var attributes = this.renderAttributes(this.getInlineAttributes(node));
return "".concat(this.type, "::").concat(node.getAttribute('target'), "[").concat(attributes, "]");
};
return BlockResourceRenderer;
}(block_node_renderer_1.BlockNodeRenderer));
exports.BlockResourceRenderer = BlockResourceRenderer;
//# sourceMappingURL=block-resource-renderer.js.map