data);
11 | }
12 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/adapter/scriptloader/ScriptLoadCallback.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.adapter.scriptloader;
2 |
3 | /**
4 | * 脚本加载结果回调
5 | *
6 | * Created by XiaoFeng on 2021/2/16.
7 | */
8 | public interface ScriptLoadCallback {
9 |
10 | void onScriptLoad(String script, int errCode, String errMsg);
11 | }
12 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/context/HummerError.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.context;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * 执行JS之后返回的错误信息
7 | *
8 | * Created by XiaoFeng on 2021/4/6.
9 | */
10 | public class HummerError implements Serializable {
11 |
12 | public int errCode;
13 | public String errMsg;
14 |
15 | public HummerError(int errCode, String errMsg) {
16 | this.errCode = errCode;
17 | this.errMsg = errMsg;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/context/HummerModuleRegister.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.context;
2 |
3 | /**
4 | * didi Create on 2023/3/15 .
5 | *
6 | * Copyright (c) 2023/3/15 by didiglobal.com.
7 | *
8 | * @author zhangjun
9 | * @version 1.0
10 | * @Date 2023/3/15 8:29 下午
11 | * @Description Hummer 模块注册器
12 | */
13 |
14 | public interface HummerModuleRegister {
15 |
16 | String getModuleName();
17 |
18 | void register(HummerContext hummerContext);
19 | }
20 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/context/HummerRegister.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.context;
2 |
3 |
4 | /**
5 | * didi Create on 2023/3/15 .
6 | *
7 | * Copyright (c) 2023/3/15 by didiglobal.com.
8 | *
9 | * @author zhangjun
10 | * @version 1.0
11 | * @Date 2023/3/15 4:59 下午
12 | * @Description 组件注册器, 注册Hummer导出组件
13 | */
14 |
15 | public interface HummerRegister {
16 |
17 | void register(HummerContext hummerContext);
18 | }
19 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/debug/InvokerAnalyzerFactory.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.debug;
2 |
3 | /**
4 | * didi Create on 2023/3/7 .
5 | *
6 | * Copyright (c) 2023/3/7 by didiglobal.com.
7 | *
8 | * @author zhangjun
9 | * @version 1.0
10 | * @Date 2023/3/7 5:08 下午
11 | * @Description InvokerAnalyzer 工厂
12 | */
13 |
14 | public interface InvokerAnalyzerFactory {
15 |
16 | InvokerAnalyzer create();
17 | }
18 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/debug/plugin/IHermesDebugger.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.debug.plugin;
2 |
3 | /**
4 | * Created by XiaoFeng on 2020/9/7.
5 | */
6 | public interface IHermesDebugger {
7 |
8 | void enableDebugging(long runtimeId, String jsSourcePath);
9 |
10 | void disableDebugging(long runtimeId);
11 | }
12 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/debug/plugin/IV8Debugger.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.debug.plugin;
2 |
3 | /**
4 | * Created by XiaoFeng on 2019-11-07.
5 | */
6 | public interface IV8Debugger {
7 |
8 | void addScriptSource(String scriptId);
9 |
10 | void addScriptSource(String scriptId, String scriptSource);
11 | }
12 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/lifecycle/IFullLifeCycle.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.lifecycle;
2 |
3 | public interface IFullLifeCycle extends ILifeCycle {
4 | void onStart();
5 | void onResume();
6 | void onPause();
7 | void onStop();
8 | }
9 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/lifecycle/ILifeCycle.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.lifecycle;
2 |
3 | public interface ILifeCycle {
4 | void onCreate();
5 | void onDestroy();
6 | }
7 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/meta/ComponentInvokerIndex.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.meta;
2 |
3 | import java.util.Set;
4 |
5 | /**
6 | * Created by Xingjm on 2022-01-19.
7 | * Interface for generated indexes.
8 | */
9 | @Deprecated
10 | public interface ComponentInvokerIndex {
11 | Set getInvokerSet();
12 | ComponentJsCodeInfo getJsCodeInfo();
13 | }
14 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/pool/ObjectPool.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.pool;
2 |
3 | public interface ObjectPool {
4 |
5 | void put(long objId, Object value);
6 |
7 | T get(long objId);
8 |
9 | T remove(long objId);
10 |
11 | }
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/render/component/view/Invoker.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.render.component.view;
2 |
3 | import com.didi.hummer.context.HummerContext;
4 |
5 | public interface Invoker {
6 |
7 | String getName();
8 |
9 | Object onInvoke(HummerContext hummerContext, long objectID, String methodName, Object... params);
10 | }
11 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/render/event/IEventListener.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.render.event;
2 |
3 | import com.didi.hummer.core.engine.JSCallback;
4 |
5 | public interface IEventListener {
6 |
7 | void addEventListener(String eventName, JSCallback callback);
8 |
9 | void removeEventListener(String eventName, JSCallback callback);
10 |
11 | void clearEventListeners(String eventName);
12 | }
13 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/render/event/guesture/LongPressEvent.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.render.event.guesture;
2 |
3 | import com.didi.hummer.render.event.base.Event;
4 |
5 | import java.util.Map;
6 |
7 | /**
8 | * 长按事件
9 | */
10 | public class LongPressEvent extends Event {
11 |
12 | private Map position;
13 |
14 | public void setPosition(Map point) {
15 | this.position = point;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/render/event/guesture/PanEvent.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.render.event.guesture;
2 |
3 | import com.didi.hummer.render.event.base.Event;
4 |
5 | import java.util.HashMap;
6 |
7 | /**
8 | * 平移手势事件
9 | */
10 | public class PanEvent extends Event {
11 |
12 | private HashMap translation;
13 |
14 | public void setTranslation(HashMap translation) {
15 | this.translation = translation;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/render/event/guesture/PinchEvent.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.render.event.guesture;
2 |
3 | import com.didi.hummer.render.event.base.Event;
4 |
5 | /**
6 | * 捏合手势事件
7 | */
8 | public class PinchEvent extends Event {
9 |
10 | private float scale;
11 |
12 | public void setScale(float scale) {
13 | this.scale = scale;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/render/event/guesture/TapEvent.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.render.event.guesture;
2 |
3 | import com.didi.hummer.render.event.base.Event;
4 |
5 | import java.util.Map;
6 |
7 | /**
8 | * 单击事件
9 | */
10 | public class TapEvent extends Event {
11 |
12 | private Map position;
13 |
14 | public void setPosition(Map point) {
15 | this.position = point;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/render/event/guesture/TouchEvent.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.render.event.guesture;
2 |
3 | import com.didi.hummer.render.event.base.Event;
4 |
5 | import java.util.Map;
6 |
7 | /**
8 | * 触摸事件
9 | */
10 | public class TouchEvent extends Event {
11 |
12 | private Map position;
13 |
14 | public void setPosition(Map point) {
15 | this.position = point;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/android/hummer-sdk/src/main/java/com/didi/hummer/render/event/view/SwitchEvent.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.render.event.view;
2 |
3 | import com.didi.hummer.render.event.base.Event;
4 |
5 | public class SwitchEvent extends Event {
6 |
7 | public static final String HM_EVENT_TYPE_SWITCH = "switch";
8 |
9 | public void setState(boolean checked) {
10 | super.setState(checked ? 1 : 0);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/android/hummer-sdk/upload.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | echo -n "please enter bintray userid ->"
3 | read userid_bintray
4 | echo -n "please enter bintray apikey ->"
5 | read apikey_bintray
6 | ../gradlew clean build bintrayUpload -PbintrayUser=${userid_bintray} -PbintrayKey=${apikey_bintray} -PdryRun=false
--------------------------------------------------------------------------------
/android/hummer/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/android/hummer/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply from: '../module.gradle'
3 | apply from: '../upload.gradle'
4 |
5 | android {
6 |
7 | buildTypes {
8 | release {
9 | minifyEnabled false
10 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
11 | }
12 | }
13 | }
14 |
15 | dependencies {
16 |
17 | api project(':hummer-component')
18 | }
19 |
20 | uploadArchives.dependsOn(':hummer-component:uploadArchives')
21 |
--------------------------------------------------------------------------------
/android/hummer/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/Hummer/4b720e2319343321783ecbc664d946f3aa46ae79/android/hummer/consumer-rules.pro
--------------------------------------------------------------------------------
/android/hummer/gradle.properties:
--------------------------------------------------------------------------------
1 | ARTIFACT_ID=hummer
--------------------------------------------------------------------------------
/android/hummer/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/android/hummer/src/main/java/com/didi/hummer/devtools/DevToolsFactory.java:
--------------------------------------------------------------------------------
1 | package com.didi.hummer.devtools;
2 |
3 | import com.didi.hummer.context.HummerContext;
4 |
5 | /**
6 | * didi Create on 2023/3/7 .
7 | *
8 | * Copyright (c) 2023/3/7 by didiglobal.com.
9 | *
10 | * @author zhangjun
11 | * @version 1.0
12 | * @Date 2023/3/7 11:03 上午
13 | * @Description HummerDevTools 构建工厂
14 | */
15 |
16 | public interface DevToolsFactory {
17 |
18 | HummerDevTools create(HummerContext context, DevToolsConfig config);
19 | }
20 |
--------------------------------------------------------------------------------
/android/hummer/src/main/res/layout/activity_hummer.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/hummer/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/android/hummer/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/android/hummer/upload.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | echo -n "please enter bintray userid ->"
3 | read userid_bintray
4 | echo -n "please enter bintray apikey ->"
5 | read apikey_bintray
6 | ../gradlew clean build bintrayUpload -PbintrayUser=${userid_bintray} -PbintrayKey=${apikey_bintray} -PdryRun=false
--------------------------------------------------------------------------------
/android/openTerminal.sh:
--------------------------------------------------------------------------------
1 | pwd
2 | ps |grep "startServer" |grep -v grep
3 | if [ $? -ne 0 ]
4 | then
5 | open -a Terminal "../startServer.sh"
6 | fi
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = "Hummer-Android"
2 | include ':hummer-demo-app', ':hummer-core', ':hummer-compiler', ':hummer-annotation', ':hummer-sdk', ':hummer-component', ':hummer', ':hummer-dev-tools'
3 | include ':hermes-debugger'
4 |
--------------------------------------------------------------------------------
/android/startServer.sh:
--------------------------------------------------------------------------------
1 | echo "######## start hummer local server ########"
2 |
3 | work_path=$(dirname $0)
4 | server_dir=$work_path/../examples/hummer/unit-test
5 | cd $server_dir
6 | hummer dev
7 |
--------------------------------------------------------------------------------
/android/upload.gradle:
--------------------------------------------------------------------------------
1 | if (project.publishArchivesType == '1') {
2 | apply from: '../upload_maven.gradle'
3 | } else if (project.publishArchivesType == '2') {
4 | apply from: '../upload_jcenter.gradle'
5 | } else if (project.publishArchivesType == '3') {
6 | apply from: '../upload_maven_central_aar.gradle'
7 | }
--------------------------------------------------------------------------------
/android/upload.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | echo -n "please enter bintray userid ->"
3 | read userid_bintray
4 | echo -n "please enter bintray apikey ->"
5 | read apikey_bintray
6 | ./gradlew clean build bintrayUpload -PbintrayUser=${userid_bintray} -PbintrayKey=${apikey_bintray} -PdryRun=false
--------------------------------------------------------------------------------
/android/upload_jcenter.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.novoda.bintray-release'
2 |
3 | publish {
4 | userOrg = 'hummer'
5 | repoName = 'Hummer'
6 | groupId = project.GROUP_ID
7 | artifactId = project.ARTIFACT_ID
8 | publishVersion = project.VERSION
9 | desc = '{library description}'
10 | website = '{github_url}'
11 | }
--------------------------------------------------------------------------------
/examples/hummer/playground/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | /node_modules
3 | /dist
4 | /dist/*.map
5 | /package-lock.json
--------------------------------------------------------------------------------
/examples/hummer/playground/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // 使用 IntelliSense 了解相关属性。
3 | // 悬停以查看现有属性的描述。
4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5 | "configurations": [{
6 | "name": "HummerDebugger",
7 | "type": "hummerdirect",
8 | "workspaceRoot": "${workspaceFolder}",
9 | "request": "attach",
10 | }]
11 | }
--------------------------------------------------------------------------------
/examples/hummer/playground/README.md:
--------------------------------------------------------------------------------
1 | ### Hummer Playground Examples
2 | 原生组件示例工程
3 |
--------------------------------------------------------------------------------
/examples/hummer/playground/hm.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | module.exports = {
3 | type: 'hummer',
4 | webpack: {
5 | entries: "src/**/index.ts",
6 | output: {
7 | path: path.resolve(__dirname, './dist'),
8 | filename: "[name].js"
9 | },
10 | plugins: []
11 | }
12 | }
--------------------------------------------------------------------------------
/examples/hummer/playground/src/common/CommonColor.ts:
--------------------------------------------------------------------------------
1 | export const Color = {
2 | hm_linear_gradient: 'linear-gradient(90deg #15D0B4 #E2ED00)',
3 | hm_yellow: '#E2ED00',
4 | hm_green: '#15D0B4',
5 | hm_blue: '#4A90E2',
6 | hm_orange: '#F1CA19',
7 | hm_purple: '#8484FF',
8 | transparent: '#00000000',
9 | black: '#000000',
10 | white: '#FFFFFF',
11 | red: '#FF0000',
12 | green: '#00FF00',
13 | blue: '#0000FF',
14 | grey: '#808080',
15 | light_grey: '#CCCCCC',
16 | dark_grey: '#333333',
17 | transparent_grey: '#00000060',
18 | }
--------------------------------------------------------------------------------
/examples/hummer/playground/src/global.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * 用于描述拓展组件定义
3 | * 下面是一个定义示例
4 | * declare class Demo {
5 | * name: string;
6 | * sayName(): void;
7 | * }
8 | *
9 | * 使用如下:
10 | * 使用global.d.ts 声明的类
11 | * let demo = new Demo()
12 | * demo.sayName()
13 | */
14 | declare module '*.png'
15 | declare module '*.jpeg'
16 | declare module '*.jpg'
17 | declare module '*.gif'
18 |
--------------------------------------------------------------------------------
/examples/hummer/playground/src/res/hummer_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/Hummer/4b720e2319343321783ecbc664d946f3aa46ae79/examples/hummer/playground/src/res/hummer_logo.png
--------------------------------------------------------------------------------
/examples/hummer/playground/src/res/list_right_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/Hummer/4b720e2319343321783ecbc664d946f3aa46ae79/examples/hummer/playground/src/res/list_right_arrow.png
--------------------------------------------------------------------------------
/examples/hummer/playground/src/res/menu_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/Hummer/4b720e2319343321783ecbc664d946f3aa46ae79/examples/hummer/playground/src/res/menu_icon.png
--------------------------------------------------------------------------------
/examples/hummer/playground/src/res/navigator_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/Hummer/4b720e2319343321783ecbc664d946f3aa46ae79/examples/hummer/playground/src/res/navigator_back.png
--------------------------------------------------------------------------------
/examples/hummer/unit-test/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
3 | node_modules/
4 | dist/
5 | package-lock.json
--------------------------------------------------------------------------------
/examples/hummer/unit-test/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // 使用 IntelliSense 了解相关属性。
3 | // 悬停以查看现有属性的描述。
4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5 | "configurations": [{
6 | "name": "HummerDebugger",
7 | "type": "hummerdirect",
8 | "workspaceRoot": "${workspaceFolder}",
9 | "request": "attach",
10 | "port": 8000
11 | }]
12 | }
--------------------------------------------------------------------------------
/examples/hummer/unit-test/README.md:
--------------------------------------------------------------------------------
1 | ### Hummer Unit Test
2 | 原生 Hummer API 对应的单元测试用例项目
--------------------------------------------------------------------------------
/examples/hummer/unit-test/hm.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | module.exports = {
3 | type: 'hummer',
4 | webpack: {
5 | entries: "src/*.js",
6 | output: {
7 | path: path.resolve(__dirname, './dist'),
8 | filename: "[name].js"
9 | },
10 | plugins: []
11 | }
12 | }
--------------------------------------------------------------------------------
/examples/hummer/unit-test/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "hm_hello",
3 | "version": "1.0.0",
4 | "description": "Hummer Project",
5 | "scripts": {
6 | "build": "hummer build",
7 | "dev": "hummer dev",
8 | "debug": "npm run dev & hummer debug"
9 | },
10 | "dependencies": {
11 | "@hummer/hummer-front": "^1.0.0",
12 | "@hummer/tenon-dev-tool": "^0.2.2"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/examples/tenon-react/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | // ...
4 | "react-hooks"
5 | ],
6 | "rules": {
7 | // ...
8 | "react-hooks/rules-of-hooks": "error", // 检查 Hook 的规则
9 | "react-hooks/exhaustive-deps": "warn" // 检查 effect 的依赖
10 | }
--------------------------------------------------------------------------------
/examples/tenon-react/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .history/
3 | dump.rdb
4 | package-lock.json
5 | coverage/
6 | .DS_Store
7 | .idea
8 | dist
9 |
--------------------------------------------------------------------------------
/examples/tenon-react/hm.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 |
3 | module.exports = {
4 | type: 'react',
5 | webpack: {
6 | entries: "src/*/entry.js",
7 | output: {
8 | path: path.resolve(__dirname, './dist'),
9 | filename: "[name].js"
10 | },
11 | resolve: {
12 | alias: {
13 | "@common": path.join(__dirname, './src/common')
14 | }
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/examples/tenon-react/script/playground.js:
--------------------------------------------------------------------------------
1 | const http = require('http');
2 | const serveHandler = require('serve-handler');
3 | const open = require('open');
4 |
5 | run();
6 | function run(){
7 | const server = http.createServer((request, response) => {
8 | return serveHandler(request, response);
9 | })
10 | server.listen(5000, () => {
11 | console.log('Dev Server Running at http://localhost:5000');
12 | open('http://localhost:5000/playground');
13 | })
14 | }
15 |
--------------------------------------------------------------------------------
/examples/tenon-react/src/animation-basic/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 |
3 | .box {
4 | width: 1rem;
5 | height: 1rem;
6 | margin: 0.1rem;
7 | background-color: #fa9153;
8 | }
9 | .box-opacity-hide {
10 | opacity: 0;
11 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/animation-basic/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/animation-keyframe/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 |
3 | .box {
4 | width: 1rem;
5 | height: 1rem;
6 | margin: 0.1rem;
7 | background-color: #fa9153;
8 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/animation-keyframe/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/animation-steps/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 |
3 | .box {
4 | width: 1rem;
5 | height: 1rem;
6 | margin: 0.1rem;
7 | background-color: #fa9153;
8 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/animation-steps/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/animation-transition/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/benchmark-scroller/App.css:
--------------------------------------------------------------------------------
1 | .cube-wrapper{
2 | width: 100%;
3 | display: flex;
4 | margin-top: 10;
5 | padding: 10 0;
6 | background-color: #dcf5f1;
7 | }
8 | .cube-text{
9 | width: 34;
10 | height: 34;
11 | margin: 0 12;
12 | background-color: #132266;
13 | text-align:center;
14 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/benchmark-scroller/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.css"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/common/components/PageItem.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 |
4 | function PageItem(props){
5 | let {title, children} = props
6 | return (
7 |
8 |
9 | {title}
10 |
11 |
12 | {children}
13 |
14 |
15 | )
16 | }
17 |
18 | export default PageItem
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-button/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-button/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-image/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 | .image-item {
3 | width: 2rem;
4 | height: 2rem;
5 | background-color: red;
6 | }
7 | .box-container {
8 | display: flex;
9 | justify-content: center;
10 | }
11 | .border-item {
12 | width: 2rem;
13 | height: 2rem;
14 | border-radius: 50%;
15 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-image/assets/headInfo.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/Hummer/4b720e2319343321783ecbc664d946f3aa46ae79/examples/tenon-react/src/component-image/assets/headInfo.jpeg
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-image/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-input/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 |
3 | .input {
4 | width: 100%;
5 | background-color: #eeffee;
6 | height: 0.5rem;
7 | }
8 | .input-place {
9 | placeholder-color: blue;
10 | cursor-color: #eedeee;
11 | placeholder-font-size: 0.24rem;
12 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-input/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-scroller/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-switch/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-switch/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-text/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 | .demo-box {
3 | margin-top: 0.2rem;
4 | width: 2rem;
5 | height: 2rem;
6 | background-color: #fa9153;
7 | }
8 | .border-box {
9 | border-radius: 0.1rem;
10 | border: 0.2rem solid blue;
11 | }
12 | .border-top-box{
13 | border-top: 0.2rem solid #444444;
14 | }
15 | .background-box {
16 | background-image: url("https://dpubstatic.udache.com/static/dpubimg/RJ4ZZ_M5ie/WechatIMG24764.jpeg");
17 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-text/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-textarea/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 | .textarea {
3 | width: 100%;
4 | background-color: #eeffee;
5 | height: 0.5rem;
6 | }
7 | .textarea-place {
8 | placeholder-color: blue;
9 | cursor-color: #eedeee;
10 | placeholder-font-size: 0.24rem;
11 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-textarea/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-view/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 | .demo-box {
3 | margin-top: 0.2rem;
4 | width: 2rem;
5 | height: 2rem;
6 | background-color: #fa9153;
7 | }
8 | .border-box {
9 | border-radius: 0.1rem;
10 | border: 0.2rem solid blue;
11 | }
12 | .border-top-box{
13 | border-top: 0.2rem solid #444444;
14 | }
15 | .background-box {
16 | background-image: url("https://dpubstatic.udache.com/static/dpubimg/RJ4ZZ_M5ie/WechatIMG24764.jpeg");
17 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/component-view/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/ex-component-list/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 | .demo-box {
3 | margin-top: 0.2rem;
4 | width: 2rem;
5 | height: 2rem;
6 | background-color: #fa9153;
7 | }
8 | .border-box {
9 | border-radius: 0.1rem;
10 | border: 0.2rem solid blue;
11 | }
12 | .border-top-box{
13 | border-top: 0.2rem solid #444444;
14 | }
15 | .background-box {
16 | background-image: url("https://dpubstatic.udache.com/static/dpubimg/RJ4ZZ_M5ie/WechatIMG24764.jpeg");
17 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/ex-component-list/components/list.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 |
4 | {/*
5 |
9 | */}
10 | class List extends React.Component{
11 | constructor(props){
12 | super(props)
13 | }
14 |
15 | render(){
16 | return (
17 |
18 |
19 |
20 | )
21 | }
22 | }
23 |
24 |
25 | export default List
--------------------------------------------------------------------------------
/examples/tenon-react/src/ex-component-list/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/ex-component-popup/App.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import PageItem from '@common/components/PageItem';
4 | import DemoItem from '@common/components/DemoItem';
5 |
6 | function App() {
7 | return (
8 |
9 |
10 | Component List
11 |
12 |
13 | );
14 | }
15 |
16 | export default App;
17 |
--------------------------------------------------------------------------------
/examples/tenon-react/src/ex-component-popup/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 | .demo-box {
3 | margin-top: 0.2rem;
4 | width: 2rem;
5 | height: 2rem;
6 | background-color: #fa9153;
7 | }
8 | .border-box {
9 | border-radius: 0.1rem;
10 | border: 0.2rem solid blue;
11 | }
12 | .border-top-box{
13 | border-top: 0.2rem solid #444444;
14 | }
15 | .background-box {
16 | background-image: url("https://dpubstatic.udache.com/static/dpubimg/RJ4ZZ_M5ie/WechatIMG24764.jpeg");
17 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/ex-component-popup/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/ex-component-test/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 |
3 | // Simple View
4 | .simple-view{
5 | color: red;
6 | }
7 |
8 | // Attr View
9 | .attr-view{
10 | padding: 0.2rem;
11 | color: red;
12 | }
13 |
14 |
15 | // Safe View
16 | .view-container{
17 | display: flex;
18 | justify-content: center;
19 | }
20 | .safe-view{
21 | width: 80%;
22 | }
23 | .safe-view-content{
24 | padding: .2rem;
25 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/ex-component-test/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import Tenon from "@hummer/tenon-react"
3 |
4 | import App from "./App"
5 | import "./App.less"
6 |
7 | import SimpleView from './native-components/simple-view'
8 | import AttrView from './native-components/attr-view'
9 | import EventView from './native-components/event-view'
10 | import SafeView from './native-components/safe-view'
11 |
12 |
13 | Tenon.register(AttrView)
14 | Tenon.register(SimpleView)
15 | Tenon.register(EventView)
16 | Tenon.register(SafeView)
17 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/ex-component-viewpager/App.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import PageItem from '@common/components/PageItem';
4 | import DemoItem from '@common/components/DemoItem';
5 |
6 | function App() {
7 | return (
8 |
9 |
10 | Component List
11 |
12 |
13 | );
14 | }
15 |
16 | export default App;
17 |
--------------------------------------------------------------------------------
/examples/tenon-react/src/ex-component-viewpager/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 | .demo-box {
3 | margin-top: 0.2rem;
4 | width: 2rem;
5 | height: 2rem;
6 | background-color: #fa9153;
7 | }
8 | .border-box {
9 | border-radius: 0.1rem;
10 | border: 0.2rem solid blue;
11 | }
12 | .border-top-box{
13 | border-top: 0.2rem solid #444444;
14 | }
15 | .background-box {
16 | background-image: url("https://dpubstatic.udache.com/static/dpubimg/RJ4ZZ_M5ie/WechatIMG24764.jpeg");
17 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/ex-component-viewpager/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/grammar-style/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/grammar/App.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import PageItem from '@common/components/PageItem';
4 | import DemoItem from '@common/components/DemoItem';
5 |
6 | import CreateRefComponent from './components/CreateRefComponent';
7 |
8 | function App() {
9 | return (
10 |
11 |
12 |
13 |
14 |
15 | );
16 | }
17 |
18 | export default App;
19 |
--------------------------------------------------------------------------------
/examples/tenon-react/src/grammar/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 | .demo-box {
3 | margin-top: 0.2rem;
4 | width: 2rem;
5 | height: 2rem;
6 | background-color: #fa9153;
7 | }
8 | .border-box {
9 | border-radius: 0.1rem;
10 | border: 0.2rem solid blue;
11 | }
12 | .border-top-box{
13 | border-top: 0.2rem solid #444444;
14 | }
15 | .background-box {
16 | background-image: url("https://dpubstatic.udache.com/static/dpubimg/RJ4ZZ_M5ie/WechatIMG24764.jpeg");
17 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/grammar/components/CreateRefComponent.jsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect } from 'react'
2 |
3 | /**
4 | * 使用 createRef 的测试用例
5 | */
6 | function CreateRefComponent({initialCount}){
7 | const ref = React.createRef();
8 |
9 | useEffect(() => {
10 | ref.current.getRect((obj) => {
11 | console.log('Get Rect', obj)
12 | })
13 | }, [])
14 | return (
15 |
16 | Ref Get Rect
17 |
18 | )
19 | }
20 |
21 |
22 | export default CreateRefComponent
--------------------------------------------------------------------------------
/examples/tenon-react/src/grammar/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/hook-test/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
2 | .demo-box {
3 | margin-top: 0.2rem;
4 | width: 2rem;
5 | height: 2rem;
6 | background-color: #fa9153;
7 | }
8 | .border-box {
9 | border-radius: 0.1rem;
10 | border: 0.2rem solid blue;
11 | }
12 | .border-top-box{
13 | border-top: 0.2rem solid #444444;
14 | }
15 | .background-box {
16 | background-image: url("https://dpubstatic.udache.com/static/dpubimg/RJ4ZZ_M5ie/WechatIMG24764.jpeg");
17 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/hook-test/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/index/App.css:
--------------------------------------------------------------------------------
1 | .message{
2 | color: red;
3 | font-size: .36rem;
4 | }
--------------------------------------------------------------------------------
/examples/tenon-react/src/index/App.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | function App() {
4 | const message = 'Hello Tenon'
5 | return (
6 |
7 | {message}
8 |
9 | );
10 | }
11 |
12 | export default App;
13 |
--------------------------------------------------------------------------------
/examples/tenon-react/src/index/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.css"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/lifecycle/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
--------------------------------------------------------------------------------
/examples/tenon-react/src/lifecycle/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/main/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import Tenon from "@hummer/tenon-react"
4 |
5 | import "./App.less"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/page-config/App.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import PageItem from '@common/components/PageItem';
4 | import DemoItem from '@common/components/DemoItem';
5 |
6 |
7 | function App() {
8 | return (
9 |
10 |
11 | LifeCycle
12 |
13 |
14 | );
15 | }
16 |
17 | export default App;
18 |
--------------------------------------------------------------------------------
/examples/tenon-react/src/page-config/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
--------------------------------------------------------------------------------
/examples/tenon-react/src/page-config/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import * as Tenon from "@hummer/tenon-react"
3 |
4 | import App from "./App"
5 | import "./App.less"
6 |
7 | Tenon.render(, {
8 | canScroll: false, // 禁止滚动
9 | pageStyle: { // 全局页面样式
10 | backgroundColor: '#f3ffff'
11 | }
12 | })
--------------------------------------------------------------------------------
/examples/tenon-react/src/single-page/App.less:
--------------------------------------------------------------------------------
1 | @import "../common/assets/css/common.less";
--------------------------------------------------------------------------------
/examples/tenon-react/src/single-page/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 |
3 | import Tenon from "@hummer/tenon-react"
4 |
5 | function App() {
6 | function handleTouch(){
7 | Toast.show('Touch')
8 | }
9 | return (
10 |
11 | Touch Demo
12 |
13 | );
14 | }
15 |
16 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-react/src/test/App.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/Hummer/4b720e2319343321783ecbc664d946f3aa46ae79/examples/tenon-react/src/test/App.css
--------------------------------------------------------------------------------
/examples/tenon-react/src/test/basic-components/Image.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | function Image(props) {
4 | let {src} = props
5 | return (
6 |
7 | );
8 | }
9 |
10 | export default Image;
11 |
--------------------------------------------------------------------------------
/examples/tenon-react/src/test/basic-components/Input.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | function Input() {
4 | return (
5 |
6 | );
7 | }
8 |
9 | export default Input;
10 |
--------------------------------------------------------------------------------
/examples/tenon-react/src/test/basic-components/Textarea.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | function Textarea() {
4 | return (
5 |
6 | );
7 | }
8 |
9 | export default Textarea;
10 |
--------------------------------------------------------------------------------
/examples/tenon-react/src/test/components/Hello.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | function Hello() {
4 | return (
5 |
6 | Hello
7 |
8 | );
9 | }
10 |
11 | export default Hello;
12 |
--------------------------------------------------------------------------------
/examples/tenon-react/src/test/entry.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import App from "./App"
3 | import * as Tenon from "@hummer/tenon-react"
4 |
5 | // import "./App.css"
6 |
7 | Tenon.render()
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | /node_modules
3 | /dist
4 | /dist/*.map
5 | /package-lock.json
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/README.md:
--------------------------------------------------------------------------------
1 | ### Tenon Template Vue仓库
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/hm.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | module.exports = {
3 | type: 'tenon',
4 | webpack: {
5 | entries: "src/*/entry.js",
6 | output: {
7 | path: path.resolve(__dirname, './dist'),
8 | filename: "[name].js"
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/animation/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/animation_basic/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/animation_keyframe/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/animation_loading/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/animation_ripple/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/animation_steps/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/bottombar/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/button/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/canvas/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import ExCanvas from '@hummer/vue-plugin-canvas';
3 | import app from './app';
4 |
5 | Tenon.register(ExCanvas);
6 | Tenon.render(app);
7 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/common/CommonColor.ts:
--------------------------------------------------------------------------------
1 | export const Color = {
2 | hm_linear_gradient: 'linear-gradient(90deg #15D0B4 #E2ED00)',
3 | hm_yellow: '#E2ED00',
4 | hm_green: '#15D0B4',
5 | hm_blue: '#4A90E2',
6 | hm_orange: '#F1CA19',
7 | hm_purple: '#8484FF',
8 | transparent: '#00000000',
9 | black: '#000000',
10 | white: '#FFFFFF',
11 | red: '#FF0000',
12 | green: '#00FF00',
13 | blue: '#0000FF',
14 | grey: '#808080',
15 | light_grey: '#CCCCCC',
16 | dark_grey: '#333333',
17 | transparent_grey: '#00000060',
18 | }
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/hscroller/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/image/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/index/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/input/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/list/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 | import List from '@hummer/vue-plugin-list';
4 | Tenon.register(List);
5 | Tenon.render(app);
6 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/middle_scroller/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/middle_view/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/normal_layout_style/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/normal_view_style/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/popup/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import ExPopup from '@hummer/vue-plugin-popup';
3 | import app from './app.vue';
4 |
5 | Tenon.register(ExPopup);
6 | Tenon.render(app);
7 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/price_flag/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/scroller/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/switch/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/text/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/textarea/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/title_and_bottom_bar/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/titlebar/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/verification_code/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/view/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue-playground/src/view_pager/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 | import ViewPager from '@hummer/vue-plugin-viewpager'
4 |
5 | Tenon.register(ViewPager);
6 | Tenon.render(app);
7 |
--------------------------------------------------------------------------------
/examples/tenon-vue/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .history/
3 | dump.rdb
4 | package-lock.json
5 | coverage/
6 | .DS_Store
7 | .idea
8 | dist
9 |
--------------------------------------------------------------------------------
/examples/tenon-vue/README.md:
--------------------------------------------------------------------------------
1 | ### Tenon Vue Demo
2 | 在这里你能找到常用的组件的示例用法
3 | > 持续迭代中
--------------------------------------------------------------------------------
/examples/tenon-vue/hm.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | module.exports = {
3 | type: 'tenon',
4 | webpack: {
5 | entries: "src/*/entry.js",
6 | resolve: {
7 | alias: {
8 | "@common": path.join(__dirname, './src/common')
9 | }
10 | },
11 | output: {
12 | path: path.resolve(__dirname, './dist'),
13 | filename: "[name].js"
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/examples/tenon-vue/src/animation-basic/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/animation-keyframe/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/animation-steps/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/animation-transition/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/common/store/action.js:
--------------------------------------------------------------------------------
1 | export default {
2 | increment ({commit}) {
3 | commit('increment')
4 | }
5 | }
--------------------------------------------------------------------------------
/examples/tenon-vue/src/common/store/index.js:
--------------------------------------------------------------------------------
1 | import {createStore, createHummerPlugin} from '@hummer/tenon-store'
2 | import {createLoggerPlugin} from './logger'
3 |
4 | import State from './state'
5 | import Mutation from './mutation'
6 | import Action from './action'
7 |
8 | export default createStore({
9 | state: State,
10 | mutations: Mutation,
11 | actions: Action,
12 | plugins: [createLoggerPlugin(), createHummerPlugin()]
13 | })
--------------------------------------------------------------------------------
/examples/tenon-vue/src/common/store/mutation.js:
--------------------------------------------------------------------------------
1 | export default {
2 | increment (state) {
3 | state.count++
4 | }
5 | }
--------------------------------------------------------------------------------
/examples/tenon-vue/src/common/store/state.js:
--------------------------------------------------------------------------------
1 | export default {
2 | count: 0,
3 | name: undefined,
4 | nullName: null
5 | }
--------------------------------------------------------------------------------
/examples/tenon-vue/src/component-button/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/component-image/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/component-input/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/component-scroller/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/component-switch/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/component-text/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/component-textarea/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/component-view/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/directive-v-if/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/directive-v-rtl/directives/v-rtl.js:
--------------------------------------------------------------------------------
1 | const vRtl = {
2 | beforeMount(el, {value}) {
3 | if(true){
4 | // 需要 RTL 翻转
5 | if(value === 'text'){
6 | el.style = {
7 | transform: "scaleX(-1)",
8 | textAlign: 'right'
9 | }
10 | }else {
11 | el.style = {
12 | transform: "scaleX(-1)"
13 | }
14 | }
15 | }
16 |
17 | },
18 | mounted(el, {value}) {
19 | }
20 | }
21 |
22 | export default vRtl
--------------------------------------------------------------------------------
/examples/tenon-vue/src/directive-v-rtl/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | import VRtl from './directives/v-rtl';
5 |
6 | Tenon.directive('rtl', VRtl);
7 |
8 | Tenon.render(app);
9 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/directive-v-show/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/event/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/ex-component-canvas/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import ExCanvas from '@hummer/vue-plugin-canvas';
3 | import app from './app';
4 |
5 | Tenon.register(ExCanvas);
6 | Tenon.render(app);
7 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/ex-component-image-plus/app.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/ex-component-image-plus/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | import ImagePlus from './imagePlus.js';
5 | Tenon.register(ImagePlus);
6 |
7 | Tenon.render(app);
8 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/ex-component-list/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 | import List from '@hummer/vue-plugin-list';
4 | Tenon.register(List);
5 |
6 | Tenon.render(app);
7 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/ex-component-marquee/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | import MarqueeView from './hummerMarqueeView.js';
5 | Tenon.register(MarqueeView);
6 |
7 | Tenon.render(app);
8 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/ex-component-popup/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import ExPopup from '@hummer/vue-plugin-popup';
3 | import app from './app.vue';
4 |
5 | Tenon.register(ExPopup);
6 | Tenon.render(app);
7 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/ex-component-scroller-plus/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app';
3 |
4 | import ScrollerPlus from './scrollerPlus.js';
5 | Tenon.register(ScrollerPlus);
6 |
7 | Tenon.render(app);
8 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/ex-component-test/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | import ExWebview from './plugin/webView';
5 | Tenon.register(ExWebview);
6 |
7 | Tenon.render(app);
8 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/ex-component-viewpager/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import ViewPager from '@hummer/vue-plugin-viewpager'
3 |
4 | import app from './app.vue';
5 |
6 | Tenon.register(ViewPager);
7 | Tenon.render(app);
8 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/grammar-render/components/demo-component.vue:
--------------------------------------------------------------------------------
1 |
2 | Demo Component
3 |
4 |
9 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/grammar-render/components/test.js:
--------------------------------------------------------------------------------
1 | import {h} from '@hummer/tenon-vue'
2 | import DemoComponent from './demo-component'
3 | export default{
4 | name: 'test',
5 | render(){
6 | return h("view", [h("text", "test"), h(DemoComponent)])
7 | }
8 | }
--------------------------------------------------------------------------------
/examples/tenon-vue/src/grammar-render/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 | import DemoComponent from './components/demo-component';
4 |
5 | Tenon.component("DemoComponent", DemoComponent);
6 |
7 | Tenon.render(app);
8 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/grammar-slot/app.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Button Content
5 |
6 |
7 |
8 |
20 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/grammar-slot/components/button.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/grammar-slot/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/grammar-style/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/index/app.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello Tenon
4 |
5 |
6 |
18 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/index/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/lifecycle/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 | import LifeMixin1 from "./mixins/life-mixin1";
4 |
5 | Tenon.mixin(LifeMixin1);
6 | Tenon.render(app);
7 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/lifecycle/extends/life-mxin.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "Name",
3 | onShow(){
4 | console.log('Extends LifeCycle OnShow')
5 | },
6 | onLoad(){
7 | console.log('Extends LifeCycle onLoad')
8 | },
9 | onBack(){
10 | // On Back LifeCycle
11 | console.log('Extends onBack LifeCycle')
12 | // return true
13 | }
14 | }
--------------------------------------------------------------------------------
/examples/tenon-vue/src/lifecycle/mixins/life-mixin.js:
--------------------------------------------------------------------------------
1 | export default {
2 | onShow(){
3 | console.log('Base Lifecycle Mixin On Show!')
4 | },
5 | onHide(){
6 | console.log('Base Lifecycle Mixin On Hide!')
7 | },
8 | onBack(){
9 | // On Back LifeCycle
10 | console.log('Base Lifecycle Mixin On Back!')
11 | // return true
12 | }
13 | }
--------------------------------------------------------------------------------
/examples/tenon-vue/src/lifecycle/mixins/life-mixin1.js:
--------------------------------------------------------------------------------
1 | export default {
2 | onShow(){
3 | console.log('Base Lifecycle Mixin1 On Show!')
4 | },
5 | onHide(){
6 | console.log('Base Lifecycle Mixin1 On Hide!')
7 | },
8 | onBack(){
9 | // On Back LifeCycle
10 | console.log('Base Lifecycle Mixin1 On Back!')
11 | // return true
12 | }
13 | }
--------------------------------------------------------------------------------
/examples/tenon-vue/src/main/entry.js:
--------------------------------------------------------------------------------
1 | import Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/page-config/app.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/page-config/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/plugin-error/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 | import ErrorHandler from '@hummer/vue-plugin-error-handler';
4 |
5 | Tenon.use(ErrorHandler);
6 | Tenon.render(app);
7 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/store-demo/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 | import store from './store';
4 |
5 | Tenon.use(store);
6 | Tenon.render(app);
7 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/store-demo/store/index.js:
--------------------------------------------------------------------------------
1 | import {createStore} from '@hummer/tenon-store'
2 | import {createLoggerPlugin} from './logger'
3 | export default createStore({
4 | state: {
5 | count: 0
6 | },
7 | mutations: {
8 | increment (state) {
9 | state.count++
10 | }
11 | },
12 | actions: {
13 | increment ({commit}) {
14 | commit('increment')
15 | }
16 | },
17 | plugins: [createLoggerPlugin()]
18 | })
--------------------------------------------------------------------------------
/examples/tenon-vue/src/store-muti-main-sub1/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 | import store from '@common/store';
4 |
5 | Tenon.use(store);
6 | Tenon.render(app);
7 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/store-muti-main-sub2/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 | import store from '@common/store';
4 |
5 | Tenon.use(store);
6 | Tenon.render(app);
7 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/store-muti-main/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 | import store from '@common/store';
4 |
5 | Tenon.use(store);
6 | Tenon.render(app);
7 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/style-basic/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/style-layout/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | Tenon.render(app);
5 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/test/app.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello Tenon
4 |
5 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/tenon-vue/src/test/entry.js:
--------------------------------------------------------------------------------
1 | import * as Tenon from '@hummer/tenon-vue';
2 | import app from './app.vue';
3 |
4 | import VRtl from './directives/v-rtl'
5 |
6 | Tenon.directive('rtl', VRtl)
7 |
8 | Tenon.render(app);
9 |
--------------------------------------------------------------------------------
/iOS/App/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "idiom" : "universal"
5 | }
6 | ],
7 | "info" : {
8 | "author" : "xcode",
9 | "version" : 1
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/iOS/App/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/iOS/App/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // App
4 | //
5 | // Created by 唐佳诚 on 2021/8/17.
6 | //
7 |
8 | import UIKit
9 | import Hummer
10 |
11 | class ViewController: HMViewController {
12 |
13 | override func viewDidLoad() {
14 | super.viewDidLoad()
15 | // Do any additional setup after loading the view.
16 | }
17 |
18 |
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/iOS/Hummer/Assets/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/iOS/Hummer/Assets/Assets.xcassets/builtin.dataset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "data" : [
3 | {
4 | "filename" : "builtin.js",
5 | "idiom" : "universal",
6 | "universal-type-identifier" : "com.netscape.javascript-source"
7 | }
8 | ],
9 | "info" : {
10 | "author" : "xcode",
11 | "version" : 1
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Animation/Keyframe/CAAnimation+Exp.h:
--------------------------------------------------------------------------------
1 | //
2 | // CAAnimation+Exp.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | @interface CAAnimation (Base)
11 |
12 | @property (nonatomic, copy, nullable) void(^onEnding)(CAAnimation *anim, BOOL flag);
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Animation/Keyframe/CAAnimation+Timing.h:
--------------------------------------------------------------------------------
1 | //
2 | // CAAnimation+Timing.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | @interface CAAnimation (Timing)
11 |
12 |
13 | @property (nonatomic, strong, nullable) NSNumber *facadeDuration;
14 | @end
15 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Animation/Keyframe/HMAnimation.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMAnimation.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 |
11 | @interface HMKeyframeAnimation : CAKeyframeAnimation
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Navigator/HMNavigatorPageInfo.m:
--------------------------------------------------------------------------------
1 | //
2 | // HMNavigatorPageInfo.m
3 | // Hummer
4 | //
5 | // Created by didi on 2020/7/13.
6 | //
7 |
8 | #import "HMNavigatorPageInfo.h"
9 |
10 | @implementation HMNavigatorPageInfo
11 |
12 | - (instancetype)init
13 | {
14 | self = [super init];
15 | if (self) {
16 | _animated = YES;
17 | }
18 | return self;
19 | }
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Network/HMRequest.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMNetworking.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | @interface HMRequest : NSObject
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Button/HMButton.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMButton.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | @interface HMButton : UIButton
11 |
12 | @end
13 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Canvas/BridgeExport/HMCanvasView.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMCanvasView.h
3 | // Hummer
4 | //
5 | // Created by litianhao on 2021/6/30.
6 | //
7 |
8 | #import
9 |
10 |
11 | @interface HMCanvasView : UIView
12 |
13 | @end
14 |
15 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Canvas/implementation/coreGraphic/HMCanvasByGraphicInternelView.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMCanvasByGraphicInternelView.h
3 | // Hummer
4 | //
5 | // Created by litianhao on 2021/8/2.
6 | //
7 |
8 | #import
9 | #import "HMCanvasViewInterface.h"
10 |
11 |
12 | @interface HMCanvasByGraphicInternelView : UIView
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Canvas/implementation/coreGraphic/HMCanvasImplByCoreGraphic.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMCanvasImplByCoreGraphic.h
3 | // Hummer
4 | //
5 | // Created by litianhao on 2021/8/2.
6 | //
7 |
8 | #import
9 | #import "HMCanvasViewInterface.h"
10 |
11 | @interface HMCanvasImplByCoreGraphic : NSObject
12 |
13 | @end
14 |
15 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Color/HMGradientColor.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMGradientColor.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMGradientColor : UIColor
13 |
14 | @property (nonatomic, copy) UIColor *beginColor;
15 | @property (nonatomic, copy) UIColor *endColor;
16 | @property (nonatomic, assign) CGPoint beginPoint;
17 | @property (nonatomic, assign) CGPoint endPoint;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Color/HMGradientColor.m:
--------------------------------------------------------------------------------
1 | //
2 | // HMGradientColor.m
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import "HMGradientColor.h"
9 |
10 | @implementation HMGradientColor
11 |
12 | // TODO(唐佳诚): 处理模型
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/ImageView/HMImageLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMImageView.m
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMImageLayer : CALayer
13 |
14 | @property (nonatomic, copy) NSString *imageURL;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Label/HMLabel.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMLabel.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | @interface HMLabel : UILabel
11 |
12 | @end
13 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/ListView/HMRecycleListView.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMRecycleListView.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMRecycleListView : UICollectionView
13 |
14 | - (instancetype)initWithFrame:(CGRect)frame NS_DESIGNATED_INITIALIZER;
15 |
16 | - (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
17 |
18 | @end
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/ListView/Layout/HMListLayoutAttributes.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMListLayoutAttributes.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMListLayoutAttributes : UICollectionViewLayoutAttributes
13 |
14 | @property (nonatomic) UICollectionViewScrollDirection scrollDirection;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/ListView/Layout/HMListLayoutAttributes.m:
--------------------------------------------------------------------------------
1 | //
2 | // HMListLayoutAttributes.m
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import "HMListLayoutAttributes.h"
9 |
10 | @implementation HMListLayoutAttributes
11 |
12 | - (instancetype)copy {
13 | HMListLayoutAttributes *attributes = [super copy];
14 | attributes.scrollDirection = self.scrollDirection;
15 | return attributes;
16 | }
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/ListView/Layout/HMRecycleListViewGridLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMRecycleListViewGridLayout.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMRecycleListViewGridLayout : UICollectionViewFlowLayout
13 |
14 | @property (nonatomic, assign) NSUInteger numberOfColumns;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/ListView/Layout/HMWaterfallLayoutAttributes.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMWaterfallLayoutAttributes.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMWaterfallLayoutAttributes : UICollectionViewLayoutAttributes
13 |
14 | @property (nonatomic, assign) CGFloat columnWidth;
15 | @property (nonatomic, assign) CGFloat rowWidth;
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/ListView/Layout/HMWaterfallLayoutAttributes.m:
--------------------------------------------------------------------------------
1 | //
2 | // HMWaterfallLayoutAttributes.m
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import "HMWaterfallLayoutAttributes.h"
9 |
10 | @implementation HMWaterfallLayoutAttributes
11 |
12 | - (instancetype)copy {
13 | HMWaterfallLayoutAttributes *attributes = [super copy];
14 | attributes.rowWidth = self.rowWidth;
15 | attributes.columnWidth = self.columnWidth;
16 | return attributes;
17 | }
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Loading/HMActivityIndicatorView.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMActivityIndicatorView.h
3 | // Hummer
4 | //
5 | // Copyright © 2019 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | @interface HMActivityIndicatorView : UIActivityIndicatorView
11 |
12 | @end
13 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Lottie/HMLottieView.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMOCLottieView.h
3 | // DCPTrack
4 | //
5 | // Created by didi on 2022/12/21.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMLottieView : UIView
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Lottie/Loader/HMLocalImageLoader+Lottie.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMLocalImageLoader+Lottie.h
3 | // Hummer
4 | //
5 | // Created by didi on 2022/12/28.
6 | //
7 |
8 | #import "HMLocalImageLoader.h"
9 | #import "HMLottieLoader.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface HMLocalImageLoader (Lottie)
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Lottie/Loader/HMWebImageLoader+Lottie.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMWebImageLoader+Lottie.h
3 | // Hummer
4 | //
5 | // Created by didi on 2022/12/28.
6 | //
7 |
8 | #import "HMWebImageLoader.h"
9 | #import "HMLottieLoader.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMWebImageLoader (Lottie)
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Lottie/Manager/HMZipArchive.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMZipArchive.h
3 | // Hummer
4 | //
5 | // Created by didi on 2022/12/23.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMZipArchive : NSObject
13 |
14 | + (HMZipArchive *)sharedInstance;
15 |
16 | - (void)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password result:(void(^)(BOOL))result;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Switch/HMSwitch.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMSwitch.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMSwitch : UISwitch
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/TextArea/HMTextArea.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMTextArea.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMTextArea : UITextView
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/TextInput/HMInput.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMInput.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | @interface HMInput : UITextField
11 |
12 | @end
13 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/Toast/HMToast.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMToast.h
3 | // Pods
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMToast : NSObject
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/View/HMCornerRadiusModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMCornerRadiusModel.h
3 | // Hummer
4 | //
5 | // Created by 唐佳诚 on 2020/4/16.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMCornerRadiusModel : NSObject
13 |
14 | @property (nonatomic, assign) double topLeft;
15 |
16 | @property (nonatomic, assign) double topRight;
17 |
18 | @property (nonatomic, assign) double bottomLeft;
19 |
20 | @property (nonatomic, assign) double bottomRight;
21 |
22 | @end
23 |
24 | NS_ASSUME_NONNULL_END
25 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/View/HMRootViewProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMRootViewProtocol.h
3 | // Hummer
4 | //
5 | // Created by didi on 2023/6/13.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @protocol HMRootViewProtocol
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/View/HMTransformResolver.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMTransformResolver.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/12/10.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | @class HMTransform;
12 | @interface HMTransformResolver : NSObject
13 |
14 | + (CATransform3D)resolverTransformValue:(id)value view:(UIView *)view;
15 | + (HMTransform *)applyTransformValues:(NSDictionary *)transformValues defaultValue:(HMTransform *)defaultTransform;
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/View/UIView+HMRootView.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+HMRootView.h
3 | // Hummer
4 | //
5 | // Created by didi on 2023/6/13.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface UIView (HMRootView)
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/View/UIView+HMRootView.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+HMRootView.m
3 | // Hummer
4 | //
5 | // Created by didi on 2023/6/13.
6 | //
7 |
8 | #import "UIView+HMRootView.h"
9 |
10 | @implementation UIView (HMRootView)
11 |
12 | @end
13 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/View/UIView+Hummer.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+Hummer.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 | #import "HMJSObject.h"
10 |
11 | @interface UIView(Hummer)
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/ViewPager/HMViewPager.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMViewPager.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/10/14.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMViewPager : UIView
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/ViewPager/HMViewPagerCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMViewPagerCell.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/10/14.
6 | //
7 |
8 | #import
9 |
10 | @class HMBaseValue;
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface HMViewPagerCell : UICollectionViewCell
15 |
16 | @property (nonatomic, nullable, strong) HMBaseValue *contentViewValue;
17 | @property (nonatomic, copy) NSIndexPath *indexPath;
18 |
19 | - (void)setImageURL:(NSString *)url;
20 |
21 | @end
22 |
23 | NS_ASSUME_NONNULL_END
24 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/ViewPager/HMViewPagerLayoutCardAnimator.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMViewPagerLayoutCardAnimator.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/10/14.
6 | //
7 |
8 | #import
9 | #import "HMViewPagerLayoutAnimator.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface HMViewPagerLayoutCardAnimator : NSObject
14 |
15 | @property (nonatomic) CGFloat minScale;
16 |
17 | @property (nonatomic) CGFloat minAlpha;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/Views/ViewPager/HMViewPagerPageAnimator.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMViewPagerPageAnimator.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/10/14.
6 | //
7 |
8 | #import
9 | #import "HMViewPagerLayoutAnimator.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface HMViewPagerPageAnimator : NSObject
14 |
15 | @property (nonatomic) CGFloat scaleRate;
16 |
17 | @property (nonatomic) CGFloat minAlpha;
18 |
19 | @property (nonatomic) CGFloat itemSpacing;
20 |
21 | @end
22 |
23 | NS_ASSUME_NONNULL_END
24 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Component/WebSocket/HMWebSocket.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | NS_ASSUME_NONNULL_BEGIN
4 |
5 | @interface HMWebSocket : NSObject
6 |
7 | - (void)close;
8 |
9 | - (instancetype)init NS_UNAVAILABLE;
10 |
11 | @end
12 |
13 | NS_ASSUME_NONNULL_END
14 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Bridge/HMDebug.h:
--------------------------------------------------------------------------------
1 | #if defined(DEBUG) && !defined(HMDEBUG)
2 | #define HMDEBUG
3 | #endif
4 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Bridge/HMJSContextDefines.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMJSContextDefines.h
3 | // Hummer
4 | //
5 | // Created by didi on 2022/3/29.
6 | //
7 |
8 | #import
9 |
10 | FOUNDATION_EXPORT NSErrorDomain const _Nonnull HMJSContextErrorDomain;
11 |
12 | /// HMJSContext error domain and codes
13 | typedef NS_ERROR_ENUM(HMJSContextErrorDomain, HMJSContextError) {
14 | HMJSContextErrorNotCallRender = 1000, // 没有调用render
15 | HMJSContextErrorRenderWithInvalidArg = 1001, // render 方法参数错误。
16 | };
17 |
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Bridge/HMJSContextDefines.m:
--------------------------------------------------------------------------------
1 | //
2 | // HMJSContextDefines.m
3 | // Hummer
4 | //
5 | // Created by didi on 2022/3/29.
6 | //
7 |
8 | #import "HMJSContextDefines.h"
9 |
10 | NSErrorDomain const _Nonnull HMJSContextErrorDomain = @"HMJSContextErrorDomain";
11 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Bridge/HMJSGlobal+Private.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMJSGlobal+Private.h
3 | // Hummer
4 | //
5 | // Created by didi on 2021/4/6.
6 | //
7 |
8 | #import "HMJSGlobal.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMJSGlobal (Private)
13 | /// 必须在 js 上下文中执行
14 | + (HMExceptionModel *)_evaluateString:(nonnull NSString *)jsString fileName:(nullable NSString *)fileName;
15 | + (HMExceptionModel *)_evaluateString:(nonnull NSString *)jsString fileName:(nullable NSString *)fileName inContext:(HMJSContext *)context;
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/EventTrack/HMEventTrackManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMEventTrackManager.h
3 | // AFDownloadRequestOperation
4 | //
5 | // Created by didi on 2020/8/13.
6 | //
7 |
8 | #import
9 | #import "HMEventTrackViewProperty.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface HMEventTrackManager : NSObject
14 |
15 | + (void)trackWithEventName:(NSString *)eventName view:(UIView *)view params:(NSDictionary *)params namespace:(NSString *)namespace;
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/EventTrack/HMEventTrackUtils.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMEventTrackUtils.h
3 | // AFDownloadRequestOperation
4 | //
5 | // Created by didi on 2020/8/13.
6 | //
7 |
8 | #import
9 | #import "HMEventTrackViewProperty.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface HMEventTrackUtils : NSObject
14 |
15 | + (NSMutableDictionary *)propertiesWithTrackObject:(id)object;
16 | + (long long)getCurrentTime;
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Layout/HMYogaConfig.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMYogaConfig.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | @interface HMYogaConfig : NSObject
11 |
12 | + (instancetype)defaulfConfig;
13 |
14 | - (NSString *)ygPropertyWithCSSAttr:(NSString *)cssAttr;
15 |
16 | - (SEL)converterWithCSSAttr:(NSString *)cssAttr;
17 |
18 | - (NSArray *)yogaProperties;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Layout/RenderObject/HMMeasureRenderObject.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMMeasureRenderObject.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/10/14.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMMeasureRenderObject : HMRenderObject
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Layout/RenderObject/HMTextRenderObject.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMTextRenderObject.h
3 | // Hummer
4 | //
5 | // Created by 唐佳诚 on 2020/10/23.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMTextRenderObject : HMRenderObject
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/Category/HMAnimatedImage+Hummer.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMAnimatedImage+Hummer.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/12/3.
6 | //
7 |
8 | #import "HMAnimatedImage.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMAnimatedImage (Hummer)
13 |
14 | - (NSTimeInterval)hm_animatedDuration;
15 | - (NSArray *)hm_animatedImages;
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/Category/HMImageCoderDefine.m:
--------------------------------------------------------------------------------
1 | //
2 | // HMImageCoderDefine.m
3 | // Hummer
4 | //
5 | // Created by didi on 2021/9/1.
6 | //
7 |
8 | #import "HMImageCoderDefine.h"
9 |
10 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/Category/NSData+Hummer.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSData+Hummer.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/11/19.
6 | //
7 |
8 | #import
9 | #import "HMImageCoderDefine.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface NSData (Hummer)
13 |
14 | + (HMImageFormat)hm_imageFormatForImageData:(nullable NSData *)data;
15 | + (nonnull CFStringRef)hm_UTTypeFromImageFormat:(HMImageFormat)format;
16 | + (HMImageFormat)hm_imageFormatFromUTType:(CFStringRef)uttype;
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/Category/NSURL+Hummer.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSURL+Hummer.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/11/18.
6 | //
7 |
8 | #import
9 | #import "HMURLConvertible.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface NSURL (Hummer)
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/Category/UIImage+HMMetadata.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+HMMetadata.h
3 | // Hummer
4 | //
5 | // Created by didi on 2021/9/1.
6 | //
7 |
8 | #import
9 | #import "HMImageCoderDefine.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface UIImage (HMMetadata)
14 |
15 | @property (nonatomic, assign) HMImageFormat hm_imageFormat;
16 |
17 | @property (nonatomic, assign) NSUInteger hm_imageLoopCount;
18 |
19 | @property (nonatomic, assign, readonly) BOOL hm_isAnimated;
20 | @end
21 |
22 | NS_ASSUME_NONNULL_END
23 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/Category/UIImage+Hummer.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+Hummer.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/11/19.
6 | //
7 |
8 | #import
9 | #import "HMImageCoder.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface UIImage (Hummer)
14 |
15 |
16 |
17 | + (UIImage *)hm_decodeImageWithData:(NSData *)data size:(CGSize)destSize scale:(CGFloat)destScale resizeMode:(HMResizeMode)resizeMode;
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/ConcreteLoader/HMBase64ImageLoader.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMBase64ImageLoader.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/11/17.
6 | //
7 |
8 | #import
9 | #import "HMImageLoader.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMBase64ImageLoader : NSObject
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/ConcreteLoader/HMLocalImageLoader.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMLocalImageLoader.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/11/18.
6 | //
7 |
8 | #import
9 | #import "HMImageLoader.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface HMLocalImageLoader : NSObject
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/ConcreteLoader/HMWebImageLoader.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMWebImageLoader.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/11/18.
6 | //
7 |
8 | #import
9 | #import "HMImageLoader.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface HMWebImageLoader : NSObject
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/Decoder/ConcreteCoder/APNG/HMImageAPNGCoder.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMImageAPNGCoder.h
3 | // Expecta
4 | //
5 | // Created by didi on 2021/9/6.
6 | //
7 |
8 | #import
9 | #import "HMImageIOAnimatedCoder.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | /**
14 | Built in coder using ImageIO that supports APNG encoding/decoding
15 | */
16 | @interface HMImageAPNGCoder : HMImageIOAnimatedCoder
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/Decoder/ConcreteCoder/HMGIFImageDecoder.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMGIFImageDecoder.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/11/25.
6 | //
7 |
8 | #import
9 | #import "HMImageIOAnimatedCoder.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMGIFImageDecoder : HMImageIOAnimatedCoder
13 |
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/Decoder/ConcreteCoder/IOImage/HMImageIOAnimatedCoder.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMIOImageAnimatedCoder.h
3 | // Hummer
4 | //
5 | // Created by didi on 2021/9/3.
6 | //
7 |
8 | #import
9 | #import "HMImageCoder.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMImageIOAnimatedCoder : NSObject
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/Decoder/ConcreteCoder/IOImage/HMImageIOCoder.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMIOImageCoder.h
3 | // Hummer
4 | //
5 | // Created by didi on 2021/9/3.
6 | //
7 |
8 | #import
9 | #import "HMImageCoder.h"
10 | #import "HMImageIOAnimatedCoder.h"
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface HMImageIOCoder : HMImageIOAnimatedCoder
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/Decoder/ConcreteCoder/Webp/HMWebpBuiltInImageCoder.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMWebpBuiltInImageCoder.h
3 | // Hummer
4 | //
5 | // Created by didi on 2021/9/1.
6 | //
7 |
8 | #import
9 | #import "HMImageIOAnimatedCoder.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface HMWebpBuiltInImageCoder : HMImageIOAnimatedCoder
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Manager/ImageLoader/Decoder/ConcreteCoder/Webp/HMWebpImageCoder.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMWebpImageCoder.h
3 | // Hummer
4 | //
5 | // Created by didi on 2021/9/1.
6 | //
7 |
8 | #import
9 | #import "HMImageCoder.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface HMWebpImageCoder : NSObject
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Proxy/HummerWeakProxy.h:
--------------------------------------------------------------------------------
1 | //
2 | // HummerWeakProxy.h
3 | // Expecta
4 | //
5 | // Created by didi on 2020/11/30.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HummerWeakProxy : NSProxy
13 | + (instancetype)weakProxyForObject:(id)targetObject;
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Utility/Category/NSData+HMConvertible.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSData+HMConvertible.h
3 | // WebSocket
4 | //
5 | // Created by didi on 2020/10/12.
6 | //
7 |
8 | #import
9 | #import "HMConvertibleProtocol.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface NSData (HMConvertible)
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Utility/Category/NSData+HMConvertible.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSData+HMConvertible.m
3 | // WebSocket
4 | //
5 | // Created by didi on 2020/10/12.
6 | //
7 |
8 | #import "NSData+HMConvertible.h"
9 |
10 | @implementation NSData (HMConvertible)
11 |
12 |
13 | - (nullable NSString *)hm_asString {
14 | return [[NSString alloc] initWithData:self encoding:NSUTF8StringEncoding];
15 | }
16 |
17 | - (nullable NSData *)hm_asData {
18 | return self;
19 | }
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Utility/Category/NSInvocation+Hummer.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSInvocation+Hummer.h
3 | // AfantySDK
4 | //
5 | // Created by didi on 2020/9/9.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface NSInvocation (Hummer)
14 |
15 | - (void)hm_setArgument:(nullable id)argumentLocation atIndex:(NSInteger)idx encodingType:(HMEncodingType)type;
16 |
17 | - (nullable id)hm_getReturnValueObject;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Utility/Category/NSString+HMConvertible.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSString+HMConvertible.h
3 | // WebSocket
4 | //
5 | // Created by didi on 2020/10/12.
6 | //
7 |
8 | #import
9 | #import "HMConvertibleProtocol.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface NSString (HMConvertible)
14 |
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Utility/Category/NSString+HMConvertible.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSString+HMConvertible.m
3 | // WebSocket
4 | //
5 | // Created by didi on 2020/10/12.
6 | //
7 |
8 | #import "NSString+HMConvertible.h"
9 |
10 | @implementation NSString (HMConvertible)
11 |
12 | - (nullable NSData *)hm_asData{
13 | return [self dataUsingEncoding:NSUTF8StringEncoding];
14 | }
15 | - (nullable NSString *)hm_asString {
16 | return self;
17 | }
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Utility/HMContainerModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // HMContainerModel.m
3 | // Hummer
4 | //
5 | // Created by 唐佳诚 on 2020/9/24.
6 | //
7 |
8 | #import "HMContainerModel.h"
9 |
10 | @implementation HMContainerModel
11 |
12 | @end
13 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Utility/HMDefines.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMDefines.h
3 | // Hummer
4 | //
5 | // Created by didi on 2021/12/24.
6 | //
7 |
8 | #import
9 | #define HM_SafeRunBlock(block,...) ((block)?(block(__VA_ARGS__)):nil)
10 |
11 |
12 | FOUNDATION_EXPORT NSErrorDomain const _Nonnull HMUrlSessionErrorDomain;
13 |
14 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Utility/HMDefines.m:
--------------------------------------------------------------------------------
1 | //
2 | // HMDefines.m
3 | // Hummer
4 | //
5 | // Created by didi on 2021/12/24.
6 | //
7 |
8 | #import "HMDefines.h"
9 |
10 | NSErrorDomain const _Nonnull HMUrlSessionErrorDomain = @"HMUrlSessionErrorDomain";
11 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Utility/HMLayoutUtils.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMLayoutUtils.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/10/26.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMLayoutUtils : NSObject
13 | + (NSDictionary *)rectForView:(UIView *)view;
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Utility/HMReporter.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMReporter.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMReporter : NSObject
13 |
14 | + (void)reportPerformanceWithBlock:(void (^)(dispatch_block_t finishBlock))excuteBlock forKey:(NSString *)reportKey namespace:(NSString *)namespace;
15 | + (void)reportValue:(id)value forKey:(NSString *)reportKey namespace:(NSString *)namespace;
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Utility/HMURLUtility.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMURLUtility.h
3 | // Hummer
4 | //
5 | // Created by didi on 2021/3/15.
6 | //
7 |
8 | #import
9 |
10 | NSString * HMQueryStringFromParameters(NSDictionary *parameters);
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface HMURLUtility : NSObject
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Utility/WeakPointerWrapper.h:
--------------------------------------------------------------------------------
1 | //
2 | // WeakPointerWrapper.h
3 | // Hummer
4 | //
5 | // Created by 唐佳诚 on 2020/4/23.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface WeakPointerWrapper<__covariant ObjectType> : NSObject
13 |
14 | @property (nonatomic, nullable, weak) ObjectType value;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Core/Utility/WeakPointerWrapper.m:
--------------------------------------------------------------------------------
1 | //
2 | // WeakPointerWrapper.m
3 | // Hummer
4 | //
5 | // Created by 唐佳诚 on 2020/4/23.
6 | //
7 |
8 | #import "WeakPointerWrapper.h"
9 |
10 | @implementation WeakPointerWrapper
11 |
12 | @end
13 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Dev/ViewInspector/HMViewInspector.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMViewInspector.h
3 | // Expecta
4 | //
5 | // Created by didi on 2021/8/5.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 |
14 |
15 |
16 | @interface HMViewInspector : NSObject
17 | + (void)highlightView:(nullable UIView *)view;
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Dev/ViewInspector/View/NSObject+HMDescription.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSObject+HMDescriptor.h
3 | // Hummer
4 | //
5 | // Created by didi on 2021/11/3.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface NSObject (HMDescription)
14 |
15 | @property (nonatomic, strong, nullable) NSNumber *hummerId;
16 |
17 | - (NSString *)hm_description;
18 |
19 | /// 标准容器展开
20 | - (NSString *)hm_devDescription;
21 |
22 | @end
23 |
24 | NS_ASSUME_NONNULL_END
25 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Dev/ViewInspector/View/UIView+HMDescription.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+HMDescriptor.h
3 | // Hummer
4 | //
5 | // Created by didi on 2021/11/3.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface UIView (HMDescription)
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Dev/ViewInspector/View/UIView+HMInspector.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+HMInspector.h
3 | // Hummer
4 | //
5 | // Created by didi on 2021/8/6.
6 | //
7 |
8 | #import
9 | #import
10 | #import
11 |
12 |
13 | NS_ASSUME_NONNULL_BEGIN
14 |
15 | @interface UIView (HMInspector)
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Engine/HMBaseWeakValueProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMBaseWeakValueProtocol.h
3 | // Hummer
4 | //
5 | // Created by 唐佳诚 on 2020/8/3.
6 | //
7 |
8 | #import
9 |
10 | @class HMBaseValue;
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @protocol HMBaseWeakValueProtocol
15 |
16 | @required
17 |
18 | @property (readonly, strong, nullable, nonatomic) HMBaseValue *value;
19 |
20 | @end
21 |
22 | NS_ASSUME_NONNULL_END
23 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Engine/JavaScriptCore/HMJSCExecutor+Internal.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMJSCExecutor+Internal.h
3 | // Hummer
4 | //
5 | // Created by didi on 2021/2/25.
6 | //
7 |
8 | #import "HMJSCExecutor.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMJSCExecutor (Internal)
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Engine/JavaScriptCore/HMJSCExecutor.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMJSCExecutor.h
3 | // Hummer
4 | //
5 | // Created by 唐佳诚 on 2021/1/13.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMJSCExecutor : NSObject
13 |
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Engine/N-API/HMBatchMainQueue.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMBatchMainQueue.h
3 | // Hummer
4 | //
5 | // Created by didi on 2023/4/6.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMBatchMainQueue : NSObject
13 |
14 | + (void)run:(dispatch_block_t)block;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Engine/N-API/HMJSExecutor.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | NS_ASSUME_NONNULL_BEGIN
4 |
5 | @interface HMJSExecutor : NSObject
6 |
7 |
8 | - (nullable instancetype)init NS_DESIGNATED_INITIALIZER;
9 |
10 | - (void)enableDebuggerWithTitle:(nullable NSString *)title;
11 |
12 | @end
13 |
14 | NS_ASSUME_NONNULL_END
15 |
16 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Engine/N-API/HMJSStrongValue.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import
4 |
5 | NS_ASSUME_NONNULL_BEGIN
6 |
7 | @interface HMJSStrongValue : HMBaseValue
8 |
9 | @property (nonatomic, assign, readonly) NAPIRef reference;
10 |
11 | - (nullable instancetype)initWithValueRef:(nullable NAPIValue)valueRef executor:(nullable id )executor NS_DESIGNATED_INITIALIZER;
12 |
13 | @end
14 |
15 | NS_ASSUME_NONNULL_END
16 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Engine/N-API/HMJSValue.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMJSValue.h
3 | // Pods
4 | //
5 | // Created by 唐佳诚 on 2021/8/9.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @protocol HMJSValue
14 |
15 | @required
16 |
17 | @property (nonatomic, nullable, assign, readonly) NAPIValue valueRef;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Engine/N-API/HMNAPIDebuggerHelper.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMHermesCppHelper.h
3 | // Hummer
4 | //
5 | // Created by didi on 2021/10/12.
6 | //
7 |
8 | #import
9 | #import "HMJSExecutor+Private.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface HMNAPIDebuggerHelper : NSObject
14 |
15 | - (void)napiCall_enableDebuggerAndMessageThread:(NAPIEnv)env title:(nullable NSString *)title;
16 | - (void)napiCall_disableDebugger;
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Event/Gesture/HMTouchGestureRecognizer.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMTouchGestureRecognizer.h
3 | // Hummer
4 | //
5 | // Created by didi on 2023/3/10.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | @class HMEventHandler;
12 |
13 | @interface HMTouchGestureRecognizer : UIGestureRecognizer
14 | - (instancetype)initWithHandler:(HMEventHandler *)eventHandler;
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Export/HMExportBaseClass.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMExportBaseClass.h
3 | // Hummer
4 | //
5 | // Created by 唐佳诚 on 2020/6/28.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMExportBaseClass : NSObject
13 |
14 | @property (nonatomic, nullable, copy) NSString *jsFieldName;
15 |
16 | - (nullable SEL)getTestSelector;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Export/HMExportBaseClass.m:
--------------------------------------------------------------------------------
1 | //
2 | // HMExportBaseClass.m
3 | // Hummer
4 | //
5 | // Created by 唐佳诚 on 2020/6/28.
6 | //
7 |
8 | #import "HMExportBaseClass.h"
9 |
10 | @implementation HMExportBaseClass
11 |
12 | - (SEL)getTestSelector {
13 | return nil;
14 | }
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Export/HMExportMethod.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMExportMethod.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMExportMethod : HMExportBaseClass
13 |
14 | @property (nonatomic, assign, nullable) SEL selector;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Export/HMExportMethod.m:
--------------------------------------------------------------------------------
1 | //
2 | // HMExportMethod.m
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import "HMExportMethod.h"
9 |
10 | @implementation HMExportMethod
11 |
12 | - (SEL)getTestSelector {
13 | return self.selector;
14 | }
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Export/HMExportProperty.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMExportProperty.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMExportProperty : HMExportBaseClass
13 |
14 | @property (nonatomic, assign, nullable) SEL propertyGetterSelector;
15 |
16 | @property (nonatomic, assign, nullable) SEL propertySetterSelector;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Export/HMExportProperty.m:
--------------------------------------------------------------------------------
1 | //
2 | // HMExportProperty.m
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import "HMExportProperty.h"
9 |
10 | @implementation HMExportProperty
11 |
12 | - (SEL)getTestSelector {
13 | return self.propertyGetterSelector;
14 | }
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Interceptor/HMApplicationRouterProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMApplicationRouterProtocol.h
3 | // Hummer
4 | //
5 | // Created by didi on 2023/5/24.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | /// 应用间跳转
12 | @protocol HMApplicationRouterProtocol
13 |
14 | /// 拦截 UIApplication openUrl, return YES 则不使用系统跳转行为
15 | - (BOOL)handleOpenUrl:(NSURL *)url;
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Interceptor/HMEventTrackProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMEventTrackProtocol.h
3 | // AFDownloadRequestOperation
4 | //
5 | // Created by didi on 2020/8/13.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @protocol HMEventTrackProtocol
13 | @optional
14 | - (void)asyncHandleTrackEvent:(NSDictionary *)event;
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Interceptor/HMFontProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMFontProtocol.h
3 | // Hummer
4 | //
5 | // Created by didi on 2022/10/8.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @protocol HMFontProtocol
13 |
14 | @property (nonatomic ,copy) NSString *defaultFontFamily;
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Interceptor/HMImageProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMImageProtocol.h
3 | // Hummer
4 | //
5 | // Created by didi on 2020/5/21.
6 | //
7 |
8 | #ifndef HMImageProtocol_h
9 | #define HMImageProtocol_h
10 |
11 | @class UIImage;
12 |
13 | @protocol HMImageProtocol
14 | @optional
15 |
16 | /// If a nonull image returned, it will be used.
17 | - (UIImage *)imageView:(id)imgView willSetImage:(UIImage *)image src:(NSString *)src;
18 |
19 | @end
20 |
21 | #endif /* HMImageProtocol_h */
22 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Interceptor/HMLoggerProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMLoggerProtocol.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @protocol HMLoggerProtocol
14 | @optional
15 |
16 | - (BOOL)handleJSLog:(NSString *)log level:(HMLogLevel)level;
17 | - (BOOL)handleNativeLog:(NSString *)log level:(HMLogLevel)level DEPRECATED_MSG_ATTRIBUTE("违背 namespace 设计");;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Interceptor/HMWebImageProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMWebImageProtocol.h
3 | // Hummer
4 | //
5 | // Copyright © 2019年 didi. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @protocol HMWebImageProtocol
13 | @optional
14 |
15 | - (void)setImageView:(id)imgView
16 | withURL:(NSURL *)url
17 | placeholderImage:(id)placeholder;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/iOS/Hummer/Classes/Version/HMUpgradeManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // HMUpgradeManager.h
3 | // Expecta
4 | //
5 | // Created by didi on 2021/7/8.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface HMUpgradeManager : NSObject
13 | + (void)upgrageStorageForNamespace:(NSString *)namespace;
14 | + (void)upgrageStorageForDefaultNamespace;
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/iOS/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | platform :ios, '9.0'
3 |
4 | target 'App' do
5 | # Comment the next line if you don't want to use dynamic frameworks
6 | #use_frameworks!
7 |
8 | # Pods for Example
9 | pod 'Hummer', :path => '..', :subspecs => ["OSSYoga"]
10 | pod 'Yoga'
11 |
12 | target 'AppTests' do
13 | inherit! :search_paths
14 | # Pods for testing
15 | pod 'Quick', '~> 4.0'
16 | pod 'Nimble', '~> 9.0'
17 | end
18 |
19 | end
20 |
--------------------------------------------------------------------------------
/iOS/builtin/.eslintignore:
--------------------------------------------------------------------------------
1 | # don't ever lint node_modules
2 | node_modules
3 | # don't lint build output (make sure it's set to your correct build folder name)
4 | dist
5 | # don't lint nyc coverage output
6 | coverage
7 |
--------------------------------------------------------------------------------
/iOS/builtin/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | parser: '@typescript-eslint/parser',
4 | plugins: [
5 | '@typescript-eslint',
6 | ],
7 | extends: [
8 | 'eslint:recommended',
9 | 'plugin:@typescript-eslint/recommended',
10 | ],
11 | };
12 |
--------------------------------------------------------------------------------
/iOS/builtin/@types/index.d.ts:
--------------------------------------------------------------------------------
1 | export {};
2 |
--------------------------------------------------------------------------------
/iOS/builtin/README.md:
--------------------------------------------------------------------------------
1 | ## 打包流程
2 | 1. npm install
3 | 2. npm run build
4 | 3. cp dist/main.js ../Hummer/Assets/Assets.xcassets/builtin.dataset/builtin.js
--------------------------------------------------------------------------------
/iOS/builtin/babel.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | [
4 | "babel-plugin-polyfill-corejs3",
5 | {
6 | "method": "usage-pure",
7 | "targets": {
8 | "ios": 9
9 | },
10 | "shippedProposals": true
11 | }
12 | ]
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/iOS/builtin/hm.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | type: 'library'
3 | }
4 |
--------------------------------------------------------------------------------
/iOS/builtin/src/.babelrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | [
4 | "@babel/preset-env",
5 | {
6 | "targets": {
7 | "ios": 9
8 | },
9 | "shippedProposals": true
10 | }
11 | ],
12 | "@babel/preset-typescript"
13 | ],
14 | "plugins": [
15 | "@babel/plugin-transform-runtime"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/iOS/builtin/src/console.test.ts:
--------------------------------------------------------------------------------
1 | import { getNativeLogFunction, LogLevel } from "./console"
2 |
3 | test('console', () => {
4 | globalThis.nativeLoggingHook = jest.fn()
5 | getNativeLogFunction(LogLevel.info)({})
6 | expect(globalThis.nativeLoggingHook.mock.calls.length).toBe(1)
7 | expect(globalThis.nativeLoggingHook.mock.calls[0][0]).toBe('{}')
8 | globalThis.nativeLoggingHook = undefined
9 | })
--------------------------------------------------------------------------------
/iOS/builtin/src/utility.ts:
--------------------------------------------------------------------------------
1 | export function isNotEmptyString(value: unknown): value is string {
2 | return typeof value === 'string' && value.length > 0
3 | }
4 |
5 | export function isOfType(varToBeChecked: unknown, propertyToCheckFor: keyof T): varToBeChecked is T {
6 | return (varToBeChecked as (T | undefined | null))?.[propertyToCheckFor] !== undefined
7 | }
--------------------------------------------------------------------------------
/market/component_material_market.md:
--------------------------------------------------------------------------------
1 | # 组件物料市场
2 |
3 | | 组件名 | 组件仓库 | 作者 | 描述 |
4 | | ---- | ---- | ---- | ---- |
5 | | checkbox | https://xxx/xxx | 测试 | 复选框组件 |
--------------------------------------------------------------------------------
/tenon/.gitignore:
--------------------------------------------------------------------------------
1 | # log
2 | *.log
3 |
4 | # Editor
5 | .DS_Store
6 | .idea
7 | # Common
8 | node_modules
9 | coverage
10 | explorations
11 | packages/*/dist/*
12 | package-lock.json
13 | report.*.json
--------------------------------------------------------------------------------
/tenon/.prettierrc:
--------------------------------------------------------------------------------
1 | semi: false
2 | singleQuote: true
3 | printWidth: 80
4 |
--------------------------------------------------------------------------------
/tenon/README.md:
--------------------------------------------------------------------------------
1 | # Tenon
2 | > MVVM For Hummer
3 | 针对 Hummer 的 MVVM 框架
4 |
5 | ## Tenon Vue 架构图
6 | 
7 |
8 | ## Tenon React 开发中,敬请期待
9 | ## [官方文档](https://hummer.didi.cn/doc-tenon#/zh-CN/)
10 |
11 |
--------------------------------------------------------------------------------
/tenon/__tests__/setup.js:
--------------------------------------------------------------------------------
1 | globalThis.Hummer = {
2 | env: {
3 | namespace: 'Hummer'
4 | }
5 | }
--------------------------------------------------------------------------------
/tenon/lerna.json:
--------------------------------------------------------------------------------
1 | {
2 | "tagVersionPrefix": "tenon_",
3 | "packages": [
4 | "packages/*"
5 | ],
6 | "version": "independent",
7 | "npmClient": "npm",
8 | "command": {
9 | "publish": {
10 | "message": "chore(release): tenon publish",
11 | "allowBranch": [
12 | "master",
13 | "release"
14 | ],
15 | "ignoreChanges": [
16 | "*.md",
17 | "lerna.json"
18 | ],
19 | "registry": "https://registry.npmjs.org/"
20 | },
21 | "npmClientArgs": [
22 | "--no-package-lock"
23 | ]
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/tenon/packages/global.d.ts:
--------------------------------------------------------------------------------
1 | declare var __GLOBAL__: any
2 | declare var __DEV__: Boolean
3 | declare const Hummer: any
4 | declare const Memory:any;
5 | declare const NODE_DEBUG_ENV: Boolean
--------------------------------------------------------------------------------
/tenon/packages/tenon-compiler/README.md:
--------------------------------------------------------------------------------
1 | # `runtime`
2 |
3 | > TODO: description
4 |
5 | ## Usage
6 |
7 | ```
8 | const runtime = require('runtime');
9 |
10 | // TODO: DEMONSTRATE API
11 | ```
12 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-compiler/src/parserOptions.ts:
--------------------------------------------------------------------------------
1 | import {isCustomNativeTag, isNativeTags} from '@hummer/tenon-utils'
2 |
3 |
4 |
5 | export const parserOptions = {
6 | isNativeTag: (tag:string) => {
7 | return isNativeTags(tag) || isCustomNativeTag(tag)
8 | },
9 | isBuiltInComponent: () => {}
10 | }
--------------------------------------------------------------------------------
/tenon/packages/tenon-compiler/src/transforms/transformComment.ts:
--------------------------------------------------------------------------------
1 | import { NodeTransform, NodeTypes } from '@vue/compiler-core'
2 |
3 | /**
4 | * 去除Comment节点
5 | * @param node 当前节点
6 | * @param context 上下文
7 | */
8 | export const transformComment: NodeTransform = (node, context) => {
9 | if(node.type === NodeTypes.COMMENT){
10 | context.removeNode(node)
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-compiler/src/transforms/vShow.ts:
--------------------------------------------------------------------------------
1 | import { DirectiveTransform } from '@vue/compiler-core'
2 | import { createDOMCompilerError, DOMErrorCodes } from '../errors'
3 | import { V_SHOW } from '../runtimeHelpers'
4 |
5 | export const transformShow: DirectiveTransform = (dir, node, context) => {
6 | const { exp, loc } = dir
7 | if (!exp) {
8 | context.onError(
9 | createDOMCompilerError(DOMErrorCodes.X_V_SHOW_NO_EXPRESSION, loc)
10 | )
11 | }
12 |
13 | return {
14 | props: [],
15 | needRuntime: context.helper(V_SHOW)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-core/README.md:
--------------------------------------------------------------------------------
1 | # Tenon Core
2 |
3 | Tenon Driver For Hummer
4 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-core/__tests__/index.test.ts:
--------------------------------------------------------------------------------
1 | describe('base', () => {
2 | test('base render', () => {
3 |
4 | })
5 | })
6 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-core/src/helper/page-helper.ts:
--------------------------------------------------------------------------------
1 | export type PageConfig = {
2 | canScroll: Boolean
3 | }
4 |
5 |
6 | export interface PageComponent {
7 | onLoad: Function | null,
8 | onShow: Function | null,
9 | onHide: Function | null,
10 | onUnload: Function | null,
11 | onBack: Function | null,
12 | pageConfig: PageConfig | null
13 | }
--------------------------------------------------------------------------------
/tenon/packages/tenon-core/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './nodes/index'
2 | export * from './utils/style'
3 |
4 |
5 | import {Document} from './nodes/document'
6 |
7 | export const document = new Document();
8 |
9 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-core/src/nodes/components/anchor.ts:
--------------------------------------------------------------------------------
1 | import {View as ViewComponent} from '@hummer/hummer-front'
2 | import {Base} from '../Base'
3 | import {NODE_ANCHOR} from '@hummer/tenon-utils'
4 |
5 | export class Anchor extends Base{
6 | __NAME = NODE_ANCHOR
7 |
8 | constructor(){
9 | super();
10 | this.element = new ViewComponent();
11 | this.element.style = {
12 | display: "none"
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-core/src/nodes/components/extend/loadmore.ts:
--------------------------------------------------------------------------------
1 | import {View} from '../view'
2 | import {NODE_LOADMORE} from '@hummer/tenon-utils'
3 |
4 | export class LoadMore extends View{
5 | __NAME = NODE_LOADMORE
6 | }
7 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-core/src/nodes/components/extend/refresh.ts:
--------------------------------------------------------------------------------
1 | import {View} from '../view'
2 | import {NODE_REFRESH} from '@hummer/tenon-utils'
3 |
4 | export class Refresh extends View{
5 | __NAME = NODE_REFRESH
6 | }
7 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-core/src/nodes/components/view.ts:
--------------------------------------------------------------------------------
1 | import {View as ViewComponent} from '@hummer/hummer-front'
2 | import {Base} from '../Base'
3 | import {NODE_VIEW} from '@hummer/tenon-utils'
4 |
5 | export class View extends Base{
6 | __NAME = NODE_VIEW
7 |
8 | constructor(isView:boolean = true){
9 | super();
10 | if(!isView){
11 | return
12 | }
13 | this.element = new ViewComponent();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-core/src/nodes/index.ts:
--------------------------------------------------------------------------------
1 | export * from './Base'
2 | export * from './component'
3 | export * from './types'
4 |
5 | export * from './components/image'
6 | export * from './components/input'
7 | export * from './components/text'
8 | export * from './components/view'
9 | export * from './components/textarea'
10 | export * from './components/page'
11 | export * from './components/button'
12 | export * from './components/switch'
--------------------------------------------------------------------------------
/tenon/packages/tenon-dev-tool/README.md:
--------------------------------------------------------------------------------
1 | # Tenon DevTool
--------------------------------------------------------------------------------
/tenon/packages/tenon-dev-tool/__tests__/index.test.ts:
--------------------------------------------------------------------------------
1 | describe('base', () => {
2 |
3 | test('base devtool', () => {
4 |
5 | })
6 |
7 | })
8 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-dev-tool/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@hummer/tenon-dev-tool",
3 | "version": "0.2.6",
4 | "description": "Tenon Dev Tool",
5 | "author": "duanlikang",
6 | "homepage": "",
7 | "license": "ISC",
8 | "main": "dist/tenon-dev-tool.cjs.js",
9 | "types": "dist/types/index.d.ts",
10 | "typings": "dist/types/index.d.ts",
11 | "publishConfig": {
12 | "access": "public"
13 | },
14 | "files": [
15 | "dist"
16 | ],
17 | "scripts": {
18 | "test": "echo \"Error: run tests from root\" && exit 1"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-react/__tests__/index.test.ts:
--------------------------------------------------------------------------------
1 | describe('base', () => {
2 | test('base render', () => {
3 |
4 | })
5 | })
6 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-react/src/events/event.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * 获取标准的 Event 对象,进行事件逻辑的抽象
3 | */
4 | export function getEvent(event:any){
5 | // TODO 增加 Event 统一处理
6 | return event
7 | }
--------------------------------------------------------------------------------
/tenon/packages/tenon-react/src/events/listener.ts:
--------------------------------------------------------------------------------
1 | import {Base as Element} from "@hummer/tenon-core"
2 | import {getFiberCurrentPropsFromNode} from '../hostConfig/utils'
3 | /**
4 | * 获取标准的 Listener函数
5 | */
6 | export function getListener(node: Element, propName: string, func:Function){
7 | return function(...args: Array){
8 | let props = getFiberCurrentPropsFromNode(node);
9 | let originFunc = props[propName];
10 | originFunc.apply(null, args)
11 | }
12 | }
--------------------------------------------------------------------------------
/tenon/packages/tenon-react/src/index.ts:
--------------------------------------------------------------------------------
1 | import {render} from './render'
2 | import {register as registerComponent} from '@hummer/tenon-core'
3 |
4 | export * from '@hummer/tenon-core'
5 | export * from './render'
6 | export * from './hook'
7 |
8 | export default {
9 | render,
10 | register: registerComponent
11 | }
--------------------------------------------------------------------------------
/tenon/packages/tenon-react/src/lifecycle/global-lifecycle.ts:
--------------------------------------------------------------------------------
1 | import {LifeCycle, lifeCycles, triggerLifeCycle} from './index'
2 |
3 | export const GlobalLifeCycles:Record = initGlobalLifeCycle()
4 |
5 | function initGlobalLifeCycle():Record{
6 | let globalLifeCycle:any= {}
7 | lifeCycles.forEach((lifecycle: LifeCycle) => {
8 | globalLifeCycle[lifecycle] = function(){
9 | return triggerLifeCycle(lifecycle)
10 | }
11 | })
12 |
13 | return globalLifeCycle
14 | }
--------------------------------------------------------------------------------
/tenon/packages/tenon-store/src/injectKey.ts:
--------------------------------------------------------------------------------
1 | import { inject } from '@hummer/tenon-vue'
2 |
3 | export const storeKey = 'store'
4 |
5 | export function useStore (key?:string) {
6 | return inject(key || storeKey)
7 | }
8 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-store/src/plugins/utils/types.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Store的数据操作类型
3 | */
4 | export enum OperationType {
5 | ADD,
6 | DELETE,
7 | UPDATE
8 | }
9 |
10 | export interface Operation{
11 | type: OperationType,
12 | key: Array,
13 | value: any
14 | }
15 |
16 | export type Operations = Array
--------------------------------------------------------------------------------
/tenon/packages/tenon-utils/README.md:
--------------------------------------------------------------------------------
1 | # `runtime`
2 |
3 | > TODO: description
4 |
5 | > FIXME: asd
6 | > DK: asd
7 | ## Usage
8 |
9 | ```
10 | const runtime = require('runtime');
11 |
12 | // TODO: DEMONSTRATE API
13 | ```
14 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-utils/__tests__/index.test.ts:
--------------------------------------------------------------------------------
1 | describe('base', () => {
2 |
3 | test('base render', () => {
4 |
5 | })
6 |
7 | })
8 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-utils/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@hummer/tenon-utils",
3 | "version": "1.2.15",
4 | "description": "Tenon工具库",
5 | "author": "duanlikang",
6 | "homepage": "",
7 | "license": "ISC",
8 | "main": "dist/tenon-utils.cjs.js",
9 | "types": "dist/types/index.d.ts",
10 | "typings": "dist/types/index.d.ts",
11 | "publishConfig": {
12 | "access": "public"
13 | },
14 | "files": [
15 | "dist",
16 | "src"
17 | ],
18 | "scripts": {
19 | "test": "echo \"Error: run tests from root\" && exit 1"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-utils/src/components/index.ts:
--------------------------------------------------------------------------------
1 | import {makeMap} from '../utils'
2 | const isNativeTagReg = /^ex-/
3 |
4 | export const NativeTags = "view,text,image,input,textarea,button,scroller,switch,refresh,loadmore,list,viewpager"
5 | export const isNativeTags = makeMap(NativeTags)
6 | export const isCustomNativeTag = (tag:string) => {
7 | return isNativeTagReg.test(tag)
8 | }
9 |
10 | export * from './types'
--------------------------------------------------------------------------------
/tenon/packages/tenon-utils/src/index.ts:
--------------------------------------------------------------------------------
1 | export const extend = Object.assign
2 | export * from './normalizeProp'
3 | export * from './style'
4 | export * from './utils'
5 | export * from './components'
--------------------------------------------------------------------------------
/tenon/packages/tenon-utils/src/normalizeProp.ts:
--------------------------------------------------------------------------------
1 | const listDelimiterRE = /;(?![^(]*\))/g
2 | const propertyDelimiterRE = /:(.+)/
3 | export type NormalizedStyle = Record
4 |
5 | export function parseStringStyle(cssText: string): NormalizedStyle {
6 | const ret: NormalizedStyle = {}
7 | cssText.split(listDelimiterRE).forEach(item => {
8 | if (item) {
9 | const tmp = item.split(propertyDelimiterRE)
10 | tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim())
11 | }
12 | })
13 | return ret
14 | }
15 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-utils/src/style/common/background.ts:
--------------------------------------------------------------------------------
1 | export const CLIP_LIST = [
2 | 'border-box',
3 | 'padding-box',
4 | 'content-box',
5 | 'text'
6 | ]
7 |
8 | export const REPEAT_LIST = [
9 | 'repeat-x',
10 | 'repeat-y',
11 | 'repeat',
12 | 'space',
13 | 'round',
14 | 'no-repeat'
15 | ]
16 |
17 | export const SIZE_LIST = [
18 | 'contain',
19 | 'cover'
20 | ]
--------------------------------------------------------------------------------
/tenon/packages/tenon-utils/src/style/common/default-style.ts:
--------------------------------------------------------------------------------
1 | export const DefaultStyle = {
2 | "view": {
3 | "backgroundColor": "inherit"
4 | },
5 | "text":{
6 | "color": "inherit"
7 | }
8 | }
9 |
10 |
11 | /**
12 | * 根据Tag,获取默认样式
13 | * @param tag
14 | */
15 | export function getDefaultStyleByTag(tag: string):Record{
16 | let style = {}
17 | switch(tag){
18 | case 'view':
19 | style = DefaultStyle['view']
20 | break;
21 | case 'text':
22 | style = DefaultStyle['text']
23 | break;
24 | }
25 | return style
26 | }
--------------------------------------------------------------------------------
/tenon/packages/tenon-utils/src/style/transformer/attrname.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * 属性名驼峰转换
3 | * @param style 待转换的Style值
4 | */
5 | export function transformAttr(style:Record){
6 | let tempStyle:Record = {}
7 | Object.keys(style).forEach(key => {
8 | let humpKey = transformHumpKey(key)
9 | tempStyle[humpKey] = style[key]
10 | })
11 | return tempStyle
12 | }
13 |
14 | function transformHumpKey(key: string):string{
15 | let humpKey = key.replace(/-(\w)/g, ($0, $1) => {
16 | return $1.toUpperCase()
17 | })
18 | return humpKey
19 | }
--------------------------------------------------------------------------------
/tenon/packages/tenon-vue/__tests__/index.test.ts:
--------------------------------------------------------------------------------
1 | describe('base', () => {
2 |
3 | test('base render', () => {
4 |
5 | })
6 |
7 | })
8 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-vue/src/index.d.ts:
--------------------------------------------------------------------------------
1 | declare var __GLOBAL__: any
2 | declare var __DEV__: Boolean
3 | export * from './index'
--------------------------------------------------------------------------------
/tenon/packages/tenon-vue/src/index.ts:
--------------------------------------------------------------------------------
1 | import {render} from './runtime'
2 |
3 | export * from './runtime'
4 | export * from './utils/style'
5 |
6 | export default {
7 | render
8 | }
9 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-vue/src/runtime/handlers/attrs.ts:
--------------------------------------------------------------------------------
1 | import { Base } from '../nodes/Base'
2 |
3 | export function patchAttrs(
4 | el: Base,
5 | key: string,
6 | prevValue: any,
7 | nextValue: any){
8 |
9 | el.setAttribute(key, nextValue);
10 | }
--------------------------------------------------------------------------------
/tenon/packages/tenon-vue/src/runtime/handlers/class.ts:
--------------------------------------------------------------------------------
1 | import { Base } from '../nodes/Base'
2 | export function patchClass(
3 | el: Base,
4 | key: string,
5 | prevValue: any,
6 | nextValue: any){
7 | // 处理Class的绑定
8 | el.setAttribute(key, nextValue);
9 | }
10 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-vue/src/runtime/handlers/style.ts:
--------------------------------------------------------------------------------
1 | import { Base } from '../nodes/Base'
2 | import {parseStringStyle, styleTransformer} from '@hummer/tenon-utils'
3 | export function patchStyle(
4 | el: Base,
5 | key: string,
6 | prevValue: any,
7 | nextValue: any){
8 |
9 | let style = nextValue
10 | if(typeof nextValue === 'string'){
11 | style = parseStringStyle(nextValue)
12 | }
13 | // 样式转换为 Hummer 特有样式
14 | style = styleTransformer.transformStyle(style, el);
15 |
16 | el.setStyle(style, true)
17 | }
18 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-vue/src/runtime/helper/page-helper.ts:
--------------------------------------------------------------------------------
1 | export type PageConfig = {
2 | canScroll: Boolean
3 | }
4 |
5 |
6 | export interface PageComponent {
7 | onLoad: Function | null,
8 | onReady: Function | null,
9 | onShow: Function | null,
10 | onHide: Function | null,
11 | onUnload: Function | null,
12 | onBack: Function | null,
13 | pageConfig: PageConfig | null
14 | }
--------------------------------------------------------------------------------
/tenon/packages/tenon-vue/src/runtime/nodes/components/anchor.ts:
--------------------------------------------------------------------------------
1 | import {View as ViewComponent} from '@hummer/hummer-front'
2 | import {Base} from '../Base'
3 | import {NODE_ANCHOR} from '@hummer/tenon-utils'
4 |
5 | export class Anchor extends Base{
6 | __NAME = NODE_ANCHOR
7 |
8 | constructor(){
9 | super();
10 | this.element = new ViewComponent();
11 | this.element.style = {
12 | display: "none"
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-vue/src/runtime/nodes/components/extend/loadmore.ts:
--------------------------------------------------------------------------------
1 | import {View} from '../view'
2 | import {NODE_LOADMORE} from '@hummer/tenon-utils'
3 |
4 | export class LoadMore extends View{
5 | __NAME = NODE_LOADMORE
6 | }
7 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-vue/src/runtime/nodes/components/extend/refresh.ts:
--------------------------------------------------------------------------------
1 | import {View} from '../view'
2 | import {NODE_REFRESH} from '@hummer/tenon-utils'
3 |
4 | export class Refresh extends View{
5 | __NAME = NODE_REFRESH
6 | }
7 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-vue/src/runtime/nodes/components/view.ts:
--------------------------------------------------------------------------------
1 | import {View as ViewComponent} from '@hummer/hummer-front'
2 | import {Base} from '../Base'
3 | import {NODE_VIEW} from '@hummer/tenon-utils'
4 |
5 | export class View extends Base{
6 | __NAME = NODE_VIEW
7 |
8 | constructor(isView:boolean = true){
9 | super();
10 | if(!isView){
11 | return
12 | }
13 | this.element = new ViewComponent();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/tenon/packages/tenon-vue/src/runtime/nodes/index.ts:
--------------------------------------------------------------------------------
1 | export * from './Base'
2 | export * from './component'
3 |
4 | export * from './components/image'
5 | export * from './components/input'
6 |
7 | // FIXME: Text组件命令与RuntimeCore命名冲突,暂时不导出Text组件
8 | // export * from './components/text'
9 | export * from './components/view'
10 | export * from './components/textarea'
11 | export * from './components/page'
12 | export * from './components/button'
13 | export * from './components/switch'
--------------------------------------------------------------------------------
/tenon/packages/tenon-vue/src/utils/adapter.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * 全局适配Api
3 | */
4 | export function adapterApi(){
5 | adapterTimeInterval()
6 | }
7 |
8 | /**
9 | * 适配Time Interval
10 | */
11 | function adapterTimeInterval(){
12 | let _interval = __GLOBAL__.setInterval
13 | __GLOBAL__.setInterval = function(...args:any){
14 | let intervalHandler = _interval(args)
15 | return intervalHandler
16 | }
17 | }
--------------------------------------------------------------------------------
/tenon/packages/tenon/README.md:
--------------------------------------------------------------------------------
1 | # `@hummer/Tenon`
2 | > 针对 Tenon Vue的包含 Tenon Vue 运行时 和 Tenon Compiler 编译时代码。
3 | > 允许代码使用 render 函数。
--------------------------------------------------------------------------------
/tenon/packages/tenon/__tests__/index.test.ts:
--------------------------------------------------------------------------------
1 | describe('base', () => {
2 |
3 | test('base render', () => {
4 |
5 | })
6 |
7 | })
8 |
--------------------------------------------------------------------------------