@tamagui/react-native-web-lite
Version:
React Native for Web
206 lines (205 loc) • 8.45 kB
JavaScript
;
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: !0 });
}, __copyProps = (to, from, except, desc) => {
if (from && typeof from == "object" || typeof from == "function")
for (let key of __getOwnPropNames(from))
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
mod
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
var AnimatedTransform_exports = {};
__export(AnimatedTransform_exports, {
default: () => AnimatedTransform_default
});
module.exports = __toCommonJS(AnimatedTransform_exports);
var import_AnimatedNode = __toESM(require("./AnimatedNode")), import_AnimatedWithChildren = __toESM(require("./AnimatedWithChildren")), import_NativeAnimatedHelper = __toESM(require("../NativeAnimatedHelper"));
function _assert_this_initialized(self) {
if (self === void 0)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return self;
}
function _call_super(_this, derived, args) {
return derived = _get_prototype_of(derived), _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
}
function _class_call_check(instance, Constructor) {
if (!(instance instanceof Constructor))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _create_class(Constructor, protoProps, staticProps) {
return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
}
function _define_property(obj, key, value) {
return key in obj ? Object.defineProperty(obj, key, {
value,
enumerable: !0,
configurable: !0,
writable: !0
}) : obj[key] = value, obj;
}
function _get(target, property, receiver) {
return typeof Reflect < "u" && Reflect.get ? _get = Reflect.get : _get = function(target2, property2, receiver2) {
var base = _super_prop_base(target2, property2);
if (base) {
var desc = Object.getOwnPropertyDescriptor(base, property2);
return desc.get ? desc.get.call(receiver2 || target2) : desc.value;
}
}, _get(target, property, receiver || target);
}
function _get_prototype_of(o) {
return _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function(o2) {
return o2.__proto__ || Object.getPrototypeOf(o2);
}, _get_prototype_of(o);
}
function _inherits(subClass, superClass) {
if (typeof superClass != "function" && superClass !== null)
throw new TypeError("Super expression must either be null or a function");
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: !0,
configurable: !0
}
}), superClass && _set_prototype_of(subClass, superClass);
}
function _possible_constructor_return(self, call) {
return call && (_type_of(call) === "object" || typeof call == "function") ? call : _assert_this_initialized(self);
}
function _set_prototype_of(o, p) {
return _set_prototype_of = Object.setPrototypeOf || function(o2, p2) {
return o2.__proto__ = p2, o2;
}, _set_prototype_of(o, p);
}
function _super_prop_base(object, property) {
for (; !Object.prototype.hasOwnProperty.call(object, property) && (object = _get_prototype_of(object), object !== null); )
;
return object;
}
function _type_of(obj) {
"@swc/helpers - typeof";
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
}
function _is_native_reflect_construct() {
try {
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
} catch {
}
return (_is_native_reflect_construct = function() {
return !!result;
})();
}
var AnimatedTransform = /* @__PURE__ */ function(AnimatedWithChildren2) {
_inherits(AnimatedTransform2, AnimatedWithChildren2);
function AnimatedTransform2(transforms) {
_class_call_check(this, AnimatedTransform2);
var _this;
return _this = _call_super(this, AnimatedTransform2), _define_property(_this, "_transforms", void 0), _this._transforms = transforms, _this;
}
return _create_class(AnimatedTransform2, [
{
key: "__makeNative",
value: function() {
this._transforms.forEach(function(transform) {
for (var key in transform) {
var value = transform[key];
value instanceof import_AnimatedNode.default && value.__makeNative();
}
}), _get(_get_prototype_of(AnimatedTransform2.prototype), "__makeNative", this).call(this);
}
},
{
key: "__getValue",
value: function() {
return this._transforms.map(function(transform) {
var result = {};
for (var key in transform) {
var value = transform[key];
value instanceof import_AnimatedNode.default ? result[key] = value.__getValue() : result[key] = value;
}
return result;
});
}
},
{
key: "__getAnimatedValue",
value: function() {
return this._transforms.map(function(transform) {
var result = {};
for (var key in transform) {
var value = transform[key];
value instanceof import_AnimatedNode.default ? result[key] = value.__getAnimatedValue() : result[key] = value;
}
return result;
});
}
},
{
key: "__attach",
value: function() {
var _this = this;
this._transforms.forEach(function(transform) {
for (var key in transform) {
var value = transform[key];
value instanceof import_AnimatedNode.default && value.__addChild(_this);
}
});
}
},
{
key: "__detach",
value: function() {
var _this = this;
this._transforms.forEach(function(transform) {
for (var key in transform) {
var value = transform[key];
value instanceof import_AnimatedNode.default && value.__removeChild(_this);
}
}), _get(_get_prototype_of(AnimatedTransform2.prototype), "__detach", this).call(this);
}
},
{
key: "__getNativeConfig",
value: function() {
var transConfigs = [];
return this._transforms.forEach(function(transform) {
for (var key in transform) {
var value = transform[key];
value instanceof import_AnimatedNode.default ? transConfigs.push({
type: "animated",
property: key,
nodeTag: value.__getNativeTag()
}) : transConfigs.push({
type: "static",
property: key,
value: import_NativeAnimatedHelper.default.transformDataType(value)
});
}
}), import_NativeAnimatedHelper.default.validateTransform(transConfigs), {
type: "transform",
transforms: transConfigs
};
}
}
]), AnimatedTransform2;
}(import_AnimatedWithChildren.default), AnimatedTransform_default = AnimatedTransform;
//# sourceMappingURL=AnimatedTransform.js.map