@stackflow/react
Advanced tools
Comparing version 1.2.0-canary.1 to 1.2.0-canary.2
@@ -1,33 +0,13 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var ActivityProvider_exports = {}; | ||
__export(ActivityProvider_exports, { | ||
ActivityContext: () => ActivityContext, | ||
ActivityProvider: () => ActivityProvider | ||
}); | ||
module.exports = __toCommonJS(ActivityProvider_exports); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var import_react = require("react"); | ||
var import_utils = require("../utils"); | ||
const ActivityContext = (0, import_react.createContext)(null); | ||
import { jsx } from "react/jsx-runtime"; | ||
import { createContext } from "react"; | ||
import { useMemoDeep } from "../utils"; | ||
const ActivityContext = createContext(null); | ||
const ActivityProvider = ({ | ||
children, | ||
value | ||
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActivityContext.Provider, { value: (0, import_utils.useMemoDeep)(value), children }); | ||
}) => /* @__PURE__ */ jsx(ActivityContext.Provider, { value: useMemoDeep(value), children }); | ||
ActivityProvider.displayName = "ActivityProvider"; | ||
export { | ||
ActivityContext, | ||
ActivityProvider | ||
}; |
@@ -1,22 +0,5 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var activity_exports = {}; | ||
module.exports = __toCommonJS(activity_exports); | ||
__reExport(activity_exports, require("./ActivityProvider"), module.exports); | ||
__reExport(activity_exports, require("./makeActivityId"), module.exports); | ||
__reExport(activity_exports, require("./makeStepId"), module.exports); | ||
__reExport(activity_exports, require("./useActivity"), module.exports); | ||
__reExport(activity_exports, require("./useActivityParams"), module.exports); | ||
export * from "./ActivityProvider"; | ||
export * from "./makeActivityId"; | ||
export * from "./makeStepId"; | ||
export * from "./useActivity"; | ||
export * from "./useActivityParams"; |
@@ -1,27 +0,7 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var makeActivityId_exports = {}; | ||
__export(makeActivityId_exports, { | ||
makeActivityId: () => makeActivityId | ||
}); | ||
module.exports = __toCommonJS(makeActivityId_exports); | ||
var import_core = require("@stackflow/core"); | ||
import { id } from "@stackflow/core"; | ||
function makeActivityId() { | ||
return (0, import_core.id)(); | ||
return id(); | ||
} | ||
export { | ||
makeActivityId | ||
}; |
@@ -1,27 +0,7 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var makeStepId_exports = {}; | ||
__export(makeStepId_exports, { | ||
makeStepId: () => makeStepId | ||
}); | ||
module.exports = __toCommonJS(makeStepId_exports); | ||
var import_core = require("@stackflow/core"); | ||
import { id } from "@stackflow/core"; | ||
function makeStepId() { | ||
return (0, import_core.id)(); | ||
return id(); | ||
} | ||
export { | ||
makeStepId | ||
}; |
@@ -1,26 +0,6 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
import { useContext } from "react"; | ||
import { ActivityContext } from "./ActivityProvider"; | ||
const useActivity = () => useContext(ActivityContext); | ||
export { | ||
useActivity | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useActivity_exports = {}; | ||
__export(useActivity_exports, { | ||
useActivity: () => useActivity | ||
}); | ||
module.exports = __toCommonJS(useActivity_exports); | ||
var import_react = require("react"); | ||
var import_ActivityProvider = require("./ActivityProvider"); | ||
const useActivity = () => (0, import_react.useContext)(import_ActivityProvider.ActivityContext); |
@@ -1,28 +0,8 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useActivityParams_exports = {}; | ||
__export(useActivityParams_exports, { | ||
useActivityParams: () => useActivityParams | ||
}); | ||
module.exports = __toCommonJS(useActivityParams_exports); | ||
var import_react = require("react"); | ||
var import_ActivityProvider = require("./ActivityProvider"); | ||
import { useContext } from "react"; | ||
import { ActivityContext } from "./ActivityProvider"; | ||
function useActivityParams() { | ||
return (0, import_react.useContext)(import_ActivityProvider.ActivityContext).params; | ||
return useContext(ActivityContext).params; | ||
} | ||
export { | ||
useActivityParams | ||
}; |
@@ -1,33 +0,8 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var CoreProvider_exports = {}; | ||
__export(CoreProvider_exports, { | ||
CoreActionsContext: () => CoreActionsContext, | ||
CoreProvider: () => CoreProvider, | ||
CoreStateContext: () => CoreStateContext | ||
}); | ||
module.exports = __toCommonJS(CoreProvider_exports); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var import_react = require("react"); | ||
var import_shims = require("../shims"); | ||
const CoreActionsContext = (0, import_react.createContext)( | ||
import { jsx } from "react/jsx-runtime"; | ||
import { createContext } from "react"; | ||
import { useDeferredValue, useSyncExternalStore } from "../shims"; | ||
const CoreActionsContext = createContext( | ||
null | ||
); | ||
const CoreStateContext = (0, import_react.createContext)(null); | ||
const CoreStateContext = createContext(null); | ||
const CoreProvider = ({ | ||
@@ -37,3 +12,3 @@ coreStore, | ||
}) => { | ||
const stack = (0, import_shims.useSyncExternalStore)( | ||
const stack = useSyncExternalStore( | ||
coreStore.subscribe, | ||
@@ -43,5 +18,10 @@ coreStore.actions.getStack, | ||
); | ||
const deferredStack = (0, import_shims.useDeferredValue)(stack); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CoreStateContext.Provider, { value: deferredStack, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CoreActionsContext.Provider, { value: coreStore.actions, children }) }); | ||
const deferredStack = useDeferredValue(stack); | ||
return /* @__PURE__ */ jsx(CoreStateContext.Provider, { value: deferredStack, children: /* @__PURE__ */ jsx(CoreActionsContext.Provider, { value: coreStore.actions, children }) }); | ||
}; | ||
CoreProvider.displayName = "CoreProvider"; | ||
export { | ||
CoreActionsContext, | ||
CoreProvider, | ||
CoreStateContext | ||
}; |
@@ -1,20 +0,3 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var core_exports = {}; | ||
module.exports = __toCommonJS(core_exports); | ||
__reExport(core_exports, require("./CoreProvider"), module.exports); | ||
__reExport(core_exports, require("./useCoreActions"), module.exports); | ||
__reExport(core_exports, require("./useCoreState"), module.exports); | ||
export * from "./CoreProvider"; | ||
export * from "./useCoreActions"; | ||
export * from "./useCoreState"; |
@@ -1,26 +0,6 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
import { useContext } from "react"; | ||
import { CoreActionsContext } from "./CoreProvider"; | ||
const useCoreActions = () => useContext(CoreActionsContext); | ||
export { | ||
useCoreActions | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useCoreActions_exports = {}; | ||
__export(useCoreActions_exports, { | ||
useCoreActions: () => useCoreActions | ||
}); | ||
module.exports = __toCommonJS(useCoreActions_exports); | ||
var import_react = require("react"); | ||
var import_CoreProvider = require("./CoreProvider"); | ||
const useCoreActions = () => (0, import_react.useContext)(import_CoreProvider.CoreActionsContext); |
@@ -1,26 +0,6 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
import { useContext } from "react"; | ||
import { CoreStateContext } from "./CoreProvider"; | ||
const useCoreState = () => useContext(CoreStateContext); | ||
export { | ||
useCoreState | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useCoreState_exports = {}; | ||
__export(useCoreState_exports, { | ||
useCoreState: () => useCoreState | ||
}); | ||
module.exports = __toCommonJS(useCoreState_exports); | ||
var import_react = require("react"); | ||
var import_CoreProvider = require("./CoreProvider"); | ||
const useCoreState = () => (0, import_react.useContext)(import_CoreProvider.CoreStateContext); |
@@ -1,10 +0,5 @@ | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __defProps = Object.defineProperties; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
@@ -25,33 +20,7 @@ var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var MainRenderer_exports = {}; | ||
__export(MainRenderer_exports, { | ||
default: () => MainRenderer_default | ||
}); | ||
module.exports = __toCommonJS(MainRenderer_exports); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var import_react = require("react"); | ||
var import_PluginRenderer = __toESM(require("./PluginRenderer")); | ||
var import_core = require("./core"); | ||
var import_plugins = require("./plugins"); | ||
import { Fragment, jsx } from "react/jsx-runtime"; | ||
import { useEffect } from "react"; | ||
import PluginRenderer from "./PluginRenderer"; | ||
import { useCoreState } from "./core"; | ||
import { usePlugins } from "./plugins"; | ||
const MainRenderer = ({ | ||
@@ -61,8 +30,8 @@ activityComponentMap, | ||
}) => { | ||
const coreState = (0, import_core.useCoreState)(); | ||
const plugins = (0, import_plugins.usePlugins)(); | ||
const coreState = useCoreState(); | ||
const plugins = usePlugins(); | ||
const renderingPlugins = plugins.filter( | ||
(plugin) => !!plugin.render | ||
); | ||
(0, import_react.useEffect)(() => { | ||
useEffect(() => { | ||
if (renderingPlugins.length === 0) { | ||
@@ -74,4 +43,4 @@ console.warn( | ||
}, [renderingPlugins]); | ||
let output = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: renderingPlugins.map((plugin) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
import_PluginRenderer.default, | ||
let output = /* @__PURE__ */ jsx(Fragment, { children: renderingPlugins.map((plugin) => /* @__PURE__ */ jsx( | ||
PluginRenderer, | ||
{ | ||
@@ -99,1 +68,4 @@ activityComponentMap, | ||
var MainRenderer_default = MainRenderer; | ||
export { | ||
MainRenderer_default as default | ||
}; |
@@ -1,7 +0,4 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __defProps = Object.defineProperties; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
@@ -23,25 +20,7 @@ var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var PluginRenderer_exports = {}; | ||
__export(PluginRenderer_exports, { | ||
default: () => PluginRenderer_default | ||
}); | ||
module.exports = __toCommonJS(PluginRenderer_exports); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var import_activity = require("./activity"); | ||
var import_core = require("./core"); | ||
var import_plugins = require("./plugins"); | ||
var import_stack = require("./stack"); | ||
import { jsx } from "react/jsx-runtime"; | ||
import { ActivityProvider } from "./activity"; | ||
import { useCoreState } from "./core"; | ||
import { usePlugins } from "./plugins"; | ||
import { StackProvider } from "./stack"; | ||
const PluginRenderer = ({ | ||
@@ -52,4 +31,4 @@ activityComponentMap, | ||
}) => { | ||
const coreState = (0, import_core.useCoreState)(); | ||
const plugins = (0, import_plugins.usePlugins)(); | ||
const coreState = useCoreState(); | ||
const plugins = usePlugins(); | ||
return plugin.render({ | ||
@@ -64,3 +43,3 @@ stack: __spreadProps(__spreadValues({}, coreState), { | ||
const Activity = activityComponentMap[activity.name]; | ||
let output = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Activity, { params: activity.params }); | ||
let output = /* @__PURE__ */ jsx(Activity, { params: activity.params }); | ||
plugins.forEach((p) => { | ||
@@ -75,4 +54,4 @@ var _a, _b; | ||
}); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack.StackProvider, { value: stack, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
import_activity.ActivityProvider, | ||
return /* @__PURE__ */ jsx(StackProvider, { value: stack, children: /* @__PURE__ */ jsx( | ||
ActivityProvider, | ||
{ | ||
@@ -94,1 +73,4 @@ value: __spreadValues(__spreadValues({}, activity), overrideActivity), | ||
var PluginRenderer_default = PluginRenderer; | ||
export { | ||
PluginRenderer_default as default | ||
}; |
@@ -1,19 +0,2 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var plugins_exports = {}; | ||
module.exports = __toCommonJS(plugins_exports); | ||
__reExport(plugins_exports, require("./PluginsProvider"), module.exports); | ||
__reExport(plugins_exports, require("./usePlugins"), module.exports); | ||
export * from "./PluginsProvider"; | ||
export * from "./usePlugins"; |
@@ -1,32 +0,12 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var PluginsProvider_exports = {}; | ||
__export(PluginsProvider_exports, { | ||
PluginsContext: () => PluginsContext, | ||
PluginsProvider: () => PluginsProvider | ||
}); | ||
module.exports = __toCommonJS(PluginsProvider_exports); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var import_react = require("react"); | ||
const PluginsContext = (0, import_react.createContext)(null); | ||
import { jsx } from "react/jsx-runtime"; | ||
import { createContext } from "react"; | ||
const PluginsContext = createContext(null); | ||
const PluginsProvider = ({ | ||
children, | ||
value | ||
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PluginsContext.Provider, { value, children }); | ||
}) => /* @__PURE__ */ jsx(PluginsContext.Provider, { value, children }); | ||
PluginsProvider.displayName = "PluginsProvider"; | ||
export { | ||
PluginsContext, | ||
PluginsProvider | ||
}; |
@@ -1,28 +0,8 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var usePlugins_exports = {}; | ||
__export(usePlugins_exports, { | ||
usePlugins: () => usePlugins | ||
}); | ||
module.exports = __toCommonJS(usePlugins_exports); | ||
var import_react = require("react"); | ||
var import_PluginsProvider = require("./PluginsProvider"); | ||
import { useContext } from "react"; | ||
import { PluginsContext } from "./PluginsProvider"; | ||
function usePlugins() { | ||
return (0, import_react.useContext)(import_PluginsProvider.PluginsContext); | ||
return useContext(PluginsContext); | ||
} | ||
export { | ||
usePlugins | ||
}; |
@@ -1,20 +0,3 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var shims_exports = {}; | ||
module.exports = __toCommonJS(shims_exports); | ||
__reExport(shims_exports, require("./useDeferredValue"), module.exports); | ||
__reExport(shims_exports, require("./useSyncExternalStore"), module.exports); | ||
__reExport(shims_exports, require("./useTransition"), module.exports); | ||
export * from "./useDeferredValue"; | ||
export * from "./useSyncExternalStore"; | ||
export * from "./useTransition"; |
@@ -1,36 +0,6 @@ | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
var _a; | ||
import React from "react"; | ||
const useDeferredValue = (_a = React.useDeferredValue) != null ? _a : (value) => value; | ||
export { | ||
useDeferredValue | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useDeferredValue_exports = {}; | ||
__export(useDeferredValue_exports, { | ||
useDeferredValue: () => useDeferredValue | ||
}); | ||
module.exports = __toCommonJS(useDeferredValue_exports); | ||
var import_react = __toESM(require("react")); | ||
var _a; | ||
const useDeferredValue = (_a = import_react.default.useDeferredValue) != null ? _a : (value) => value; |
@@ -1,39 +0,6 @@ | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useSyncExternalStore_exports = {}; | ||
__export(useSyncExternalStore_exports, { | ||
useSyncExternalStore: () => useSyncExternalStore | ||
}); | ||
module.exports = __toCommonJS(useSyncExternalStore_exports); | ||
var import_react = __toESM(require("react")); | ||
var _a; | ||
const useSyncExternalStore = (_a = import_react.default.useSyncExternalStore) != null ? _a : (subscribe, getSnapshot) => { | ||
const [state, setState] = (0, import_react.useState)(() => getSnapshot()); | ||
(0, import_react.useEffect)(() => { | ||
import React, { useEffect, useState } from "react"; | ||
const useSyncExternalStore = (_a = React.useSyncExternalStore) != null ? _a : (subscribe, getSnapshot) => { | ||
const [state, setState] = useState(() => getSnapshot()); | ||
useEffect(() => { | ||
const dispose = subscribe(() => { | ||
@@ -46,1 +13,4 @@ setState(() => getSnapshot()); | ||
}; | ||
export { | ||
useSyncExternalStore | ||
}; |
@@ -1,36 +0,6 @@ | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
var _a; | ||
import React from "react"; | ||
const useTransition = (_a = React.useTransition) != null ? _a : () => [false, (cb) => cb()]; | ||
export { | ||
useTransition | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useTransition_exports = {}; | ||
__export(useTransition_exports, { | ||
useTransition: () => useTransition | ||
}); | ||
module.exports = __toCommonJS(useTransition_exports); | ||
var import_react = __toESM(require("react")); | ||
var _a; | ||
const useTransition = (_a = import_react.default.useTransition) != null ? _a : () => [false, (cb) => cb()]; |
@@ -1,19 +0,2 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var stack_exports = {}; | ||
module.exports = __toCommonJS(stack_exports); | ||
__reExport(stack_exports, require("./StackProvider"), module.exports); | ||
__reExport(stack_exports, require("./useStack"), module.exports); | ||
export * from "./StackProvider"; | ||
export * from "./useStack"; |
@@ -1,33 +0,13 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var StackProvider_exports = {}; | ||
__export(StackProvider_exports, { | ||
StackContext: () => StackContext, | ||
StackProvider: () => StackProvider | ||
}); | ||
module.exports = __toCommonJS(StackProvider_exports); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var import_react = require("react"); | ||
var import_utils = require("../utils"); | ||
const StackContext = (0, import_react.createContext)(null); | ||
import { jsx } from "react/jsx-runtime"; | ||
import { createContext } from "react"; | ||
import { useMemoDeep } from "../utils"; | ||
const StackContext = createContext(null); | ||
const StackProvider = ({ | ||
children, | ||
value | ||
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StackContext.Provider, { value: (0, import_utils.useMemoDeep)(value), children }); | ||
}) => /* @__PURE__ */ jsx(StackContext.Provider, { value: useMemoDeep(value), children }); | ||
StackProvider.displayName = "StackProvider"; | ||
export { | ||
StackContext, | ||
StackProvider | ||
}; |
@@ -1,26 +0,6 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
import { useContext } from "react"; | ||
import { StackContext } from "./StackProvider"; | ||
const useStack = () => useContext(StackContext); | ||
export { | ||
useStack | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useStack_exports = {}; | ||
__export(useStack_exports, { | ||
useStack: () => useStack | ||
}); | ||
module.exports = __toCommonJS(useStack_exports); | ||
var import_react = require("react"); | ||
var import_StackProvider = require("./StackProvider"); | ||
const useStack = () => (0, import_react.useContext)(import_StackProvider.StackContext); |
@@ -1,23 +0,6 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var utils_exports = {}; | ||
module.exports = __toCommonJS(utils_exports); | ||
__reExport(utils_exports, require("./isBrowser"), module.exports); | ||
__reExport(utils_exports, require("./isServer"), module.exports); | ||
__reExport(utils_exports, require("./makeRef"), module.exports); | ||
__reExport(utils_exports, require("./noop"), module.exports); | ||
__reExport(utils_exports, require("./useMemoDeep"), module.exports); | ||
__reExport(utils_exports, require("./WithRequired"), module.exports); | ||
export * from "./isBrowser"; | ||
export * from "./isServer"; | ||
export * from "./makeRef"; | ||
export * from "./noop"; | ||
export * from "./useMemoDeep"; | ||
export * from "./WithRequired"; |
@@ -1,27 +0,7 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var isBrowser_exports = {}; | ||
__export(isBrowser_exports, { | ||
isBrowser: () => isBrowser | ||
}); | ||
module.exports = __toCommonJS(isBrowser_exports); | ||
var import_isServer = require("./isServer"); | ||
import { isServer } from "./isServer"; | ||
function isBrowser() { | ||
return !(0, import_isServer.isServer)(); | ||
return !isServer(); | ||
} | ||
export { | ||
isBrowser | ||
}; |
@@ -1,26 +0,6 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var isServer_exports = {}; | ||
__export(isServer_exports, { | ||
isServer: () => isServer | ||
}); | ||
module.exports = __toCommonJS(isServer_exports); | ||
function isServer() { | ||
return typeof window === "undefined"; | ||
} | ||
export { | ||
isServer | ||
}; |
@@ -1,24 +0,1 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var makeRef_exports = {}; | ||
__export(makeRef_exports, { | ||
makeRef: () => makeRef | ||
}); | ||
module.exports = __toCommonJS(makeRef_exports); | ||
function makeRef() { | ||
@@ -36,1 +13,4 @@ const ref = { | ||
} | ||
export { | ||
makeRef | ||
}; |
@@ -1,25 +0,5 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
const noop = () => { | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
export { | ||
noop | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var noop_exports = {}; | ||
__export(noop_exports, { | ||
noop: () => noop | ||
}); | ||
module.exports = __toCommonJS(noop_exports); | ||
const noop = () => { | ||
}; |
@@ -1,41 +0,8 @@ | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useMemoDeep_exports = {}; | ||
__export(useMemoDeep_exports, { | ||
useMemoDeep: () => useMemoDeep | ||
}); | ||
module.exports = __toCommonJS(useMemoDeep_exports); | ||
var import_react = require("react"); | ||
var import_react_fast_compare = __toESM(require("react-fast-compare")); | ||
import { useEffect, useRef } from "react"; | ||
import compare from "react-fast-compare"; | ||
function useMemoDeep(next) { | ||
const previousRef = (0, import_react.useRef)(next); | ||
const previousRef = useRef(next); | ||
const previous = previousRef.current; | ||
const isEqual = (0, import_react_fast_compare.default)(previous, next); | ||
(0, import_react.useEffect)(() => { | ||
const isEqual = compare(previous, next); | ||
useEffect(() => { | ||
if (!isEqual) { | ||
@@ -47,1 +14,4 @@ previousRef.current = next; | ||
} | ||
export { | ||
useMemoDeep | ||
}; |
@@ -1,28 +0,11 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var future_exports = {}; | ||
module.exports = __toCommonJS(future_exports); | ||
__reExport(future_exports, require("../__internal__/activity/useActivity"), module.exports); | ||
__reExport(future_exports, require("../__internal__/stack/useStack"), module.exports); | ||
__reExport(future_exports, require("../__internal__/StackflowReactPlugin"), module.exports); | ||
__reExport(future_exports, require("./ActivityComponentType"), module.exports); | ||
__reExport(future_exports, require("./stack"), module.exports); | ||
__reExport(future_exports, require("./makeActions"), module.exports); | ||
__reExport(future_exports, require("./makeStepActions"), module.exports); | ||
__reExport(future_exports, require("./loader/useLoaderData"), module.exports); | ||
__reExport(future_exports, require("./useActivityParams"), module.exports); | ||
__reExport(future_exports, require("./useFlow"), module.exports); | ||
__reExport(future_exports, require("./useStepFlow"), module.exports); | ||
export * from "../__internal__/activity/useActivity"; | ||
export * from "../__internal__/stack/useStack"; | ||
export * from "../__internal__/StackflowReactPlugin"; | ||
export * from "./ActivityComponentType"; | ||
export * from "./stack"; | ||
export * from "./makeActions"; | ||
export * from "./makeStepActions"; | ||
export * from "./loader/useLoaderData"; | ||
export * from "./useActivityParams"; | ||
export * from "./useFlow"; | ||
export * from "./useStepFlow"; |
@@ -1,19 +0,2 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var loader_exports = {}; | ||
module.exports = __toCommonJS(loader_exports); | ||
__reExport(loader_exports, require("./loaderPlugin"), module.exports); | ||
__reExport(loader_exports, require("./useLoaderData"), module.exports); | ||
export * from "./loaderPlugin"; | ||
export * from "./useLoaderData"; |
@@ -1,7 +0,4 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __defProps = Object.defineProperties; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
@@ -23,20 +20,2 @@ var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var loaderPlugin_exports = {}; | ||
__export(loaderPlugin_exports, { | ||
loaderPlugin: () => loaderPlugin | ||
}); | ||
module.exports = __toCommonJS(loaderPlugin_exports); | ||
function loaderPlugin(config) { | ||
@@ -116,1 +95,4 @@ return () => ({ | ||
} | ||
export { | ||
loaderPlugin | ||
}; |
@@ -1,28 +0,8 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useLoaderData_exports = {}; | ||
__export(useLoaderData_exports, { | ||
useLoaderData: () => useLoaderData | ||
}); | ||
module.exports = __toCommonJS(useLoaderData_exports); | ||
var import_stable = require("../../stable"); | ||
import { useActivity } from "../../stable"; | ||
function useLoaderData() { | ||
var _a; | ||
return (_a = (0, import_stable.useActivity)().context) == null ? void 0 : _a.loaderData; | ||
return (_a = useActivity().context) == null ? void 0 : _a.loaderData; | ||
} | ||
export { | ||
useLoaderData | ||
}; |
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
@@ -20,21 +17,3 @@ var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
}; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var makeActions_exports = {}; | ||
__export(makeActions_exports, { | ||
makeActions: () => makeActions | ||
}); | ||
module.exports = __toCommonJS(makeActions_exports); | ||
var import_activity = require("../__internal__/activity"); | ||
import { makeActivityId } from "../__internal__/activity"; | ||
function parseActionOptions(options) { | ||
@@ -54,3 +33,3 @@ if (!options) { | ||
var _a; | ||
const activityId = (0, import_activity.makeActivityId)(); | ||
const activityId = makeActivityId(); | ||
(_a = getCoreActions()) == null ? void 0 : _a.push({ | ||
@@ -68,5 +47,5 @@ activityId, | ||
var _a, _b; | ||
const activityId = (0, import_activity.makeActivityId)(); | ||
const activityId = makeActivityId(); | ||
(_b = getCoreActions()) == null ? void 0 : _b.replace({ | ||
activityId: (_a = options == null ? void 0 : options.activityId) != null ? _a : (0, import_activity.makeActivityId)(), | ||
activityId: (_a = options == null ? void 0 : options.activityId) != null ? _a : makeActivityId(), | ||
activityName, | ||
@@ -101,1 +80,4 @@ activityParams, | ||
} | ||
export { | ||
makeActions | ||
}; |
@@ -1,25 +0,2 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var makeStepActions_exports = {}; | ||
__export(makeStepActions_exports, { | ||
makeStepActions: () => makeStepActions | ||
}); | ||
module.exports = __toCommonJS(makeStepActions_exports); | ||
var import_activity = require("../__internal__/activity"); | ||
import { makeStepId } from "../__internal__/activity"; | ||
function makeStepActions(getCoreActions) { | ||
@@ -29,3 +6,3 @@ return { | ||
var _a; | ||
const stepId = (0, import_activity.makeStepId)(); | ||
const stepId = makeStepId(); | ||
(_a = getCoreActions()) == null ? void 0 : _a.stepPush({ | ||
@@ -38,3 +15,3 @@ stepId, | ||
var _a; | ||
const stepId = (0, import_activity.makeStepId)(); | ||
const stepId = makeStepId(); | ||
(_a = getCoreActions()) == null ? void 0 : _a.stepReplace({ | ||
@@ -51,1 +28,4 @@ stepId, | ||
} | ||
export { | ||
makeStepActions | ||
}; |
@@ -1,45 +0,15 @@ | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var stack_exports = {}; | ||
__export(stack_exports, { | ||
stack: () => stack | ||
}); | ||
module.exports = __toCommonJS(stack_exports); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var import_core = require("@stackflow/core"); | ||
var import_react = __toESM(require("react")); | ||
var import_MainRenderer = __toESM(require("../__internal__/MainRenderer")); | ||
var import_activity = require("../__internal__/activity"); | ||
var import_core2 = require("../__internal__/core"); | ||
var import_plugins = require("../__internal__/plugins"); | ||
var import_utils = require("../__internal__/utils"); | ||
var import_loader = require("./loader"); | ||
var import_makeActions = require("./makeActions"); | ||
var import_makeStepActions = require("./makeStepActions"); | ||
import { jsx } from "react/jsx-runtime"; | ||
import { | ||
makeCoreStore, | ||
makeEvent | ||
} from "@stackflow/core"; | ||
import React, { useMemo } from "react"; | ||
import MainRenderer from "../__internal__/MainRenderer"; | ||
import { makeActivityId } from "../__internal__/activity"; | ||
import { CoreProvider } from "../__internal__/core"; | ||
import { PluginsProvider } from "../__internal__/plugins"; | ||
import { isBrowser, makeRef } from "../__internal__/utils"; | ||
import { loaderPlugin } from "./loader"; | ||
import { makeActions } from "./makeActions"; | ||
import { makeStepActions } from "./makeStepActions"; | ||
function stack(input) { | ||
@@ -52,8 +22,8 @@ var _a; | ||
*/ | ||
(0, import_loader.loaderPlugin)(input.config) | ||
loaderPlugin(input.config) | ||
]; | ||
const enoughPastTime = () => (/* @__PURE__ */ new Date()).getTime() - input.config.transitionDuration * 2; | ||
const staticCoreStore = (0, import_core.makeCoreStore)({ | ||
const staticCoreStore = makeCoreStore({ | ||
initialEvents: [ | ||
(0, import_core.makeEvent)("Initialized", { | ||
makeEvent("Initialized", { | ||
transitionDuration: input.config.transitionDuration, | ||
@@ -63,3 +33,3 @@ eventDate: enoughPastTime() | ||
...input.config.activities.map( | ||
(activity) => (0, import_core.makeEvent)("ActivityRegistered", { | ||
(activity) => makeEvent("ActivityRegistered", { | ||
activityName: activity.name, | ||
@@ -72,12 +42,12 @@ eventDate: enoughPastTime() | ||
}); | ||
const [getCoreStore, setCoreStore] = (0, import_utils.makeRef)(); | ||
const Stack = import_react.default.memo((props) => { | ||
const coreStore = (0, import_react.useMemo)(() => { | ||
const [getCoreStore, setCoreStore] = makeRef(); | ||
const Stack = React.memo((props) => { | ||
const coreStore = useMemo(() => { | ||
const prevCoreStore = getCoreStore(); | ||
if ((0, import_utils.isBrowser)() && prevCoreStore) { | ||
if (isBrowser() && prevCoreStore) { | ||
return prevCoreStore; | ||
} | ||
const initialPushedEventsByOption = input.config.initialActivity ? [ | ||
(0, import_core.makeEvent)("Pushed", { | ||
activityId: (0, import_activity.makeActivityId)(), | ||
makeEvent("Pushed", { | ||
activityId: makeActivityId(), | ||
activityName: input.config.initialActivity(), | ||
@@ -89,3 +59,3 @@ activityParams: {}, | ||
] : []; | ||
const store = (0, import_core.makeCoreStore)({ | ||
const store = makeCoreStore({ | ||
initialEvents: [ | ||
@@ -112,3 +82,3 @@ ...staticCoreStore.pullEvents(), | ||
}); | ||
if ((0, import_utils.isBrowser)()) { | ||
if (isBrowser()) { | ||
store.init(); | ||
@@ -119,4 +89,4 @@ setCoreStore(store); | ||
}, []); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugins.PluginsProvider, { value: coreStore.pluginInstances, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.CoreProvider, { coreStore, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
import_MainRenderer.default, | ||
return /* @__PURE__ */ jsx(PluginsProvider, { value: coreStore.pluginInstances, children: /* @__PURE__ */ jsx(CoreProvider, { coreStore, children: /* @__PURE__ */ jsx( | ||
MainRenderer, | ||
{ | ||
@@ -133,7 +103,7 @@ activityComponentMap: input.components, | ||
Stack, | ||
actions: (0, import_makeActions.makeActions)(() => { | ||
actions: makeActions(() => { | ||
var _a2; | ||
return (_a2 = getCoreStore()) == null ? void 0 : _a2.actions; | ||
}), | ||
stepActions: (0, import_makeStepActions.makeStepActions)(() => { | ||
stepActions: makeStepActions(() => { | ||
var _a2; | ||
@@ -144,1 +114,4 @@ return (_a2 = getCoreStore()) == null ? void 0 : _a2.actions; | ||
} | ||
export { | ||
stack | ||
}; |
@@ -1,28 +0,8 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useActivityParams_exports = {}; | ||
__export(useActivityParams_exports, { | ||
useActivityParams: () => useActivityParams | ||
}); | ||
module.exports = __toCommonJS(useActivityParams_exports); | ||
var import_react = require("react"); | ||
var import_ActivityProvider = require("../__internal__/activity/ActivityProvider"); | ||
import { useContext } from "react"; | ||
import { ActivityContext } from "../__internal__/activity/ActivityProvider"; | ||
function useActivityParams() { | ||
return (0, import_react.useContext)(import_ActivityProvider.ActivityContext).params; | ||
return useContext(ActivityContext).params; | ||
} | ||
export { | ||
useActivityParams | ||
}; |
@@ -1,29 +0,9 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useFlow_exports = {}; | ||
__export(useFlow_exports, { | ||
useFlow: () => useFlow | ||
}); | ||
module.exports = __toCommonJS(useFlow_exports); | ||
var import_core = require("../__internal__/core"); | ||
var import_makeActions = require("./makeActions"); | ||
import { useCoreActions } from "../__internal__/core"; | ||
import { makeActions } from "./makeActions"; | ||
function useFlow() { | ||
const coreActions = (0, import_core.useCoreActions)(); | ||
return (0, import_makeActions.makeActions)(() => coreActions); | ||
const coreActions = useCoreActions(); | ||
return makeActions(() => coreActions); | ||
} | ||
export { | ||
useFlow | ||
}; |
@@ -1,29 +0,9 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useStepFlow_exports = {}; | ||
__export(useStepFlow_exports, { | ||
useStepFlow: () => useStepFlow | ||
}); | ||
module.exports = __toCommonJS(useStepFlow_exports); | ||
var import_core = require("../__internal__/core"); | ||
var import_makeStepActions = require("./makeStepActions"); | ||
import { useCoreActions } from "../__internal__/core"; | ||
import { makeStepActions } from "./makeStepActions"; | ||
function useStepFlow(activityName) { | ||
const coreActions = (0, import_core.useCoreActions)(); | ||
return (0, import_makeStepActions.makeStepActions)(() => coreActions); | ||
const coreActions = useCoreActions(); | ||
return makeStepActions(() => coreActions); | ||
} | ||
export { | ||
useStepFlow | ||
}; |
@@ -1,18 +0,1 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var src_exports = {}; | ||
module.exports = __toCommonJS(src_exports); | ||
__reExport(src_exports, require("./stable"), module.exports); | ||
export * from "./stable"; |
@@ -1,28 +0,11 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var stable_exports = {}; | ||
module.exports = __toCommonJS(stable_exports); | ||
__reExport(stable_exports, require("../__internal__/ActivityComponentType"), module.exports); | ||
__reExport(stable_exports, require("../__internal__/activity/useActivity"), module.exports); | ||
__reExport(stable_exports, require("../__internal__/activity/useActivityParams"), module.exports); | ||
__reExport(stable_exports, require("../__internal__/stack/useStack"), module.exports); | ||
__reExport(stable_exports, require("../__internal__/StackflowReactPlugin"), module.exports); | ||
__reExport(stable_exports, require("./stackflow"), module.exports); | ||
__reExport(stable_exports, require("./useActions"), module.exports); | ||
__reExport(stable_exports, require("./useActiveEffect"), module.exports); | ||
__reExport(stable_exports, require("./useEnterDoneEffect"), module.exports); | ||
__reExport(stable_exports, require("./useStep"), module.exports); | ||
__reExport(stable_exports, require("./useStepActions"), module.exports); | ||
export * from "../__internal__/ActivityComponentType"; | ||
export * from "../__internal__/activity/useActivity"; | ||
export * from "../__internal__/activity/useActivityParams"; | ||
export * from "../__internal__/stack/useStack"; | ||
export * from "../__internal__/StackflowReactPlugin"; | ||
export * from "./stackflow"; | ||
export * from "./useActions"; | ||
export * from "./useActiveEffect"; | ||
export * from "./useEnterDoneEffect"; | ||
export * from "./useStep"; | ||
export * from "./useStepActions"; |
@@ -1,10 +0,5 @@ | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __defProps = Object.defineProperties; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
@@ -25,38 +20,12 @@ var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var stackflow_exports = {}; | ||
__export(stackflow_exports, { | ||
stackflow: () => stackflow | ||
}); | ||
module.exports = __toCommonJS(stackflow_exports); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var import_core = require("@stackflow/core"); | ||
var import_react = require("react"); | ||
var import_MainRenderer = __toESM(require("../__internal__/MainRenderer")); | ||
var import_activity = require("../__internal__/activity"); | ||
var import_core2 = require("../__internal__/core"); | ||
var import_plugins = require("../__internal__/plugins"); | ||
var import_utils = require("../__internal__/utils"); | ||
var import_useActions = require("./useActions"); | ||
var import_useStepActions = require("./useStepActions"); | ||
import { jsx } from "react/jsx-runtime"; | ||
import { makeCoreStore, makeEvent } from "@stackflow/core"; | ||
import { memo, useMemo } from "react"; | ||
import MainRenderer from "../__internal__/MainRenderer"; | ||
import { makeActivityId, makeStepId } from "../__internal__/activity"; | ||
import { CoreProvider } from "../__internal__/core"; | ||
import { PluginsProvider } from "../__internal__/plugins"; | ||
import { isBrowser, makeRef } from "../__internal__/utils"; | ||
import { useActions } from "./useActions"; | ||
import { useStepActions } from "./useStepActions"; | ||
function parseActionOptions(options) { | ||
@@ -77,3 +46,3 @@ if (!options) { | ||
(acc, [key, Activity]) => __spreadProps(__spreadValues({}, acc), { | ||
[key]: "component" in Activity ? (0, import_react.memo)(Activity.component) : (0, import_react.memo)(Activity) | ||
[key]: "component" in Activity ? memo(Activity.component) : memo(Activity) | ||
}), | ||
@@ -83,5 +52,5 @@ {} | ||
const enoughPastTime = () => (/* @__PURE__ */ new Date()).getTime() - options.transitionDuration * 2; | ||
const staticCoreStore = (0, import_core.makeCoreStore)({ | ||
const staticCoreStore = makeCoreStore({ | ||
initialEvents: [ | ||
(0, import_core.makeEvent)("Initialized", { | ||
makeEvent("Initialized", { | ||
transitionDuration: options.transitionDuration, | ||
@@ -91,3 +60,3 @@ eventDate: enoughPastTime() | ||
...Object.entries(options.activities).map( | ||
([activityName, Activity]) => (0, import_core.makeEvent)("ActivityRegistered", __spreadValues({ | ||
([activityName, Activity]) => makeEvent("ActivityRegistered", __spreadValues({ | ||
activityName, | ||
@@ -102,12 +71,12 @@ eventDate: enoughPastTime() | ||
}); | ||
const [getCoreStore, setCoreStore] = (0, import_utils.makeRef)(); | ||
const Stack = (0, import_react.memo)((props) => { | ||
const coreStore = (0, import_react.useMemo)(() => { | ||
const [getCoreStore, setCoreStore] = makeRef(); | ||
const Stack = memo((props) => { | ||
const coreStore = useMemo(() => { | ||
const prevCoreStore = getCoreStore(); | ||
if ((0, import_utils.isBrowser)() && prevCoreStore) { | ||
if (isBrowser() && prevCoreStore) { | ||
return prevCoreStore; | ||
} | ||
const initialPushedEventsByOption = options.initialActivity ? [ | ||
(0, import_core.makeEvent)("Pushed", { | ||
activityId: (0, import_activity.makeActivityId)(), | ||
makeEvent("Pushed", { | ||
activityId: makeActivityId(), | ||
activityName: options.initialActivity(), | ||
@@ -119,3 +88,3 @@ activityParams: {}, | ||
] : []; | ||
const store = (0, import_core.makeCoreStore)({ | ||
const store = makeCoreStore({ | ||
initialEvents: [ | ||
@@ -140,3 +109,3 @@ ...staticCoreStore.pullEvents(), | ||
}); | ||
if ((0, import_utils.isBrowser)()) { | ||
if (isBrowser()) { | ||
store.init(); | ||
@@ -147,4 +116,4 @@ setCoreStore(store); | ||
}, []); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugins.PluginsProvider, { value: coreStore.pluginInstances, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.CoreProvider, { coreStore, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
import_MainRenderer.default, | ||
return /* @__PURE__ */ jsx(PluginsProvider, { value: coreStore.pluginInstances, children: /* @__PURE__ */ jsx(CoreProvider, { coreStore, children: /* @__PURE__ */ jsx( | ||
MainRenderer, | ||
{ | ||
@@ -160,4 +129,4 @@ activityComponentMap, | ||
Stack, | ||
useFlow: import_useActions.useActions, | ||
useStepFlow: import_useStepActions.useStepActions, | ||
useFlow: useActions, | ||
useStepFlow: useStepActions, | ||
addActivity(activity) { | ||
@@ -170,3 +139,3 @@ if (getCoreStore()) { | ||
} | ||
activityComponentMap[activity.name] = (0, import_react.memo)(activity.component); | ||
activityComponentMap[activity.name] = memo(activity.component); | ||
staticCoreStore.actions.dispatchEvent("ActivityRegistered", { | ||
@@ -200,3 +169,3 @@ activityName: activity.name, | ||
var _a2; | ||
const activityId = (0, import_activity.makeActivityId)(); | ||
const activityId = makeActivityId(); | ||
(_a2 = getCoreStore()) == null ? void 0 : _a2.actions.push({ | ||
@@ -214,5 +183,5 @@ activityId, | ||
var _a2, _b, _c; | ||
const activityId = (_a2 = options2 == null ? void 0 : options2.activityId) != null ? _a2 : (0, import_activity.makeActivityId)(); | ||
const activityId = (_a2 = options2 == null ? void 0 : options2.activityId) != null ? _a2 : makeActivityId(); | ||
(_c = getCoreStore()) == null ? void 0 : _c.actions.replace({ | ||
activityId: (_b = options2 == null ? void 0 : options2.activityId) != null ? _b : (0, import_activity.makeActivityId)(), | ||
activityId: (_b = options2 == null ? void 0 : options2.activityId) != null ? _b : makeActivityId(), | ||
activityName, | ||
@@ -247,3 +216,3 @@ activityParams, | ||
var _a2; | ||
const stepId = (0, import_activity.makeStepId)(); | ||
const stepId = makeStepId(); | ||
return (_a2 = getCoreStore()) == null ? void 0 : _a2.actions.stepPush({ | ||
@@ -256,3 +225,3 @@ stepId, | ||
var _a2; | ||
const stepId = (0, import_activity.makeStepId)(); | ||
const stepId = makeStepId(); | ||
return (_a2 = getCoreStore()) == null ? void 0 : _a2.actions.stepReplace({ | ||
@@ -270,1 +239,4 @@ stepId, | ||
} | ||
export { | ||
stackflow | ||
}; |
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
@@ -20,24 +17,6 @@ var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
}; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useActions_exports = {}; | ||
__export(useActions_exports, { | ||
useActions: () => useActions | ||
}); | ||
module.exports = __toCommonJS(useActions_exports); | ||
var import_react = require("react"); | ||
var import_activity = require("../__internal__/activity"); | ||
var import_core = require("../__internal__/core"); | ||
var import_shims = require("../__internal__/shims"); | ||
import { useMemo } from "react"; | ||
import { makeActivityId } from "../__internal__/activity"; | ||
import { useCoreActions } from "../__internal__/core"; | ||
import { useTransition } from "../__internal__/shims"; | ||
function parseActionOptions(options) { | ||
@@ -54,9 +33,9 @@ if (!options) { | ||
function useActions() { | ||
const coreActions = (0, import_core.useCoreActions)(); | ||
const [pending] = (0, import_shims.useTransition)(); | ||
return (0, import_react.useMemo)( | ||
const coreActions = useCoreActions(); | ||
const [pending] = useTransition(); | ||
return useMemo( | ||
() => ({ | ||
pending, | ||
push(activityName, activityParams, options) { | ||
const activityId = (0, import_activity.makeActivityId)(); | ||
const activityId = makeActivityId(); | ||
coreActions == null ? void 0 : coreActions.push({ | ||
@@ -74,5 +53,5 @@ activityId, | ||
var _a; | ||
const activityId = (0, import_activity.makeActivityId)(); | ||
const activityId = makeActivityId(); | ||
coreActions == null ? void 0 : coreActions.replace({ | ||
activityId: (_a = options == null ? void 0 : options.activityId) != null ? _a : (0, import_activity.makeActivityId)(), | ||
activityId: (_a = options == null ? void 0 : options.activityId) != null ? _a : makeActivityId(), | ||
activityName, | ||
@@ -108,1 +87,4 @@ activityParams, | ||
} | ||
export { | ||
useActions | ||
}; |
@@ -1,35 +0,15 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useActiveEffect_exports = {}; | ||
__export(useActiveEffect_exports, { | ||
useActiveEffect: () => useActiveEffect | ||
}); | ||
module.exports = __toCommonJS(useActiveEffect_exports); | ||
var import_react = require("react"); | ||
var import_useActivity = require("../__internal__/activity/useActivity"); | ||
var import_utils = require("../__internal__/utils"); | ||
import { useEffect } from "react"; | ||
import { useActivity } from "../__internal__/activity/useActivity"; | ||
import { noop } from "../__internal__/utils"; | ||
const useActiveEffect = (effect) => { | ||
const { isActive } = (0, import_useActivity.useActivity)(); | ||
(0, import_react.useEffect)(() => { | ||
const { isActive } = useActivity(); | ||
useEffect(() => { | ||
if (isActive) { | ||
return effect(); | ||
} | ||
return import_utils.noop; | ||
return noop; | ||
}, [isActive]); | ||
}; | ||
export { | ||
useActiveEffect | ||
}; |
@@ -1,35 +0,15 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useEnterDoneEffect_exports = {}; | ||
__export(useEnterDoneEffect_exports, { | ||
useEnterDoneEffect: () => useEnterDoneEffect | ||
}); | ||
module.exports = __toCommonJS(useEnterDoneEffect_exports); | ||
var import_react = require("react"); | ||
var import_useActivity = require("../__internal__/activity/useActivity"); | ||
var import_utils = require("../__internal__/utils"); | ||
import { useEffect } from "react"; | ||
import { useActivity } from "../__internal__/activity/useActivity"; | ||
import { noop } from "../__internal__/utils"; | ||
const useEnterDoneEffect = (effect, deps = []) => { | ||
const { isTop, transitionState } = (0, import_useActivity.useActivity)(); | ||
(0, import_react.useEffect)(() => { | ||
const { isTop, transitionState } = useActivity(); | ||
useEffect(() => { | ||
if (isTop && transitionState === "enter-done") { | ||
return effect(); | ||
} | ||
return import_utils.noop; | ||
return noop; | ||
}, [isTop, transitionState, ...deps]); | ||
}; | ||
export { | ||
useEnterDoneEffect | ||
}; |
@@ -1,30 +0,10 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useStep_exports = {}; | ||
__export(useStep_exports, { | ||
useStep: () => useStep | ||
}); | ||
module.exports = __toCommonJS(useStep_exports); | ||
var import_react = require("react"); | ||
var import_ActivityProvider = require("../__internal__/activity/ActivityProvider"); | ||
import { useContext } from "react"; | ||
import { ActivityContext } from "../__internal__/activity/ActivityProvider"; | ||
function useStep() { | ||
var _a; | ||
const { steps, id } = (0, import_react.useContext)(import_ActivityProvider.ActivityContext); | ||
const { steps, id } = useContext(ActivityContext); | ||
return (_a = steps.filter((step) => step.id !== id).at(-1)) != null ? _a : null; | ||
} | ||
export { | ||
useStep | ||
}; |
@@ -1,36 +0,13 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var useStepActions_exports = {}; | ||
__export(useStepActions_exports, { | ||
useStepActions: () => useStepActions | ||
}); | ||
module.exports = __toCommonJS(useStepActions_exports); | ||
var import_react = require("react"); | ||
var import_activity = require("../__internal__/activity"); | ||
var import_core = require("../__internal__/core"); | ||
var import_shims = require("../__internal__/shims"); | ||
import { useMemo } from "react"; | ||
import { makeStepId } from "../__internal__/activity"; | ||
import { useCoreActions } from "../__internal__/core"; | ||
import { useTransition } from "../__internal__/shims"; | ||
const useStepActions = () => { | ||
const coreActions = (0, import_core.useCoreActions)(); | ||
const [pending] = (0, import_shims.useTransition)(); | ||
return (0, import_react.useMemo)( | ||
const coreActions = useCoreActions(); | ||
const [pending] = useTransition(); | ||
return useMemo( | ||
() => ({ | ||
pending, | ||
stepPush(params) { | ||
const stepId = (0, import_activity.makeStepId)(); | ||
const stepId = makeStepId(); | ||
coreActions == null ? void 0 : coreActions.stepPush({ | ||
@@ -42,3 +19,3 @@ stepId, | ||
stepReplace(params) { | ||
const stepId = (0, import_activity.makeStepId)(); | ||
const stepId = makeStepId(); | ||
coreActions == null ? void 0 : coreActions.stepReplace({ | ||
@@ -61,1 +38,4 @@ stepId, | ||
}; | ||
export { | ||
useStepActions | ||
}; |
{ | ||
"name": "@stackflow/react", | ||
"version": "1.2.0-canary.1", | ||
"version": "1.2.0-canary.2", | ||
"repository": { | ||
@@ -13,18 +13,15 @@ "type": "git", | ||
"types": "./dist/index.d.ts", | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs" | ||
"import": "./dist/index.js" | ||
}, | ||
"./stable": { | ||
"types": "./dist/stable/index.d.ts", | ||
"require": "./dist/stable/index.js", | ||
"import": "./dist/stable/index.mjs" | ||
"import": "./dist/stable/index.js" | ||
}, | ||
"./future": { | ||
"types": "./dist/future/index.d.ts", | ||
"require": "./dist/future/index.js", | ||
"import": "./dist/future/index.mjs" | ||
"import": "./dist/future/index.js" | ||
} | ||
}, | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
@@ -31,0 +28,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
116944
210
2866