Skip to content

release 4.4.3-0.1.2 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified package/harmony/slider.har
Binary file not shown.
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/ComponentDescriptor.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
Expand Down
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/EventEmitters.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
Expand Down
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/EventEmitters.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
Expand Down
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/Props.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
Expand Down
58 changes: 2 additions & 56 deletions package/harmony/slider/src/main/cpp/Props.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
Expand All @@ -25,6 +25,7 @@
#pragma once

#include <jsi/jsi.h>
#include <react/renderer/components/image/conversions.h>
#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/imagemanager/primitives.h>
Expand All @@ -33,61 +34,6 @@
namespace facebook {
namespace react {

inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageSource &result) {
if (value.hasType<std::string>()) {
result = {
ImageSource::Type::Remote,
(std::string)value,
};
return;
}

if (value.hasType<butter::map<std::string, RawValue>>()) {
auto items = (butter::map<std::string, RawValue>)value;
result = {};

result.type = ImageSource::Type::Remote;

if (items.find("__packager_asset") != items.end()) {
result.type = ImageSource::Type::Local;
}

if (items.find("width") != items.end() && items.find("height") != items.end() &&
items.at("width").hasType<Float>() && items.at("height").hasType<Float>()) {
result.size = {(Float)items.at("width"), (Float)items.at("height")};
}

if (items.find("scale") != items.end() &&
items.at("scale").hasType<Float>()) {
result.scale = (Float)items.at("scale");
} else {
result.scale = items.find("deprecated") != items.end() ? 0.0f : 1.0f;
}

if (items.find("url") != items.end() &&
items.at("url").hasType<std::string>()) {
result.uri = (std::string)items.at("url");
}

if (items.find("uri") != items.end() &&
items.at("uri").hasType<std::string>()) {
result.uri = (std::string)items.at("uri");
}

if (items.find("bundle") != items.end() &&
items.at("bundle").hasType<std::string>()) {
result.bundle = (std::string)items.at("bundle");
result.type = ImageSource::Type::Local;
}

return;
}
result = {};
result.type = ImageSource::Type::Invalid;
}

inline std::string toString(const ImageSource &value) { return "{uri: " + value.uri + "}"; }

class JSI_EXPORT RNCSliderProps final : public ViewProps {
public:
RNCSliderProps() = default;
Expand Down
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/ShadowNodes.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
Expand Down
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/ShadowNodes.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
Expand Down
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/SliderJSIBinder.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
Expand Down
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/SliderNapiBinder.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
Expand Down
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/SliderPackage.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
Expand Down
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/ets/Logger.ets
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/ets/Slider.ets
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
Expand Down
2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-oh-library/slider",
"version": "4.4.3-0.1.1",
"version": "4.4.3-0.1.2",
"license": "MIT",
"author": "react-native-community",
"homepage": "https://github.com/callstack/react-native-slider#readme",
Expand Down
2 changes: 1 addition & 1 deletion package/src/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ SliderWithRef.defaultProps = {
};

let styles = StyleSheet.create(
Platform.OS === 'ios' ? {slider: {height: 40}} : {slider: {}},
Platform.OS === 'ios' || Platform.OS === 'harmony' ? {slider: {height: 40}} : {slider: {}},
);

export default SliderWithRef;