Socket
Socket
Sign inDemoInstall

@stackflow/react

Package Overview
Dependencies
Maintainers
3
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stackflow/react - npm Package Compare versions

Comparing version 1.1.9 to 1.1.10

3

dist/activity/ActivityComponentType.d.ts

@@ -1,3 +0,2 @@

/// <reference types="react" />
export declare type ActivityComponentType<T extends {
export type ActivityComponentType<T extends {
[K in keyof T]: any;

@@ -4,0 +3,0 @@ } = {}> = React.ComponentType<{

import type { Activity } from "@stackflow/core";
import React from "react";
import type React from "react";
export declare const ActivityContext: React.Context<Activity>;

@@ -4,0 +4,0 @@ interface ActivityProviderProps {

import type { ActivityRegisteredEvent } from "@stackflow/core";
import type { ActivityComponentType } from "./activity";
export declare type BaseActivities = {
export type BaseActivities = {
[activityName: string]: ActivityComponentType<any> | {

@@ -5,0 +5,0 @@ component: ActivityComponentType<any>;

@@ -1,2 +0,1 @@

/// <reference types="react" />
import type { CoreStore, Stack } from "@stackflow/core";

@@ -3,0 +2,0 @@ export declare const CoreActionsContext: import("react").Context<import("@stackflow/core").StackflowActions>;

@@ -149,2 +149,5 @@ "use strict";

// src/MainRenderer.tsx
var import_react15 = require("react");
// src/activity/makeActivityId.ts

@@ -217,5 +220,2 @@ var import_core = require("@stackflow/core");

// src/MainRenderer.tsx
var import_react15 = require("react");
// src/plugins/PluginsProvider.tsx

@@ -442,3 +442,3 @@ var import_react13 = require("react");

var _a4;
const plugins = ((_a4 = options.plugins) != null ? _a4 : []).flat(Infinity).map((p) => p);
const plugins = ((_a4 = options.plugins) != null ? _a4 : []).flat(Number.POSITIVE_INFINITY).map((p) => p);
const activityComponentMap = Object.entries(options.activities).reduce(

@@ -450,3 +450,3 @@ (acc, [key, Activity]) => __spreadProps(__spreadValues({}, acc), {

);
const enoughPastTime = () => new Date().getTime() - options.transitionDuration * 2;
const enoughPastTime = () => (/* @__PURE__ */ new Date()).getTime() - options.transitionDuration * 2;
const staticCoreStore = (0, import_core7.makeCoreStore)({

@@ -500,3 +500,3 @@ initialEvents: [

console.warn(
`Stackflow - There is no initial activity. If you want to set the initial activity, add the \`initialActivity\` option of the \`stackflow()\` function or add a plugin that sets the initial activity. (e.g. \`@stackflow/plugin-history-sync\`)`
"Stackflow - There is no initial activity. If you want to set the initial activity, add the `initialActivity` option of the `stackflow()` function or add a plugin that sets the initial activity. (e.g. `@stackflow/plugin-history-sync`)"
);

@@ -529,3 +529,3 @@ }

console.warn(
`Stackflow - \`addActivity()\` API cannot be called after a \`<Stack />\` component has been rendered`
"Stackflow - `addActivity()` API cannot be called after a `<Stack />` component has been rendered"
);

@@ -544,7 +544,7 @@ return;

console.warn(
`Stackflow - \`addPlugin()\` API cannot be called after a \`<Stack />\` component has been rendered`
"Stackflow - `addPlugin()` API cannot be called after a `<Stack />` component has been rendered"
);
return;
}
[plugin].flat(Infinity).map((p) => p).forEach((p) => {
[plugin].flat(Number.POSITIVE_INFINITY).map((p) => p).forEach((p) => {
plugins.push(p);

@@ -551,0 +551,0 @@ });

@@ -1,2 +0,1 @@

/// <reference types="react" />
import type { ActivityComponentType } from "./activity";

@@ -3,0 +2,0 @@ interface MainRendererProps {

@@ -1,4 +0,3 @@

/// <reference types="react" />
import type { StackflowReactPlugin } from "./StackflowReactPlugin";
import type { ActivityComponentType } from "./activity";
import type { StackflowReactPlugin } from "./StackflowReactPlugin";
import type { WithRequired } from "./utils";

@@ -5,0 +4,0 @@ interface PluginRendererProps {

@@ -1,4 +0,4 @@

import React from "react";
import type React from "react";
import type { StackflowReactPlugin } from "../StackflowReactPlugin";
export declare type PluginsContextValue = Array<ReturnType<StackflowReactPlugin>>;
export type PluginsContextValue = Array<ReturnType<StackflowReactPlugin>>;
export declare const PluginsContext: React.Context<PluginsContextValue>;

@@ -5,0 +5,0 @@ interface PluginsProviderProps {

@@ -1,2 +0,1 @@

/// <reference types="react" />
import type { Stack } from "@stackflow/core";

@@ -3,0 +2,0 @@ export declare const StackContext: import("react").Context<Stack>;

@@ -1,14 +0,13 @@

/// <reference types="react" />
import type { ActivityRegisteredEvent, StackflowActions } from "@stackflow/core";
import type { ActivityComponentType } from "./activity";
import type { BaseActivities } from "./BaseActivities";
import type { StackflowReactPlugin } from "./StackflowReactPlugin";
import type { ActivityComponentType } from "./activity";
import type { UseActionsOutputType } from "./useActions";
import type { UseStepActions, UseStepActionsOutputType } from "./useStepActions";
export declare type StackComponentType = React.FC<{
export type StackComponentType = React.FC<{
initialContext?: any;
}>;
declare type StackflowPluginsEntry<T extends BaseActivities> = StackflowReactPlugin<T> | StackflowPluginsEntry<T>[];
declare type NoInfer<T> = [T][T extends any ? 0 : never];
export declare type StackflowOptions<T extends BaseActivities> = {
type StackflowPluginsEntry<T extends BaseActivities> = StackflowReactPlugin<T> | StackflowPluginsEntry<T>[];
type NoInfer<T> = [T][T extends any ? 0 : never];
export type StackflowOptions<T extends BaseActivities> = {
/**

@@ -32,3 +31,3 @@ * Register activities used in your app

};
export declare type StackflowOutput<T extends BaseActivities> = {
export type StackflowOutput<T extends BaseActivities> = {
/**

@@ -35,0 +34,0 @@ * Return activities

@@ -1,4 +0,3 @@

/// <reference types="react" />
import type { Activity, Stack, StackflowPlugin } from "@stackflow/core";
export declare type StackflowReactPlugin<T = never> = () => {
export type StackflowReactPlugin<T = never> = () => {
/**

@@ -5,0 +4,0 @@ * Determine how to render by using the stack state

@@ -0,4 +1,4 @@

import type { BaseActivities } from "./BaseActivities";
import type { ActivityComponentType } from "./activity";
import type { BaseActivities } from "./BaseActivities";
export declare type UseActionsOutputType<T extends BaseActivities> = {
export type UseActionsOutputType<T extends BaseActivities> = {
/**

@@ -5,0 +5,0 @@ * Is transition pending

@@ -1,2 +0,1 @@

/// <reference types="react" />
export declare const useEnterDoneEffect: (effect: React.EffectCallback, deps?: import("react").DependencyList) => void;
export declare const useEnterDoneEffect: (effect: React.EffectCallback, deps?: React.DependencyList) => void;

@@ -0,4 +1,4 @@

import type { BaseActivities } from "./BaseActivities";
import type { ActivityComponentType } from "./activity";
import type { BaseActivities } from "./BaseActivities";
export declare type UseStepActionsOutputType<P> = {
export type UseStepActionsOutputType<P> = {
pending: boolean;

@@ -9,5 +9,5 @@ stepPush: (params: P, options?: {}) => void;

};
export declare type UseStepActions<T extends BaseActivities = {}> = <K extends Extract<keyof T, string>>(activityName: K) => UseStepActionsOutputType<T[K] extends ActivityComponentType<infer U> | {
export type UseStepActions<T extends BaseActivities = {}> = <K extends Extract<keyof T, string>>(activityName: K) => UseStepActionsOutputType<T[K] extends ActivityComponentType<infer U> | {
component: ActivityComponentType<infer U>;
} ? U : {}>;
export declare const useStepActions: UseStepActions;

@@ -1,3 +0,3 @@

export declare type WithRequired<T, K extends keyof T> = T & {
export type WithRequired<T, K extends keyof T> = T & {
[P in K]-?: T[P];
};
{
"name": "@stackflow/react",
"version": "1.1.9",
"version": "1.1.10",
"repository": {

@@ -34,24 +34,12 @@ "type": "git",

"dependencies": {
"react-fast-compare": "^3.2.0"
"react-fast-compare": "^3.2.2"
},
"devDependencies": {
"@stackflow/core": "^1.0.10",
"@stackflow/esbuild-config": "^1.0.1",
"@stackflow/eslint-config": "^1.0.2",
"@types/react": "^18.0.9",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.20.0",
"esbuild": "^0.14.51",
"eslint": "^8.13.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-json-format": "^2.0.1",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.4.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"react": "^18.1.0",
"@stackflow/core": "^1.0.12",
"@stackflow/esbuild-config": "^1.0.2",
"@types/react": "^18.3.3",
"esbuild": "^0.23.0",
"react": "^18.3.1",
"rimraf": "^3.0.2",
"typescript": "^4.7.4"
"typescript": "^5.5.3"
},

@@ -58,0 +46,0 @@ "peerDependencies": {

import { useMemo } from "react";
import type { BaseActivities } from "./BaseActivities";
import type { ActivityComponentType } from "./activity";
import { makeActivityId } from "./activity";
import type { BaseActivities } from "./BaseActivities";
import { useCoreActions } from "./core";

@@ -15,3 +15,3 @@ import { useTransition } from "./shims";

const isNullableAnimateOption = options.animate == null;
if (isNullableAnimateOption) {

@@ -18,0 +18,0 @@ return { skipActiveState: false };

import { useMemo } from "react";
import type { BaseActivities } from "./BaseActivities";
import type { ActivityComponentType } from "./activity";
import { makeStepId } from "./activity";
import type { BaseActivities } from "./BaseActivities";
import { useCoreActions } from "./core";

@@ -7,0 +7,0 @@ import { useTransition } from "./shims";

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc