Skip to content

Commit

Permalink
v10.3.0 (#396)
Browse files Browse the repository at this point in the history
* v10.2.1

* OC project with V10

* v10.3.0

---------

Co-authored-by: 张诗文 <zhangshiwen@corp.netease.com>
  • Loading branch information
zsw666 and 张诗文 authored Jul 16, 2024
1 parent 972a26f commit 0c307e5
Show file tree
Hide file tree
Showing 292 changed files with 10,437 additions and 2,187 deletions.
44 changes: 44 additions & 0 deletions NEAISearchKit/NEAISearchKit.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#
# Be sure to run `pod lib lint NEAISearchKit.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
s.name = 'NEAISearchKit'
s.version = '1.0.0'
s.summary = 'Netease XKit'

# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!

s.description = <<-DESC
TODO: Add long description of the pod here.
DESC

s.homepage = 'http://netease.im'
s.license = { :'type' => 'Copyright', :'text' => ' Copyright 2022 Netease '}
s.author = 'yunxin engineering department'
s.source = { :git => 'https://github.com/netease/NEKitGroupUI.git', :tag => s.version.to_s }

s.pod_target_xcconfig = {
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64',
'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES'
}

s.ios.deployment_target = '12.0'
s.swift_version = '5.0'

s.source_files = 'NEAISearchKit/Classes/**/*'
s.resource = 'NEAISearchKit/Assets/**/*'

s.dependency 'NEChatKit'
s.dependency 'NECommonUIKit'
s.dependency 'lottie-ios','4.4.0'

end
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ai_expand@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ai_expand@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions NEAISearchKit/NEAISearchKit/Assets/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) 2022 NetEase, Inc. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.


// MARK: AI 划词搜
"operation_ai_word_search"="AI Search";

"ok"="OK";
"complete"="Complete";
"cancel"="Cancel";

"ai_word_search" = "AI Word Search";
"ai_word_searching" = "AI Word Searching";
"input_more_button" = "Additional information";
"input_more_placeholder" = "Please provide more information.";
"not_supported" = "Not supported";
"request_exception" = "Request Exception";
1 change: 1 addition & 0 deletions NEAISearchKit/NEAISearchKit/Assets/ne_loading_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"v":"5.12.1","fr":24,"ip":0,"op":32,"w":45,"h":45,"nm":"合成 3","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"形状图层 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[22.5,22.5,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[40,40],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.129411764706,0.333333333333,0.933333333333,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"描边 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"椭圆 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[99]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":14,"s":[75]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":21,"s":[50]},{"t":30,"s":[1]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[100]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":7,"s":[75]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":14,"s":[50]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":21,"s":[25]},{"t":28,"s":[0]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"修剪路径 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":32,"st":0,"ct":1,"bm":0}],"markers":[],"props":{}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) 2022 NetEase, Inc. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.


// MARK: AI 划词搜
"operation_ai_word_search"="AI划词搜";

"ok"="确认";
"complete"="完成";
"cancel"="取消";

"ai_word_search" = "AI划词搜";
"ai_word_searching" = "AI划词搜索中...";
"input_more_button" = "补充信息";
"input_more_placeholder" = "补充输入更多信息";
"not_supported" = "暂不支持";
"request_exception" = "模型请求异常";
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

// Copyright (c) 2022 NetEase, Inc. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.

import NECommonKit
import NECoreKit

let ModuleName = "NEAISearchKit"

let coreLoader = CoreLoader<NEAISearchManager>()
func localizable(_ key: String) -> String {
coreLoader.localizable(key)
}

let textFont = UIFont.systemFont(ofSize: 14)
let textMaxSize = CGSize(width: NEConstant.screenWidth - 20 * 2, height: CGFloat.greatestFiniteMagnitude)

public extension UIImage {
class func ne_imageNamed(name: String?) -> UIImage? {
guard let imageName = name, !imageName.isEmpty else {
return nil
}
return coreLoader.loadImage(imageName)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

// Copyright (c) 2022 NetEase, Inc. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.

@objcMembers
open class NEAIWordSearchModel: NSObject {
var content: NSAttributedString?
var height: CGFloat = 0

init(_ content: NSAttributedString?) {
self.content = content
let textSize = NSAttributedString.getRealSize(content, textFont, textMaxSize)
height = ceil(textSize.height)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

// Copyright (c) 2022 NetEase, Inc. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.

@objcMembers
open class NEAIWordSearchTextCell: UITableViewCell {
override public init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
commonUI()
}

public required init?(coder: NSCoder) {
super.init(coder: coder)
commonUI()
}

/// UI 布局方法
func commonUI() {
isUserInteractionEnabled = false
contentView.addSubview(contentLabel)
NSLayoutConstraint.activate([
contentLabel.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 16),
contentLabel.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 20),
contentLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -20),
contentLabel.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -16),
])

contentView.addSubview(bottomLineView)
NSLayoutConstraint.activate([
bottomLineView.leftAnchor.constraint(equalTo: contentView.leftAnchor),
bottomLineView.rightAnchor.constraint(equalTo: contentView.rightAnchor),
bottomLineView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
bottomLineView.heightAnchor.constraint(equalToConstant: 4),
])
}

/// 是否显示 cell 底部分隔线
/// - Parameter show: 是否显示
func showBottomLine(_ show: Bool) {
bottomLineView.isHidden = !show
}

/// 数据绑定
/// - Parameter model: 数据模型
func setModel(_ model: NEAIWordSearchModel) {
contentLabel.attributedText = model.content
}

/// 文本内容
lazy var contentLabel: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.font = textFont
label.textColor = .ne_darkText
label.numberOfLines = 0
label.textAlignment = .justified
label.accessibilityIdentifier = "id.content"

return label
}()

/// 分隔线
lazy var bottomLineView: UIView = {
let view = UIView()
view.translatesAutoresizingMaskIntoConstraints = false
view.backgroundColor = UIColor(hexString: "#EDEDED")
return view
}()
}
Loading

0 comments on commit 0c307e5

Please sign in to comment.