Browse Source

【功能】添加containerPath、entranceHTMLFile

xcbosa mbp16 1 year ago
parent
commit
8ee0c24ff8

+ 7 - 0
XCTheme/Classes/Impl/XCThemeSpec.swift

@@ -97,6 +97,13 @@ extension XCThemeSpec {
         return blurStyle
     }
     
+    public var entranceHTMLFile: String? {
+        guard let htmlFile = self.originalDict["html"] as? String else {
+            return nil
+        }
+        return htmlFile
+    }
+    
 }
 
 fileprivate extension UIColor {

+ 2 - 0
XCTheme/Classes/Module/XCThemeSpecModel.h

@@ -13,11 +13,13 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, weak, readonly) id wrappedObject;
 
+@property (nonatomic, copy, readonly, nullable) NSString *containerPath;
 @property (nonatomic, copy, readonly, nullable) NSDictionary<NSString *, NSObject *> *originalDict;
 @property (nonatomic, strong, readonly, nullable) UIImage *backgroundImage;
 @property (nonatomic, strong, readonly, nullable) UIColor *maskColor;
 @property (nonatomic, assign, readonly) CGFloat maskAlpha;
 @property (nonatomic, copy, readonly, nullable) NSString *blurStyle;
+@property (nonatomic, copy, readonly, nullable) NSString *entranceHTMLFile;
 
 - (nullable instancetype)initWithWrappedObject:(id)object;
 

+ 8 - 0
XCTheme/Classes/Module/XCThemeSpecModel.m

@@ -50,4 +50,12 @@
     return self.wrappedObject.blurStyle;
 }
 
+- (NSString *)entranceHTMLFile {
+    return self.wrappedObject.entranceHTMLFile;
+}
+
+- (NSString *)containerPath {
+    return self.wrappedObject.themeRootPath;
+}
+
 @end