@bytedance/mona
Advanced tools
Comparing version 0.3.40-alpha.0 to 0.3.40
@@ -0,1 +1,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var SocketTaskReadyState; | ||
@@ -10,3 +12,2 @@ (function (SocketTaskReadyState) { | ||
} | ||
export {}; | ||
//# sourceMappingURL=BaseApis.js.map |
@@ -0,4 +1,6 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
class BaseComponents { | ||
} | ||
export default BaseComponents; | ||
exports.default = BaseComponents; | ||
//# sourceMappingURL=BaseComponents.js.map |
@@ -1,4 +0,7 @@ | ||
export function createAppConfig(appConfig) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createAppConfig = createAppConfig; | ||
function createAppConfig(appConfig) { | ||
return appConfig; | ||
} | ||
//# sourceMappingURL=createAppConfig.js.map |
@@ -1,4 +0,7 @@ | ||
export function createPageConfig(pageConfig) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createPageConfig = createPageConfig; | ||
function createPageConfig(pageConfig) { | ||
return pageConfig; | ||
} | ||
//# sourceMappingURL=createPageConfig.js.map |
@@ -1,4 +0,7 @@ | ||
export function createProjectConfig(projectConfig) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createProjectConfig = createProjectConfig; | ||
function createProjectConfig(projectConfig) { | ||
return projectConfig; | ||
} | ||
//# sourceMappingURL=createProjectConfig.js.map |
@@ -1,8 +0,32 @@ | ||
export { createProjectConfig } from './createProjectConfig'; | ||
export { createAppConfig } from './createAppConfig'; | ||
export { createPageConfig } from './createPageConfig'; | ||
export * from './BaseApis'; | ||
export { default as BaseComponents } from './BaseComponents'; | ||
export * from './BaseComponents'; | ||
export * from './lifecycle'; | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BaseComponents = exports.createPageConfig = exports.createAppConfig = exports.createProjectConfig = void 0; | ||
var createProjectConfig_1 = require("./createProjectConfig"); | ||
Object.defineProperty(exports, "createProjectConfig", { enumerable: true, get: function () { return createProjectConfig_1.createProjectConfig; } }); | ||
var createAppConfig_1 = require("./createAppConfig"); | ||
Object.defineProperty(exports, "createAppConfig", { enumerable: true, get: function () { return createAppConfig_1.createAppConfig; } }); | ||
var createPageConfig_1 = require("./createPageConfig"); | ||
Object.defineProperty(exports, "createPageConfig", { enumerable: true, get: function () { return createPageConfig_1.createPageConfig; } }); | ||
__exportStar(require("./BaseApis"), exports); | ||
var BaseComponents_1 = require("./BaseComponents"); | ||
Object.defineProperty(exports, "BaseComponents", { enumerable: true, get: function () { return __importDefault(BaseComponents_1).default; } }); | ||
__exportStar(require("./BaseComponents"), exports); | ||
__exportStar(require("./lifecycle"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,9 @@ | ||
import React from 'react'; | ||
export var AppLifecycle; | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ComponentLifecycleGlobalContext = exports.AppLifecycleGlobalContext = exports.PageLifecycleGlobalContext = exports.LifecycleContext = exports.ComponentLifecycle = exports.PageLifecycle = exports.AppLifecycle = void 0; | ||
const react_1 = __importDefault(require("react")); | ||
var AppLifecycle; | ||
(function (AppLifecycle) { | ||
@@ -10,4 +16,4 @@ AppLifecycle["launch"] = "onLaunch"; | ||
AppLifecycle["unhandledRejection"] = "onUnhandledRejection"; | ||
})(AppLifecycle || (AppLifecycle = {})); | ||
export var PageLifecycle; | ||
})(AppLifecycle || (exports.AppLifecycle = AppLifecycle = {})); | ||
var PageLifecycle; | ||
(function (PageLifecycle) { | ||
@@ -24,4 +30,4 @@ PageLifecycle["load"] = "onLoad"; | ||
PageLifecycle["pageScroll"] = "onPageScroll"; | ||
})(PageLifecycle || (PageLifecycle = {})); | ||
export var ComponentLifecycle; | ||
})(PageLifecycle || (exports.PageLifecycle = PageLifecycle = {})); | ||
var ComponentLifecycle; | ||
(function (ComponentLifecycle) { | ||
@@ -33,4 +39,4 @@ ComponentLifecycle["created"] = "onCreated"; | ||
ComponentLifecycle["detached"] = "onDetached"; | ||
})(ComponentLifecycle || (ComponentLifecycle = {})); | ||
export class LifecycleContext { | ||
})(ComponentLifecycle || (exports.ComponentLifecycle = ComponentLifecycle = {})); | ||
class LifecycleContext { | ||
constructor() { | ||
@@ -63,5 +69,6 @@ this.lifecycle = new Proxy({}, { | ||
} | ||
export const PageLifecycleGlobalContext = React.createContext(null); | ||
export const AppLifecycleGlobalContext = React.createContext(null); | ||
export const ComponentLifecycleGlobalContext = React.createContext(null); | ||
exports.LifecycleContext = LifecycleContext; | ||
exports.PageLifecycleGlobalContext = react_1.default.createContext(null); | ||
exports.AppLifecycleGlobalContext = react_1.default.createContext(null); | ||
exports.ComponentLifecycleGlobalContext = react_1.default.createContext(null); | ||
//# sourceMappingURL=context.js.map |
@@ -1,8 +0,12 @@ | ||
import { useLayoutEffect, useContext } from 'react'; | ||
import { AppLifecycleGlobalContext, PageLifecycleGlobalContext } from './context'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useAppEvent = useAppEvent; | ||
exports.usePageEvent = usePageEvent; | ||
const react_1 = require("react"); | ||
const context_1 = require("./context"); | ||
; | ||
// for app | ||
export function useAppEvent(eventName, callback) { | ||
const appLifecycle = useContext(AppLifecycleGlobalContext); | ||
useLayoutEffect(() => { | ||
function useAppEvent(eventName, callback) { | ||
const appLifecycle = (0, react_1.useContext)(context_1.AppLifecycleGlobalContext); | ||
(0, react_1.useLayoutEffect)(() => { | ||
let clear = appLifecycle === null || appLifecycle === void 0 ? void 0 : appLifecycle.registerLifecycle(eventName, callback); | ||
@@ -13,5 +17,5 @@ return () => clear === null || clear === void 0 ? void 0 : clear(); | ||
// for page | ||
export function usePageEvent(eventName, callback) { | ||
const pageLifecycleContext = useContext(PageLifecycleGlobalContext); | ||
useLayoutEffect(() => { | ||
function usePageEvent(eventName, callback) { | ||
const pageLifecycleContext = (0, react_1.useContext)(context_1.PageLifecycleGlobalContext); | ||
(0, react_1.useLayoutEffect)(() => { | ||
let clear = pageLifecycleContext === null || pageLifecycleContext === void 0 ? void 0 : pageLifecycleContext.registerLifecycle(eventName, callback); | ||
@@ -18,0 +22,0 @@ return () => clear === null || clear === void 0 ? void 0 : clear(); |
@@ -1,3 +0,22 @@ | ||
export { usePageEvent, useAppEvent } from './hooks'; | ||
export * from './context'; | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useAppEvent = exports.usePageEvent = void 0; | ||
var hooks_1 = require("./hooks"); | ||
Object.defineProperty(exports, "usePageEvent", { enumerable: true, get: function () { return hooks_1.usePageEvent; } }); | ||
Object.defineProperty(exports, "useAppEvent", { enumerable: true, get: function () { return hooks_1.useAppEvent; } }); | ||
__exportStar(require("./context"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,3 @@ | ||
export {}; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=util.js.map |
{ | ||
"name": "@bytedance/mona", | ||
"version": "0.3.40-alpha.0", | ||
"version": "0.3.40", | ||
"description": "Merchant app's developing and building tools", | ||
@@ -34,3 +34,3 @@ "main": "./dist/index", | ||
}, | ||
"gitHead": "6ecf1865b554309013b6454878161a290bd97b50" | ||
"gitHead": "b2f6dad49eaf2e6f75a917366a4d3601dbd25461" | ||
} |
Sorry, the diff of this file is not supported yet
105143
34
2597
1