iOS: add DoricDevPerfVC
This commit is contained in:
parent
74e9aa0e38
commit
8f50d2d67c
@ -74,6 +74,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
DoricDev.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MyAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class MyAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
@ -51,7 +51,7 @@ public class DoricDevPerfActivity extends DoricDevBaseActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_doricdev_perf);
|
setContentView(R.layout.activity_doricdev_perf);
|
||||||
TextView textView = findViewById(R.id.tv_title);
|
TextView textView = findViewById(R.id.tv_title);
|
||||||
textView.setText(String.format("Doric %s <%s>", doricContext.getSource(), doricContext.getContextId()));
|
textView.setText(String.format("%s <%s>", doricContext.getSource(), doricContext.getContextId()));
|
||||||
RecyclerView recyclerView = findViewById(R.id.list);
|
RecyclerView recyclerView = findViewById(R.id.list);
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
myAdapter = new MyAdapter();
|
myAdapter = new MyAdapter();
|
||||||
@ -127,12 +127,12 @@ public class DoricDevPerfActivity extends DoricDevBaseActivity {
|
|||||||
if (prevNode != null) {
|
if (prevNode != null) {
|
||||||
gap = Math.min(16, anchorNode.prepare - prevNode.end);
|
gap = Math.min(16, anchorNode.prepare - prevNode.end);
|
||||||
}
|
}
|
||||||
position = position + gap;
|
position += gap;
|
||||||
anchorItem.position = position;
|
anchorItem.position = position;
|
||||||
anchorItem.prepared = anchorNode.start - anchorNode.prepare;
|
anchorItem.prepared = anchorNode.start - anchorNode.prepare;
|
||||||
anchorItem.worked = anchorNode.end - anchorNode.start;
|
anchorItem.worked = anchorNode.end - anchorNode.start;
|
||||||
anchorNodes.add(anchorItem);
|
anchorNodes.add(anchorItem);
|
||||||
position = position + anchorItem.prepared + anchorItem.worked;
|
position += anchorItem.prepared + anchorItem.worked;
|
||||||
prevNode = anchorNode;
|
prevNode = anchorNode;
|
||||||
}
|
}
|
||||||
duration = position;
|
duration = position;
|
||||||
|
25
doric-iOS/Devkit/Classes/DoricDevPerfVC.h
Normal file
25
doric-iOS/Devkit/Classes/DoricDevPerfVC.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright [2021] [Doric.Pub]
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
//
|
||||||
|
// Created by pengfei.zhou on 2021/7/20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
|
||||||
|
@interface DoricDevPerfVC : UIViewController
|
||||||
|
- (instancetype)initWithContextId:(NSString *)contextId;
|
||||||
|
@end
|
213
doric-iOS/Devkit/Classes/DoricDevPerfVC.m
Normal file
213
doric-iOS/Devkit/Classes/DoricDevPerfVC.m
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
/*
|
||||||
|
* Copyright [2021] [Doric.Pub]
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
//
|
||||||
|
// Created by pengfei.zhou on 2021/7/20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "DoricDevPerfVC.h"
|
||||||
|
#import <DoricCore/Doric.h>
|
||||||
|
#import <DoricCore/DoricContextManager.h>
|
||||||
|
#import "DoricDevPerformanceAnchorHook.h"
|
||||||
|
|
||||||
|
@interface DoricDevAnchorItem : NSObject
|
||||||
|
@property(nonatomic, copy) NSString *name;
|
||||||
|
@property(nonatomic, assign) long position;
|
||||||
|
@property(nonatomic, assign) long prepared;
|
||||||
|
@property(nonatomic, assign) long worked;
|
||||||
|
@property(nonatomic, assign) BOOL expanded;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation DoricDevAnchorItem
|
||||||
|
- (CGFloat)cellHeight {
|
||||||
|
return 40;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface DoricDevAnchorCell : UITableViewCell
|
||||||
|
@property(nonatomic, strong) UILabel *labelName;
|
||||||
|
@property(nonatomic, strong) UIView *waterfallPrepared;
|
||||||
|
@property(nonatomic, strong) UIView *waterfallWorked;
|
||||||
|
@property(nonatomic, assign) long duration;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation DoricDevAnchorCell
|
||||||
|
- (instancetype)initWithStyle:(UITableViewCellStyle)style
|
||||||
|
reuseIdentifier:(NSString *)reuseIdentifier {
|
||||||
|
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||||
|
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||||
|
self.labelName = [[UILabel new] also:^(UILabel *it) {
|
||||||
|
it.font = [UIFont systemFontOfSize:16];
|
||||||
|
it.width = 80;
|
||||||
|
it.height = 25;
|
||||||
|
it.backgroundColor = DoricColor(@(0xff3498db));
|
||||||
|
it.textColor = [UIColor whiteColor];
|
||||||
|
it.text = @"Destroy";
|
||||||
|
it.textAlignment = NSTextAlignmentCenter;
|
||||||
|
[self.contentView addSubview:it];
|
||||||
|
}];
|
||||||
|
self.waterfallPrepared = [[UIView new] also:^(UIView *it) {
|
||||||
|
it.backgroundColor = DoricColor(@(0xff1abc9c));
|
||||||
|
it.height = 20;
|
||||||
|
[self.contentView addSubview:it];
|
||||||
|
|
||||||
|
}];
|
||||||
|
self.waterfallWorked = [[UIView new] also:^(UIView *it) {
|
||||||
|
it.backgroundColor = DoricColor(@(0xfff1c40f));
|
||||||
|
it.height = 20;
|
||||||
|
[self.contentView addSubview:it];
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)refreshUI:(DoricDevAnchorItem *)anchorItem {
|
||||||
|
self.contentView.width = self.width;
|
||||||
|
self.contentView.height = [anchorItem cellHeight];
|
||||||
|
self.labelName.left = 15;
|
||||||
|
self.labelName.centerY = 20;
|
||||||
|
if ([anchorItem.name hasPrefix:@"Call"]) {
|
||||||
|
self.labelName.text = @"Call";
|
||||||
|
self.labelName.backgroundColor = DoricColor(@(0xff3498db));
|
||||||
|
} else {
|
||||||
|
if ([anchorItem.name isEqualToString:@"Render"]) {
|
||||||
|
self.labelName.backgroundColor = DoricColor(@(0xffe74c3c));
|
||||||
|
} else {
|
||||||
|
self.labelName.backgroundColor = DoricColor(@(0xff2ecc71));
|
||||||
|
}
|
||||||
|
self.labelName.text = anchorItem.name;
|
||||||
|
}
|
||||||
|
self.waterfallPrepared.centerY = 20;
|
||||||
|
self.waterfallWorked.centerY = 20;
|
||||||
|
CGFloat all = self.width - 15 - self.labelName.width - 15 - 15;
|
||||||
|
self.waterfallPrepared.left = self.labelName.right + 15 + ((CGFloat) anchorItem.position / (CGFloat) self.duration) * all;
|
||||||
|
self.waterfallPrepared.width = ((CGFloat) anchorItem.prepared / (CGFloat) self.duration) * all;
|
||||||
|
self.waterfallWorked.left = self.waterfallPrepared.right;
|
||||||
|
self.waterfallWorked.width = ((CGFloat) MAX(anchorItem.worked, 1) / (CGFloat) self.duration) * all;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface DoricDevPerfVC () <UITableViewDelegate, UITableViewDataSource>
|
||||||
|
@property(nonatomic, weak) DoricContext *doricContext;
|
||||||
|
@property(nonatomic, strong) UILabel *rightButton;
|
||||||
|
@property(nonatomic, strong) UIView *headerView;
|
||||||
|
@property(nonatomic, strong) UITableView *tableView;
|
||||||
|
@property(nonatomic, strong) NSMutableArray<DoricDevAnchorItem *> *anchorItems;
|
||||||
|
@property(nonatomic, assign) long duration;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation DoricDevPerfVC
|
||||||
|
- (instancetype)initWithContextId:(NSString *)contextId {
|
||||||
|
if (self = [super init]) {
|
||||||
|
_doricContext = [DoricContextManager.instance getContext:contextId];
|
||||||
|
_anchorItems = [NSMutableArray new];
|
||||||
|
_duration = 1;
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)viewDidLoad {
|
||||||
|
[super viewDidLoad];
|
||||||
|
self.title = @"Performance";
|
||||||
|
self.view.backgroundColor = [UIColor whiteColor];
|
||||||
|
self.headerView = [[UIView new] also:^(UIView *it) {
|
||||||
|
it.width = self.view.width;
|
||||||
|
it.height = 50.f;
|
||||||
|
it.backgroundColor = DoricColor(@(0xff7f8c8d));
|
||||||
|
[self.view addSubview:it];
|
||||||
|
}];
|
||||||
|
UILabel *label = [[UILabel new] also:^(UILabel *it) {
|
||||||
|
it.textColor = [UIColor whiteColor];
|
||||||
|
it.font = [UIFont systemFontOfSize:16];
|
||||||
|
it.text = [NSString stringWithFormat:@"%@ <%@>",
|
||||||
|
self.doricContext.source,
|
||||||
|
self.doricContext.contextId];
|
||||||
|
[it sizeToFit];
|
||||||
|
[self.headerView addSubview:it];
|
||||||
|
}];
|
||||||
|
label.left = 15.f;
|
||||||
|
label.centerY = self.headerView.centerY;
|
||||||
|
self.rightButton = [[UILabel new] also:^(UILabel *it) {
|
||||||
|
it.textColor = [UIColor whiteColor];
|
||||||
|
it.font = [UIFont systemFontOfSize:16];
|
||||||
|
it.text = @"Expand[+]";
|
||||||
|
[it sizeToFit];
|
||||||
|
[self.headerView addSubview:it];
|
||||||
|
}];
|
||||||
|
self.rightButton.right = self.headerView.right - 15;
|
||||||
|
self.rightButton.centerY = self.headerView.centerY;
|
||||||
|
self.tableView = [[UITableView new] also:^(UITableView *it) {
|
||||||
|
it.width = self.view.width;
|
||||||
|
it.height = self.view.height - self.headerView.height;
|
||||||
|
it.delegate = self;
|
||||||
|
it.dataSource = self;
|
||||||
|
it.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||||
|
it.allowsSelection = NO;
|
||||||
|
[self.view addSubview:it];
|
||||||
|
}];
|
||||||
|
self.tableView.top = self.headerView.bottom;
|
||||||
|
if ([self.doricContext.driver.registry.globalPerformanceAnchorHook
|
||||||
|
isKindOfClass:DoricDevPerformanceAnchorHook.class]) {
|
||||||
|
NSArray <DoricDevAnchorNode *> *nodes = [((DoricDevPerformanceAnchorHook *) self.doricContext.driver.registry.globalPerformanceAnchorHook)
|
||||||
|
getAnchorNodeList:self.doricContext.contextId];
|
||||||
|
DoricDevAnchorNode *prevNode = nil;
|
||||||
|
long position = 0;
|
||||||
|
for (DoricDevAnchorNode *node in nodes) {
|
||||||
|
DoricDevAnchorItem *item = [DoricDevAnchorItem new];
|
||||||
|
item.name = node.name;
|
||||||
|
long gap = 0;
|
||||||
|
if (prevNode) {
|
||||||
|
gap = MIN(16, node.prepare - prevNode.end);
|
||||||
|
}
|
||||||
|
position += gap;
|
||||||
|
item.position = position;
|
||||||
|
item.prepared = node.start - node.prepare;
|
||||||
|
item.worked = node.end - node.start;
|
||||||
|
[self.anchorItems addObject:item];
|
||||||
|
position += (node.end - node.prepare);
|
||||||
|
prevNode = node;
|
||||||
|
}
|
||||||
|
self.duration = position;
|
||||||
|
}
|
||||||
|
[self.tableView reloadData];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)viewWillAppear:(BOOL)animated {
|
||||||
|
[super viewWillAppear:animated];
|
||||||
|
self.tableView.height = self.view.height - self.headerView.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
DoricDevAnchorCell *cell = [tableView dequeueReusableCellWithIdentifier:@"DoricDevAnchorCell"];
|
||||||
|
if (!cell) {
|
||||||
|
cell = [[DoricDevAnchorCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"DoricDevAnchorCell"];
|
||||||
|
}
|
||||||
|
cell.width = tableView.width;
|
||||||
|
cell.duration = self.duration;
|
||||||
|
NSUInteger position = (NSUInteger) indexPath.row;
|
||||||
|
cell.backgroundColor = position % 2 == 0 ? DoricColor(@(0xffecf0f1)) : [UIColor whiteColor];
|
||||||
|
[cell refreshUI:self.anchorItems[position]];
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||||
|
return self.anchorItems.count;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
NSUInteger position = (NSUInteger) indexPath.row;
|
||||||
|
return [self.anchorItems[position] cellHeight];
|
||||||
|
}
|
||||||
|
@end
|
@ -20,5 +20,13 @@
|
|||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <DoricCore/Doric.h>
|
#import <DoricCore/Doric.h>
|
||||||
|
|
||||||
@interface DoricDevPerformanceAnchorHook : NSObject<DoricPerformanceGlobalAnchorHookProtocol>
|
@interface DoricDevAnchorNode : NSObject
|
||||||
|
@property(nonatomic, copy) NSString *name;
|
||||||
|
@property(nonatomic, assign) long prepare;
|
||||||
|
@property(nonatomic, assign) long start;
|
||||||
|
@property(nonatomic, assign) long end;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface DoricDevPerformanceAnchorHook : NSObject <DoricPerformanceGlobalAnchorHookProtocol>
|
||||||
|
- (NSArray <DoricDevAnchorNode *> *)getAnchorNodeList:(NSString *)name;
|
||||||
@end
|
@end
|
@ -19,8 +19,32 @@
|
|||||||
|
|
||||||
#import "DoricDevPerformanceAnchorHook.h"
|
#import "DoricDevPerformanceAnchorHook.h"
|
||||||
|
|
||||||
|
@implementation DoricDevAnchorNode
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface DoricDevPerformanceAnchorHook ()
|
||||||
|
@property(nonatomic, strong) NSMutableDictionary<NSString *, NSMutableArray <DoricDevAnchorNode *> *> *nodeMap;
|
||||||
|
@property(nonatomic, copy) NSComparator comparator;
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation DoricDevPerformanceAnchorHook
|
@implementation DoricDevPerformanceAnchorHook
|
||||||
|
- (instancetype)init {
|
||||||
|
if (self = [super init]) {
|
||||||
|
_nodeMap = [NSMutableDictionary new];
|
||||||
|
_comparator = ^NSComparisonResult(DoricDevAnchorNode *obj1, DoricDevAnchorNode *obj2) {
|
||||||
|
long ret = obj1.prepare - obj2.prepare;
|
||||||
|
if (ret > 0) {
|
||||||
|
return NSOrderedDescending;
|
||||||
|
} else if (ret < 0) {
|
||||||
|
return NSOrderedAscending;
|
||||||
|
} else {
|
||||||
|
return NSOrderedSame;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)onAnchorName:(NSString *)name prepare:(NSNumber *)prepare start:(NSNumber *)start end:(NSNumber *)end in:(DoricPerformanceProfile *)profile {
|
- (void)onAnchorName:(NSString *)name prepare:(NSNumber *)prepare start:(NSNumber *)start end:(NSNumber *)end in:(DoricPerformanceProfile *)profile {
|
||||||
NSLog(@"[DoricPerformance] %@: %@ prepared %@ms, cost %@ms",
|
NSLog(@"[DoricPerformance] %@: %@ prepared %@ms, cost %@ms",
|
||||||
profile.name,
|
profile.name,
|
||||||
@ -28,10 +52,28 @@ - (void)onAnchorName:(NSString *)name prepare:(NSNumber *)prepare start:(NSNumbe
|
|||||||
@(start.integerValue - prepare.integerValue),
|
@(start.integerValue - prepare.integerValue),
|
||||||
@(end.integerValue - start.integerValue)
|
@(end.integerValue - start.integerValue)
|
||||||
);
|
);
|
||||||
|
NSMutableArray<DoricDevAnchorNode *> *array = self.nodeMap[profile.name];
|
||||||
|
if (!array) {
|
||||||
|
array = [NSMutableArray new];
|
||||||
|
self.nodeMap[profile.name] = array;
|
||||||
|
}
|
||||||
|
[array addObject:[[DoricDevAnchorNode new] also:^(DoricDevAnchorNode *it) {
|
||||||
|
it.name = name;
|
||||||
|
it.prepare = prepare.longValue;
|
||||||
|
it.start = start.longValue;
|
||||||
|
it.end = end.longValue;
|
||||||
|
}]];
|
||||||
|
[array sortUsingComparator:self.comparator];
|
||||||
|
if ([name isEqualToString:@"Destroy"]) {
|
||||||
|
[self.nodeMap removeObjectForKey:profile.name];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)onAnchorName:(NSString *)name prepare:(NSNumber *)prepare start:(NSNumber *)start end:(NSNumber *)end {
|
- (void)onAnchorName:(NSString *)name prepare:(NSNumber *)prepare start:(NSNumber *)start end:(NSNumber *)end {
|
||||||
//Do nothing
|
//Do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSArray <DoricDevAnchorNode *> *)getAnchorNodeList:(NSString *)name {
|
||||||
|
return [self.nodeMap[name] copy];
|
||||||
|
}
|
||||||
@end
|
@end
|
@ -31,6 +31,7 @@
|
|||||||
#import "DoricShowNodeTreeViewController.h"
|
#import "DoricShowNodeTreeViewController.h"
|
||||||
#import "DoricRegistry.h"
|
#import "DoricRegistry.h"
|
||||||
#import "DoricSnapshotView.h"
|
#import "DoricSnapshotView.h"
|
||||||
|
#import "DoricDevPerfVC.h"
|
||||||
|
|
||||||
@interface DoricContextCell : UITableViewCell
|
@interface DoricContextCell : UITableViewCell
|
||||||
@property(nonatomic, strong) UILabel *tvId;
|
@property(nonatomic, strong) UILabel *tvId;
|
||||||
@ -109,22 +110,8 @@ - (void)onClick {
|
|||||||
}];
|
}];
|
||||||
[alertController addAction:cancel];
|
[alertController addAction:cancel];
|
||||||
[alertController addAction:viewSource];
|
[alertController addAction:viewSource];
|
||||||
|
|
||||||
UIAlertAction *showNodeTree = [UIAlertAction actionWithTitle:@"Show node tree" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_) {
|
|
||||||
DoricShowNodeTreeViewController *doricShowNodeTreeViewController = [[DoricShowNodeTreeViewController alloc] init];
|
|
||||||
doricShowNodeTreeViewController.contextId = self.doricContext.contextId;
|
|
||||||
|
|
||||||
UIViewController *viewController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
|
||||||
UINavigationController *navigationController;
|
|
||||||
if ([viewController isKindOfClass:[UINavigationController class]]) {
|
|
||||||
navigationController = (UINavigationController *) viewController;
|
|
||||||
} else {
|
|
||||||
navigationController = viewController.navigationController;
|
|
||||||
}
|
|
||||||
[navigationController pushViewController:doricShowNodeTreeViewController animated:NO];
|
|
||||||
}];
|
|
||||||
[alertController addAction:showNodeTree];
|
|
||||||
|
|
||||||
if (DoricDev.instance.isInDevMode) {
|
if (DoricDev.instance.isInDevMode) {
|
||||||
if ([self.doricContext.driver isKindOfClass:DoricDebugDriver.class]) {
|
if ([self.doricContext.driver isKindOfClass:DoricDebugDriver.class]) {
|
||||||
UIAlertAction *stopDebugging = [UIAlertAction actionWithTitle:@"Stop debugging" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_) {
|
UIAlertAction *stopDebugging = [UIAlertAction actionWithTitle:@"Stop debugging" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_) {
|
||||||
@ -148,6 +135,39 @@ - (void)onClick {
|
|||||||
[alertController addAction:snapshot];
|
[alertController addAction:snapshot];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ([DoricRegistry isEnablePerformance]) {
|
||||||
|
UIAlertAction *performanceAction = [UIAlertAction
|
||||||
|
actionWithTitle:@"Performance"
|
||||||
|
style:UIAlertActionStyleDefault
|
||||||
|
handler:^(UIAlertAction *_) {
|
||||||
|
DoricDevPerfVC *doricDevPerfVc = [[DoricDevPerfVC alloc] initWithContextId:self.doricContext.contextId];
|
||||||
|
UIViewController *viewController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
||||||
|
UINavigationController *navigationController;
|
||||||
|
if ([viewController isKindOfClass:[UINavigationController class]]) {
|
||||||
|
navigationController = (UINavigationController *) viewController;
|
||||||
|
} else {
|
||||||
|
navigationController = viewController.navigationController;
|
||||||
|
}
|
||||||
|
[navigationController pushViewController:doricDevPerfVc animated:NO];
|
||||||
|
}];
|
||||||
|
[alertController addAction:performanceAction];
|
||||||
|
}
|
||||||
|
|
||||||
|
UIAlertAction *showNodeTree = [UIAlertAction actionWithTitle:@"View node tree" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_) {
|
||||||
|
DoricShowNodeTreeViewController *doricShowNodeTreeViewController = [[DoricShowNodeTreeViewController alloc] init];
|
||||||
|
doricShowNodeTreeViewController.contextId = self.doricContext.contextId;
|
||||||
|
|
||||||
|
UIViewController *viewController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
||||||
|
UINavigationController *navigationController;
|
||||||
|
if ([viewController isKindOfClass:[UINavigationController class]]) {
|
||||||
|
navigationController = (UINavigationController *) viewController;
|
||||||
|
} else {
|
||||||
|
navigationController = viewController.navigationController;
|
||||||
|
}
|
||||||
|
[navigationController pushViewController:doricShowNodeTreeViewController animated:NO];
|
||||||
|
}];
|
||||||
|
[alertController addAction:showNodeTree];
|
||||||
|
|
||||||
[self.vc presentViewController:alertController animated:true completion:nil];
|
[self.vc presentViewController:alertController animated:true completion:nil];
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
@ -23,6 +23,7 @@ @implementation ViewController
|
|||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
self.title = @"Doric Demo";
|
self.title = @"Doric Demo";
|
||||||
|
[DoricDev instance];
|
||||||
[self.navigationController.navigationBar setBackgroundImage:UIImageWithColor(UIColor.whiteColor) forBarMetrics:UIBarMetricsDefault];
|
[self.navigationController.navigationBar setBackgroundImage:UIImageWithColor(UIColor.whiteColor) forBarMetrics:UIBarMetricsDefault];
|
||||||
NSString *path = [[NSBundle mainBundle] bundlePath];
|
NSString *path = [[NSBundle mainBundle] bundlePath];
|
||||||
NSString *demoPath = [path stringByAppendingPathComponent:@"src"];
|
NSString *demoPath = [path stringByAppendingPathComponent:@"src"];
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
// DoricCore
|
// DoricCore
|
||||||
//
|
//
|
||||||
// Created by pengfei.zhou on 2021/3/29.
|
// Created by pengfei.zhou on 2021/3/29.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DoricPerformanceProfile.h"
|
#import "DoricPerformanceProfile.h"
|
||||||
#import "DoricRegistry.h"
|
#import "DoricRegistry.h"
|
||||||
@ -109,7 +109,7 @@ - (void)print:(NSString *)anchorName {
|
|||||||
}
|
}
|
||||||
for (id <DoricPerformanceAnchorHookProtocol> hook in self.hooks) {
|
for (id <DoricPerformanceAnchorHookProtocol> hook in self.hooks) {
|
||||||
if ([hook conformsToProtocol:@protocol(DoricPerformanceGlobalAnchorHookProtocol)]) {
|
if ([hook conformsToProtocol:@protocol(DoricPerformanceGlobalAnchorHookProtocol)]) {
|
||||||
[(id <DoricPerformanceGlobalAnchorHookProtocol>) hook onAnchorName:anchorName prepare:end start:end end:end in:self];
|
[(id <DoricPerformanceGlobalAnchorHookProtocol>) hook onAnchorName:anchorName prepare:prepare start:start end:end in:self];
|
||||||
} else {
|
} else {
|
||||||
[hook onAnchorName:anchorName prepare:prepare start:start end:end];
|
[hook onAnchorName:anchorName prepare:prepare start:start end:end];
|
||||||
}
|
}
|
||||||
|
@ -1677,7 +1677,7 @@ var doric = (function (exports) {
|
|||||||
|
|
||||||
var hasOwnProperty = {}.hasOwnProperty;
|
var hasOwnProperty = {}.hasOwnProperty;
|
||||||
|
|
||||||
var has$1 = Object.hasOwn || function hasOwn(it, key) {
|
var has$1 = function hasOwn(it, key) {
|
||||||
return hasOwnProperty.call(toObject(it), key);
|
return hasOwnProperty.call(toObject(it), key);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1764,7 +1764,7 @@ var doric = (function (exports) {
|
|||||||
|
|
||||||
var functionToString = Function.toString;
|
var functionToString = Function.toString;
|
||||||
|
|
||||||
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
|
||||||
if (typeof sharedStore.inspectSource != 'function') {
|
if (typeof sharedStore.inspectSource != 'function') {
|
||||||
sharedStore.inspectSource = function (it) {
|
sharedStore.inspectSource = function (it) {
|
||||||
return functionToString.call(it);
|
return functionToString.call(it);
|
||||||
@ -1783,7 +1783,7 @@ var doric = (function (exports) {
|
|||||||
(module.exports = function (key, value) {
|
(module.exports = function (key, value) {
|
||||||
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
||||||
})('versions', []).push({
|
})('versions', []).push({
|
||||||
version: '3.14.0',
|
version: '3.12.1',
|
||||||
mode: 'global',
|
mode: 'global',
|
||||||
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
||||||
});
|
});
|
||||||
@ -1911,12 +1911,12 @@ var doric = (function (exports) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var ceil$2 = Math.ceil;
|
var ceil$2 = Math.ceil;
|
||||||
var floor$a = Math.floor;
|
var floor$9 = Math.floor;
|
||||||
|
|
||||||
// `ToInteger` abstract operation
|
// `ToInteger` abstract operation
|
||||||
// https://tc39.es/ecma262/#sec-tointeger
|
// https://tc39.es/ecma262/#sec-tointeger
|
||||||
var toInteger = function (argument) {
|
var toInteger = function (argument) {
|
||||||
return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor$a : ceil$2)(argument);
|
return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor$9 : ceil$2)(argument);
|
||||||
};
|
};
|
||||||
|
|
||||||
var min$9 = Math.min;
|
var min$9 = Math.min;
|
||||||
@ -2131,10 +2131,8 @@ var doric = (function (exports) {
|
|||||||
|
|
||||||
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
||||||
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
||||||
var symbol = Symbol();
|
return !String(Symbol()) ||
|
||||||
// Chrome 38 Symbol has incorrect toString conversion
|
// Chrome 38 Symbol has incorrect toString conversion
|
||||||
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
||||||
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
||||||
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
||||||
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
||||||
});
|
});
|
||||||
@ -3288,6 +3286,7 @@ var doric = (function (exports) {
|
|||||||
var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
|
var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
|
||||||
try {
|
try {
|
||||||
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
||||||
|
// 7.4.6 IteratorClose(iterator, completion)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
iteratorClose(iterator);
|
iteratorClose(iterator);
|
||||||
throw error;
|
throw error;
|
||||||
@ -3444,8 +3443,7 @@ var doric = (function (exports) {
|
|||||||
|
|
||||||
if (NEW_ITERATOR_PROTOTYPE) { IteratorPrototype$3 = {}; }
|
if (NEW_ITERATOR_PROTOTYPE) { IteratorPrototype$3 = {}; }
|
||||||
|
|
||||||
// `%IteratorPrototype%[@@iterator]()` method
|
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
|
||||||
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
||||||
if (!has$1(IteratorPrototype$3, ITERATOR$5)) {
|
if (!has$1(IteratorPrototype$3, ITERATOR$5)) {
|
||||||
createNonEnumerableProperty(IteratorPrototype$3, ITERATOR$5, returnThis$2);
|
createNonEnumerableProperty(IteratorPrototype$3, ITERATOR$5, returnThis$2);
|
||||||
}
|
}
|
||||||
@ -3519,7 +3517,7 @@ var doric = (function (exports) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
// fix Array#{values, @@iterator}.name in V8 / FF
|
||||||
if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
||||||
INCORRECT_VALUES_NAME = true;
|
INCORRECT_VALUES_NAME = true;
|
||||||
defaultIterator = function values() { return nativeIterator.call(this); };
|
defaultIterator = function values() { return nativeIterator.call(this); };
|
||||||
@ -3816,64 +3814,8 @@ var doric = (function (exports) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: use something more complex like timsort?
|
|
||||||
var floor$9 = Math.floor;
|
|
||||||
|
|
||||||
var mergeSort = function (array, comparefn) {
|
|
||||||
var length = array.length;
|
|
||||||
var middle = floor$9(length / 2);
|
|
||||||
return length < 8 ? insertionSort(array, comparefn) : merge(
|
|
||||||
mergeSort(array.slice(0, middle), comparefn),
|
|
||||||
mergeSort(array.slice(middle), comparefn),
|
|
||||||
comparefn
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
var insertionSort = function (array, comparefn) {
|
|
||||||
var length = array.length;
|
|
||||||
var i = 1;
|
|
||||||
var element, j;
|
|
||||||
|
|
||||||
while (i < length) {
|
|
||||||
j = i;
|
|
||||||
element = array[i];
|
|
||||||
while (j && comparefn(array[j - 1], element) > 0) {
|
|
||||||
array[j] = array[--j];
|
|
||||||
}
|
|
||||||
if (j !== i++) { array[j] = element; }
|
|
||||||
} return array;
|
|
||||||
};
|
|
||||||
|
|
||||||
var merge = function (left, right, comparefn) {
|
|
||||||
var llength = left.length;
|
|
||||||
var rlength = right.length;
|
|
||||||
var lindex = 0;
|
|
||||||
var rindex = 0;
|
|
||||||
var result = [];
|
|
||||||
|
|
||||||
while (lindex < llength || rindex < rlength) {
|
|
||||||
if (lindex < llength && rindex < rlength) {
|
|
||||||
result.push(comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]);
|
|
||||||
} else {
|
|
||||||
result.push(lindex < llength ? left[lindex++] : right[rindex++]);
|
|
||||||
}
|
|
||||||
} return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
var arraySort = mergeSort;
|
|
||||||
|
|
||||||
var firefox = engineUserAgent.match(/firefox\/(\d+)/i);
|
|
||||||
|
|
||||||
var engineFfVersion = !!firefox && +firefox[1];
|
|
||||||
|
|
||||||
var engineIsIeOrEdge = /MSIE|Trident/.test(engineUserAgent);
|
|
||||||
|
|
||||||
var webkit = engineUserAgent.match(/AppleWebKit\/(\d+)\./);
|
|
||||||
|
|
||||||
var engineWebkitVersion = !!webkit && +webkit[1];
|
|
||||||
|
|
||||||
var test = [];
|
var test = [];
|
||||||
var nativeSort$1 = test.sort;
|
var nativeSort = test.sort;
|
||||||
|
|
||||||
// IE8-
|
// IE8-
|
||||||
var FAILS_ON_UNDEFINED = fails(function () {
|
var FAILS_ON_UNDEFINED = fails(function () {
|
||||||
@ -3886,78 +3828,15 @@ var doric = (function (exports) {
|
|||||||
// Old WebKit
|
// Old WebKit
|
||||||
var STRICT_METHOD = arrayMethodIsStrict('sort');
|
var STRICT_METHOD = arrayMethodIsStrict('sort');
|
||||||
|
|
||||||
var STABLE_SORT$1 = !fails(function () {
|
var FORCED$l = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD;
|
||||||
// feature detection can be too slow, so check engines versions
|
|
||||||
if (engineV8Version) { return engineV8Version < 70; }
|
|
||||||
if (engineFfVersion && engineFfVersion > 3) { return; }
|
|
||||||
if (engineIsIeOrEdge) { return true; }
|
|
||||||
if (engineWebkitVersion) { return engineWebkitVersion < 603; }
|
|
||||||
|
|
||||||
var result = '';
|
|
||||||
var code, chr, value, index;
|
|
||||||
|
|
||||||
// generate an array with more 512 elements (Chakra and old V8 fails only in this case)
|
|
||||||
for (code = 65; code < 76; code++) {
|
|
||||||
chr = String.fromCharCode(code);
|
|
||||||
|
|
||||||
switch (code) {
|
|
||||||
case 66: case 69: case 70: case 72: value = 3; break;
|
|
||||||
case 68: case 71: value = 4; break;
|
|
||||||
default: value = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (index = 0; index < 47; index++) {
|
|
||||||
test.push({ k: chr + index, v: value });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
test.sort(function (a, b) { return b.v - a.v; });
|
|
||||||
|
|
||||||
for (index = 0; index < test.length; index++) {
|
|
||||||
chr = test[index].k.charAt(0);
|
|
||||||
if (result.charAt(result.length - 1) !== chr) { result += chr; }
|
|
||||||
}
|
|
||||||
|
|
||||||
return result !== 'DGBEFHACIJK';
|
|
||||||
});
|
|
||||||
|
|
||||||
var FORCED$l = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT$1;
|
|
||||||
|
|
||||||
var getSortCompare$1 = function (comparefn) {
|
|
||||||
return function (x, y) {
|
|
||||||
if (y === undefined) { return -1; }
|
|
||||||
if (x === undefined) { return 1; }
|
|
||||||
if (comparefn !== undefined) { return +comparefn(x, y) || 0; }
|
|
||||||
return String(x) > String(y) ? 1 : -1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// `Array.prototype.sort` method
|
// `Array.prototype.sort` method
|
||||||
// https://tc39.es/ecma262/#sec-array.prototype.sort
|
// https://tc39.es/ecma262/#sec-array.prototype.sort
|
||||||
_export({ target: 'Array', proto: true, forced: FORCED$l }, {
|
_export({ target: 'Array', proto: true, forced: FORCED$l }, {
|
||||||
sort: function sort(comparefn) {
|
sort: function sort(comparefn) {
|
||||||
if (comparefn !== undefined) { aFunction(comparefn); }
|
return comparefn === undefined
|
||||||
|
? nativeSort.call(toObject(this))
|
||||||
var array = toObject(this);
|
: nativeSort.call(toObject(this), aFunction(comparefn));
|
||||||
|
|
||||||
if (STABLE_SORT$1) { return comparefn === undefined ? nativeSort$1.call(array) : nativeSort$1.call(array, comparefn); }
|
|
||||||
|
|
||||||
var items = [];
|
|
||||||
var arrayLength = toLength(array.length);
|
|
||||||
var itemsLength, index;
|
|
||||||
|
|
||||||
for (index = 0; index < arrayLength; index++) {
|
|
||||||
if (index in array) { items.push(array[index]); }
|
|
||||||
}
|
|
||||||
|
|
||||||
items = arraySort(items, getSortCompare$1(comparefn));
|
|
||||||
itemsLength = items.length;
|
|
||||||
index = 0;
|
|
||||||
|
|
||||||
while (index < itemsLength) { array[index] = items[index++]; }
|
|
||||||
while (index < arrayLength) { delete array[index++]; }
|
|
||||||
|
|
||||||
return array;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -4707,8 +4586,6 @@ var doric = (function (exports) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// `Date.prototype[@@toPrimitive](hint)` method implementation
|
|
||||||
// https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive
|
|
||||||
var dateToPrimitive = function (hint) {
|
var dateToPrimitive = function (hint) {
|
||||||
if (hint !== 'string' && hint !== 'number' && hint !== 'default') {
|
if (hint !== 'string' && hint !== 'number' && hint !== 'default') {
|
||||||
throw TypeError('Incorrect hint');
|
throw TypeError('Incorrect hint');
|
||||||
@ -5091,9 +4968,8 @@ var doric = (function (exports) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
redefineAll(C.prototype, {
|
redefineAll(C.prototype, {
|
||||||
// `{ Map, Set }.prototype.clear()` methods
|
// 23.1.3.1 Map.prototype.clear()
|
||||||
// https://tc39.es/ecma262/#sec-map.prototype.clear
|
// 23.2.3.2 Set.prototype.clear()
|
||||||
// https://tc39.es/ecma262/#sec-set.prototype.clear
|
|
||||||
clear: function clear() {
|
clear: function clear() {
|
||||||
var that = this;
|
var that = this;
|
||||||
var state = getInternalState(that);
|
var state = getInternalState(that);
|
||||||
@ -5109,9 +4985,8 @@ var doric = (function (exports) {
|
|||||||
if (descriptors) { state.size = 0; }
|
if (descriptors) { state.size = 0; }
|
||||||
else { that.size = 0; }
|
else { that.size = 0; }
|
||||||
},
|
},
|
||||||
// `{ Map, Set }.prototype.delete(key)` methods
|
// 23.1.3.3 Map.prototype.delete(key)
|
||||||
// https://tc39.es/ecma262/#sec-map.prototype.delete
|
// 23.2.3.4 Set.prototype.delete(value)
|
||||||
// https://tc39.es/ecma262/#sec-set.prototype.delete
|
|
||||||
'delete': function (key) {
|
'delete': function (key) {
|
||||||
var that = this;
|
var that = this;
|
||||||
var state = getInternalState(that);
|
var state = getInternalState(that);
|
||||||
@ -5129,9 +5004,8 @@ var doric = (function (exports) {
|
|||||||
else { that.size--; }
|
else { that.size--; }
|
||||||
} return !!entry;
|
} return !!entry;
|
||||||
},
|
},
|
||||||
// `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods
|
// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
|
||||||
// https://tc39.es/ecma262/#sec-map.prototype.foreach
|
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
|
||||||
// https://tc39.es/ecma262/#sec-set.prototype.foreach
|
|
||||||
forEach: function forEach(callbackfn /* , that = undefined */) {
|
forEach: function forEach(callbackfn /* , that = undefined */) {
|
||||||
var state = getInternalState(this);
|
var state = getInternalState(this);
|
||||||
var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
|
var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
|
||||||
@ -5142,29 +5016,25 @@ var doric = (function (exports) {
|
|||||||
while (entry && entry.removed) { entry = entry.previous; }
|
while (entry && entry.removed) { entry = entry.previous; }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// `{ Map, Set}.prototype.has(key)` methods
|
// 23.1.3.7 Map.prototype.has(key)
|
||||||
// https://tc39.es/ecma262/#sec-map.prototype.has
|
// 23.2.3.7 Set.prototype.has(value)
|
||||||
// https://tc39.es/ecma262/#sec-set.prototype.has
|
|
||||||
has: function has(key) {
|
has: function has(key) {
|
||||||
return !!getEntry(this, key);
|
return !!getEntry(this, key);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
redefineAll(C.prototype, IS_MAP ? {
|
redefineAll(C.prototype, IS_MAP ? {
|
||||||
// `Map.prototype.get(key)` method
|
// 23.1.3.6 Map.prototype.get(key)
|
||||||
// https://tc39.es/ecma262/#sec-map.prototype.get
|
|
||||||
get: function get(key) {
|
get: function get(key) {
|
||||||
var entry = getEntry(this, key);
|
var entry = getEntry(this, key);
|
||||||
return entry && entry.value;
|
return entry && entry.value;
|
||||||
},
|
},
|
||||||
// `Map.prototype.set(key, value)` method
|
// 23.1.3.9 Map.prototype.set(key, value)
|
||||||
// https://tc39.es/ecma262/#sec-map.prototype.set
|
|
||||||
set: function set(key, value) {
|
set: function set(key, value) {
|
||||||
return define(this, key === 0 ? 0 : key, value);
|
return define(this, key === 0 ? 0 : key, value);
|
||||||
}
|
}
|
||||||
} : {
|
} : {
|
||||||
// `Set.prototype.add(value)` method
|
// 23.2.3.1 Set.prototype.add(value)
|
||||||
// https://tc39.es/ecma262/#sec-set.prototype.add
|
|
||||||
add: function add(value) {
|
add: function add(value) {
|
||||||
return define(this, value = value === 0 ? 0 : value, value);
|
return define(this, value = value === 0 ? 0 : value, value);
|
||||||
}
|
}
|
||||||
@ -5180,15 +5050,8 @@ var doric = (function (exports) {
|
|||||||
var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
|
var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
|
||||||
var getInternalCollectionState = internalStateGetterFor$1(CONSTRUCTOR_NAME);
|
var getInternalCollectionState = internalStateGetterFor$1(CONSTRUCTOR_NAME);
|
||||||
var getInternalIteratorState = internalStateGetterFor$1(ITERATOR_NAME);
|
var getInternalIteratorState = internalStateGetterFor$1(ITERATOR_NAME);
|
||||||
// `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods
|
// add .keys, .values, .entries, [@@iterator]
|
||||||
// https://tc39.es/ecma262/#sec-map.prototype.entries
|
// 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
|
||||||
// https://tc39.es/ecma262/#sec-map.prototype.keys
|
|
||||||
// https://tc39.es/ecma262/#sec-map.prototype.values
|
|
||||||
// https://tc39.es/ecma262/#sec-map.prototype-@@iterator
|
|
||||||
// https://tc39.es/ecma262/#sec-set.prototype.entries
|
|
||||||
// https://tc39.es/ecma262/#sec-set.prototype.keys
|
|
||||||
// https://tc39.es/ecma262/#sec-set.prototype.values
|
|
||||||
// https://tc39.es/ecma262/#sec-set.prototype-@@iterator
|
|
||||||
defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
|
defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
|
||||||
setInternalState$d(this, {
|
setInternalState$d(this, {
|
||||||
type: ITERATOR_NAME,
|
type: ITERATOR_NAME,
|
||||||
@ -5215,9 +5078,7 @@ var doric = (function (exports) {
|
|||||||
return { value: [entry.key, entry.value], done: false };
|
return { value: [entry.key, entry.value], done: false };
|
||||||
}, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
|
}, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
|
||||||
|
|
||||||
// `{ Map, Set }.prototype[@@species]` accessors
|
// add [@@species], 23.1.2.2, 23.2.2.2
|
||||||
// https://tc39.es/ecma262/#sec-get-map-@@species
|
|
||||||
// https://tc39.es/ecma262/#sec-get-set-@@species
|
|
||||||
setSpecies(CONSTRUCTOR_NAME);
|
setSpecies(CONSTRUCTOR_NAME);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -5934,9 +5795,6 @@ var doric = (function (exports) {
|
|||||||
|
|
||||||
// Forced replacement object prototype accessors methods
|
// Forced replacement object prototype accessors methods
|
||||||
var objectPrototypeAccessorsForced = !fails(function () {
|
var objectPrototypeAccessorsForced = !fails(function () {
|
||||||
// This feature detection crashes old WebKit
|
|
||||||
// https://github.com/zloirock/core-js/issues/232
|
|
||||||
if (engineWebkitVersion && engineWebkitVersion < 535) { return; }
|
|
||||||
var key = Math.random();
|
var key = Math.random();
|
||||||
// In FF throws only define methods
|
// In FF throws only define methods
|
||||||
// eslint-disable-next-line no-undef, no-useless-call -- required for testing
|
// eslint-disable-next-line no-undef, no-useless-call -- required for testing
|
||||||
@ -6462,8 +6320,7 @@ var doric = (function (exports) {
|
|||||||
this.reject = aFunction(reject);
|
this.reject = aFunction(reject);
|
||||||
};
|
};
|
||||||
|
|
||||||
// `NewPromiseCapability` abstract operation
|
// 25.4.1.5 NewPromiseCapability(C)
|
||||||
// https://tc39.es/ecma262/#sec-newpromisecapability
|
|
||||||
var f = function (C) {
|
var f = function (C) {
|
||||||
return new PromiseCapability(C);
|
return new PromiseCapability(C);
|
||||||
};
|
};
|
||||||
@ -8041,7 +7898,6 @@ var doric = (function (exports) {
|
|||||||
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
||||||
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
||||||
|
|
||||||
// `GetSubstitution` abstract operation
|
|
||||||
// https://tc39.es/ecma262/#sec-getsubstitution
|
// https://tc39.es/ecma262/#sec-getsubstitution
|
||||||
var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
|
var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
|
||||||
var tailPos = position + matched.length;
|
var tailPos = position + matched.length;
|
||||||
@ -8464,7 +8320,7 @@ var doric = (function (exports) {
|
|||||||
|
|
||||||
var quot = /"/g;
|
var quot = /"/g;
|
||||||
|
|
||||||
// `CreateHTML` abstract operation
|
// B.2.3.2.1 CreateHTML(string, tag, attribute, value)
|
||||||
// https://tc39.es/ecma262/#sec-createhtml
|
// https://tc39.es/ecma262/#sec-createhtml
|
||||||
var createHtml = function (string, tag, attribute, value) {
|
var createHtml = function (string, tag, attribute, value) {
|
||||||
var S = String(requireObjectCoercible(string));
|
var S = String(requireObjectCoercible(string));
|
||||||
@ -9251,78 +9107,13 @@ var doric = (function (exports) {
|
|||||||
|
|
||||||
var aTypedArray$7 = arrayBufferViewCore.aTypedArray;
|
var aTypedArray$7 = arrayBufferViewCore.aTypedArray;
|
||||||
var exportTypedArrayMethod$8 = arrayBufferViewCore.exportTypedArrayMethod;
|
var exportTypedArrayMethod$8 = arrayBufferViewCore.exportTypedArrayMethod;
|
||||||
var Uint16Array = global_1.Uint16Array;
|
var $sort = [].sort;
|
||||||
var nativeSort = Uint16Array && Uint16Array.prototype.sort;
|
|
||||||
|
|
||||||
// WebKit
|
|
||||||
var ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !fails(function () {
|
|
||||||
var array = new Uint16Array(2);
|
|
||||||
array.sort(null);
|
|
||||||
array.sort({});
|
|
||||||
});
|
|
||||||
|
|
||||||
var STABLE_SORT = !!nativeSort && !fails(function () {
|
|
||||||
// feature detection can be too slow, so check engines versions
|
|
||||||
if (engineV8Version) { return engineV8Version < 74; }
|
|
||||||
if (engineFfVersion) { return engineFfVersion < 67; }
|
|
||||||
if (engineIsIeOrEdge) { return true; }
|
|
||||||
if (engineWebkitVersion) { return engineWebkitVersion < 602; }
|
|
||||||
|
|
||||||
var array = new Uint16Array(516);
|
|
||||||
var expected = Array(516);
|
|
||||||
var index, mod;
|
|
||||||
|
|
||||||
for (index = 0; index < 516; index++) {
|
|
||||||
mod = index % 4;
|
|
||||||
array[index] = 515 - index;
|
|
||||||
expected[index] = index - 2 * mod + 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
array.sort(function (a, b) {
|
|
||||||
return (a / 4 | 0) - (b / 4 | 0);
|
|
||||||
});
|
|
||||||
|
|
||||||
for (index = 0; index < 516; index++) {
|
|
||||||
if (array[index] !== expected[index]) { return true; }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var getSortCompare = function (comparefn) {
|
|
||||||
return function (x, y) {
|
|
||||||
if (comparefn !== undefined) { return +comparefn(x, y) || 0; }
|
|
||||||
// eslint-disable-next-line no-self-compare -- NaN check
|
|
||||||
if (y !== y) { return -1; }
|
|
||||||
// eslint-disable-next-line no-self-compare -- NaN check
|
|
||||||
if (x !== x) { return 1; }
|
|
||||||
if (x === 0 && y === 0) { return 1 / x > 0 && 1 / y < 0 ? 1 : -1; }
|
|
||||||
return x > y;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// `%TypedArray%.prototype.sort` method
|
// `%TypedArray%.prototype.sort` method
|
||||||
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort
|
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort
|
||||||
exportTypedArrayMethod$8('sort', function sort(comparefn) {
|
exportTypedArrayMethod$8('sort', function sort(comparefn) {
|
||||||
var array = this;
|
return $sort.call(aTypedArray$7(this), comparefn);
|
||||||
if (comparefn !== undefined) { aFunction(comparefn); }
|
});
|
||||||
if (STABLE_SORT) { return nativeSort.call(array, comparefn); }
|
|
||||||
|
|
||||||
aTypedArray$7(array);
|
|
||||||
var arrayLength = toLength(array.length);
|
|
||||||
var items = Array(arrayLength);
|
|
||||||
var index;
|
|
||||||
|
|
||||||
for (index = 0; index < arrayLength; index++) {
|
|
||||||
items[index] = array[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
items = arraySort(array, getSortCompare(comparefn));
|
|
||||||
|
|
||||||
for (index = 0; index < arrayLength; index++) {
|
|
||||||
array[index] = items[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
return array;
|
|
||||||
}, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);
|
|
||||||
|
|
||||||
var aTypedArray$6 = arrayBufferViewCore.aTypedArray;
|
var aTypedArray$6 = arrayBufferViewCore.aTypedArray;
|
||||||
var exportTypedArrayMethod$7 = arrayBufferViewCore.exportTypedArrayMethod;
|
var exportTypedArrayMethod$7 = arrayBufferViewCore.exportTypedArrayMethod;
|
||||||
@ -9459,9 +9250,8 @@ var doric = (function (exports) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
redefineAll(C.prototype, {
|
redefineAll(C.prototype, {
|
||||||
// `{ WeakMap, WeakSet }.prototype.delete(key)` methods
|
// 23.3.3.2 WeakMap.prototype.delete(key)
|
||||||
// https://tc39.es/ecma262/#sec-weakmap.prototype.delete
|
// 23.4.3.3 WeakSet.prototype.delete(value)
|
||||||
// https://tc39.es/ecma262/#sec-weakset.prototype.delete
|
|
||||||
'delete': function (key) {
|
'delete': function (key) {
|
||||||
var state = getInternalState(this);
|
var state = getInternalState(this);
|
||||||
if (!isObject(key)) { return false; }
|
if (!isObject(key)) { return false; }
|
||||||
@ -9469,9 +9259,8 @@ var doric = (function (exports) {
|
|||||||
if (data === true) { return uncaughtFrozenStore(state)['delete'](key); }
|
if (data === true) { return uncaughtFrozenStore(state)['delete'](key); }
|
||||||
return data && has$1(data, state.id) && delete data[state.id];
|
return data && has$1(data, state.id) && delete data[state.id];
|
||||||
},
|
},
|
||||||
// `{ WeakMap, WeakSet }.prototype.has(key)` methods
|
// 23.3.3.4 WeakMap.prototype.has(key)
|
||||||
// https://tc39.es/ecma262/#sec-weakmap.prototype.has
|
// 23.4.3.4 WeakSet.prototype.has(value)
|
||||||
// https://tc39.es/ecma262/#sec-weakset.prototype.has
|
|
||||||
has: function has(key) {
|
has: function has(key) {
|
||||||
var state = getInternalState(this);
|
var state = getInternalState(this);
|
||||||
if (!isObject(key)) { return false; }
|
if (!isObject(key)) { return false; }
|
||||||
@ -9482,8 +9271,7 @@ var doric = (function (exports) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
redefineAll(C.prototype, IS_MAP ? {
|
redefineAll(C.prototype, IS_MAP ? {
|
||||||
// `WeakMap.prototype.get(key)` method
|
// 23.3.3.3 WeakMap.prototype.get(key)
|
||||||
// https://tc39.es/ecma262/#sec-weakmap.prototype.get
|
|
||||||
get: function get(key) {
|
get: function get(key) {
|
||||||
var state = getInternalState(this);
|
var state = getInternalState(this);
|
||||||
if (isObject(key)) {
|
if (isObject(key)) {
|
||||||
@ -9492,14 +9280,12 @@ var doric = (function (exports) {
|
|||||||
return data ? data[state.id] : undefined;
|
return data ? data[state.id] : undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// `WeakMap.prototype.set(key, value)` method
|
// 23.3.3.5 WeakMap.prototype.set(key, value)
|
||||||
// https://tc39.es/ecma262/#sec-weakmap.prototype.set
|
|
||||||
set: function set(key, value) {
|
set: function set(key, value) {
|
||||||
return define(this, key, value);
|
return define(this, key, value);
|
||||||
}
|
}
|
||||||
} : {
|
} : {
|
||||||
// `WeakSet.prototype.add(value)` method
|
// 23.4.3.1 WeakSet.prototype.add(value)
|
||||||
// https://tc39.es/ecma262/#sec-weakset.prototype.add
|
|
||||||
add: function add(value) {
|
add: function add(value) {
|
||||||
return define(this, value, true);
|
return define(this, value, true);
|
||||||
}
|
}
|
||||||
|
21
doric-web/dist/index.js
vendored
21
doric-web/dist/index.js
vendored
@ -3812,10 +3812,18 @@ __decorate$3([
|
|||||||
Property,
|
Property,
|
||||||
__metadata$3("design:type", Number)
|
__metadata$3("design:type", Number)
|
||||||
], Input.prototype, "textSize", void 0);
|
], Input.prototype, "textSize", void 0);
|
||||||
|
__decorate$3([
|
||||||
|
Property,
|
||||||
|
__metadata$3("design:type", String)
|
||||||
|
], Input.prototype, "font", void 0);
|
||||||
__decorate$3([
|
__decorate$3([
|
||||||
Property,
|
Property,
|
||||||
__metadata$3("design:type", String)
|
__metadata$3("design:type", String)
|
||||||
], Input.prototype, "hintText", void 0);
|
], Input.prototype, "hintText", void 0);
|
||||||
|
__decorate$3([
|
||||||
|
Property,
|
||||||
|
__metadata$3("design:type", String)
|
||||||
|
], Input.prototype, "hintFont", void 0);
|
||||||
__decorate$3([
|
__decorate$3([
|
||||||
Property,
|
Property,
|
||||||
__metadata$3("design:type", Number)
|
__metadata$3("design:type", Number)
|
||||||
@ -5196,7 +5204,7 @@ var doric_web = (function (exports, axios, sandbox) {
|
|||||||
}());
|
}());
|
||||||
});
|
});
|
||||||
|
|
||||||
var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
@ -5208,7 +5216,7 @@ var doric_web = (function (exports, axios, sandbox) {
|
|||||||
const loaders = [
|
const loaders = [
|
||||||
{
|
{
|
||||||
filter: () => true,
|
filter: () => true,
|
||||||
request: (source) => __awaiter$1(void 0, void 0, void 0, function* () {
|
request: (source) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const result = yield axios__default['default'].get(source);
|
const result = yield axios__default['default'].get(source);
|
||||||
return result.data;
|
return result.data;
|
||||||
})
|
})
|
||||||
@ -5218,7 +5226,7 @@ var doric_web = (function (exports, axios, sandbox) {
|
|||||||
loaders.push(loader);
|
loaders.push(loader);
|
||||||
}
|
}
|
||||||
function loadDoricJSBundle(source) {
|
function loadDoricJSBundle(source) {
|
||||||
return __awaiter$1(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const matched = loaders.filter(e => e.filter(source));
|
const matched = loaders.filter(e => e.filter(source));
|
||||||
if (matched.length > 0) {
|
if (matched.length > 0) {
|
||||||
return matched[matched.length - 1].request(source);
|
return matched[matched.length - 1].request(source);
|
||||||
@ -5235,7 +5243,6 @@ var doric_web = (function (exports, axios, sandbox) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.LayoutSpec = void 0;
|
|
||||||
(function (LayoutSpec) {
|
(function (LayoutSpec) {
|
||||||
LayoutSpec[LayoutSpec["EXACTLY"] = 0] = "EXACTLY";
|
LayoutSpec[LayoutSpec["EXACTLY"] = 0] = "EXACTLY";
|
||||||
LayoutSpec[LayoutSpec["WRAP_CONTENT"] = 1] = "WRAP_CONTENT";
|
LayoutSpec[LayoutSpec["WRAP_CONTENT"] = 1] = "WRAP_CONTENT";
|
||||||
@ -7641,7 +7648,7 @@ ${content}
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
@ -7655,7 +7662,7 @@ ${content}
|
|||||||
smoothscroll.polyfill();
|
smoothscroll.polyfill();
|
||||||
registerDoricJSLoader({
|
registerDoricJSLoader({
|
||||||
filter: (source) => source.startsWith("assets://"),
|
filter: (source) => source.startsWith("assets://"),
|
||||||
request: (source) => __awaiter(void 0, void 0, void 0, function* () {
|
request: (source) => __awaiter$1(void 0, void 0, void 0, function* () {
|
||||||
const ret = yield axios__default['default'].get(source.replace("assets://", `${window.location.href}/../../doric-demo/bundle/`));
|
const ret = yield axios__default['default'].get(source.replace("assets://", `${window.location.href}/../../doric-demo/bundle/`));
|
||||||
return ret.data;
|
return ret.data;
|
||||||
})
|
})
|
||||||
@ -7688,8 +7695,6 @@ ${content}
|
|||||||
exports.toPixelString = toPixelString;
|
exports.toPixelString = toPixelString;
|
||||||
exports.toRGBAString = toRGBAString;
|
exports.toRGBAString = toRGBAString;
|
||||||
|
|
||||||
Object.defineProperty(exports, '__esModule', { value: true });
|
|
||||||
|
|
||||||
return exports;
|
return exports;
|
||||||
|
|
||||||
}({}, axios, doric));
|
}({}, axios, doric));
|
||||||
|
6
doric-web/dist/index.js.map
vendored
6
doric-web/dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user