piral-redux 1.6.0-beta.7216 → 1.6.0-beta.7243

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/create.js CHANGED
@@ -1,21 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createReduxApi = void 0;
4
- const react_1 = require("react");
5
- const react_redux_1 = require("react-redux");
6
- const redux_1 = require("redux");
1
+ import { createElement } from 'react';
2
+ import { Provider, connect } from 'react-redux';
3
+ import { createStore } from 'redux';
7
4
  function defaultReducer(state) {
8
5
  return state;
9
6
  }
10
7
  /**
11
8
  * Creates new Pilet API extensions for creating a Redux state container.
12
9
  */
13
- function createReduxApi(config = {}) {
10
+ export function createReduxApi(config = {}) {
14
11
  const { reducer = defaultReducer, enhancer } = config;
15
12
  const otherReducers = {};
16
13
  const initialState = { stores: {} };
17
- const store = (0, redux_1.createStore)(createReducer(), enhancer);
18
- const provider = (0, react_1.createElement)(react_redux_1.Provider, { store });
14
+ const store = createStore(createReducer(), enhancer);
15
+ const provider = createElement(Provider, { store });
19
16
  function createReducer() {
20
17
  return (state = initialState, action) => {
21
18
  switch (action.type) {
@@ -75,12 +72,11 @@ function createReduxApi(config = {}) {
75
72
  name,
76
73
  action,
77
74
  });
78
- return (component) => (0, react_redux_1.connect)((state) => ({ state: state.stores[name] }), {
75
+ return (component) => connect((state) => ({ state: state.stores[name] }), {
79
76
  dispatch,
80
77
  })(component);
81
78
  },
82
79
  });
83
80
  };
84
81
  }
85
- exports.createReduxApi = createReduxApi;
86
82
  //# sourceMappingURL=create.js.map
package/lib/create.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":";;;AAAA,iCAAsC;AAEtC,6CAAgD;AAChD,iCAA4D;AAyB5D,SAAS,cAAc,CAAI,KAAQ;IACjC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,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CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;oBACzG,QAAQ;iBACT,CAAC,CAAC,SAAS,CAAQ,CAAC;YACzB,CAAC;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
package/lib/index.js CHANGED
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./create"), exports);
5
- tslib_1.__exportStar(require("./types"), exports);
1
+ export * from './create';
2
+ export * from './types';
6
3
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,kDAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
package/lib/types.js CHANGED
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piral-redux",
3
- "version": "1.6.0-beta.7216",
3
+ "version": "1.6.0-beta.7243",
4
4
  "description": "Plugin for the integration of Redux in a Piral instance.",
5
5
  "keywords": [
6
6
  "piral",
@@ -18,29 +18,16 @@
18
18
  "author": "smapiot",
19
19
  "homepage": "https://piral.io",
20
20
  "license": "MIT",
21
- "module": "esm/index.js",
21
+ "module": "lib/index.js",
22
22
  "main": "lib/index.js",
23
23
  "typings": "lib/index.d.ts",
24
24
  "exports": {
25
- ".": {
26
- "import": "./esm/index.js",
27
- "require": "./lib/index.js"
28
- },
29
- "./esm/*": {
30
- "import": "./esm/*"
31
- },
32
- "./lib/*": {
33
- "require": "./lib/*"
34
- },
35
- "./_/*": {
36
- "import": "./esm/*.js",
37
- "require": "./lib/*.js"
38
- },
25
+ ".": "./lib/index.js",
26
+ "./lib/*": "./lib/*",
39
27
  "./package.json": "./package.json"
40
28
  },
41
29
  "sideEffects": false,
42
30
  "files": [
43
- "esm",
44
31
  "lib",
45
32
  "src",
46
33
  "piral-redux.min.js"
@@ -54,10 +41,9 @@
54
41
  },
55
42
  "scripts": {
56
43
  "cleanup": "rimraf esm lib piral-redux.min.js",
57
- "build": "yarn build:bundle && yarn build:commonjs && yarn build:esnext",
44
+ "build": "yarn build:bundle && yarn build:esnext",
58
45
  "build:bundle": "esbuild src/index.ts --outfile=piral-redux.min.js --bundle --external:piral-core --external:react --minify --global-name=piralRedux",
59
- "build:commonjs": "tsc --project tsconfig.json --outDir lib --module commonjs",
60
- "build:esnext": "tsc --project tsconfig.json --outDir esm --module esnext",
46
+ "build:esnext": "tsc --project tsconfig.json --outDir lib --module esnext",
61
47
  "typedoc": "typedoc --json ../../../docs/types/piral-redux.json src --exclude \"src/**/*.test.*\"",
62
48
  "test": "echo \"Error: run tests from root\" && exit 1"
63
49
  },
@@ -69,8 +55,8 @@
69
55
  "@types/react": "^18.0.0",
70
56
  "@types/react-redux": "^5.0.19",
71
57
  "@types/redux": "^3.6.0",
72
- "piral-core": "1.6.0-beta.7216",
58
+ "piral-core": "1.6.0-beta.7243",
73
59
  "react": "^18.0.0"
74
60
  },
75
- "gitHead": "bd3742af68fc25af93ed9b37021d2d69a6f40f18"
61
+ "gitHead": "bbb6e4f78c61b6ef753099a5b378ad2708565ce3"
76
62
  }
package/esm/create.d.ts DELETED
@@ -1,20 +0,0 @@
1
- import { PiralPlugin } from 'piral-core';
2
- import { StoreEnhancer, Reducer } from 'redux';
3
- import { PiletReduxApi, PiralReduxCustomState, PiralReduxCustomActions, ReducerUnion } from './types';
4
- /**
5
- * Available configuration options for the Redux plugin.
6
- */
7
- export interface ReduxConfig {
8
- /**
9
- * The custom reducers, if any.
10
- */
11
- reducer?: Reducer<PiralReduxCustomState, ReducerUnion<PiralReduxCustomActions>>;
12
- /**
13
- * The custom enhancers, if any.
14
- */
15
- enhancer?: StoreEnhancer;
16
- }
17
- /**
18
- * Creates new Pilet API extensions for creating a Redux state container.
19
- */
20
- export declare function createReduxApi(config?: ReduxConfig): PiralPlugin<PiletReduxApi>;
package/esm/create.js DELETED
@@ -1,82 +0,0 @@
1
- import { createElement } from 'react';
2
- import { Provider, connect } from 'react-redux';
3
- import { createStore } from 'redux';
4
- function defaultReducer(state) {
5
- return state;
6
- }
7
- /**
8
- * Creates new Pilet API extensions for creating a Redux state container.
9
- */
10
- export function createReduxApi(config = {}) {
11
- const { reducer = defaultReducer, enhancer } = config;
12
- const otherReducers = {};
13
- const initialState = { stores: {} };
14
- const store = createStore(createReducer(), enhancer);
15
- const provider = createElement(Provider, { store });
16
- function createReducer() {
17
- return (state = initialState, action) => {
18
- switch (action.type) {
19
- case 'create-store': {
20
- const stores = state.stores;
21
- return {
22
- ...state,
23
- stores: {
24
- ...stores,
25
- [action.name]: action.value,
26
- },
27
- };
28
- }
29
- case 'destroy-store': {
30
- const { [action.name]: _, ...stores } = state.stores;
31
- return {
32
- ...state,
33
- stores: {
34
- ...stores,
35
- },
36
- };
37
- }
38
- case 'change-store': {
39
- const reducer = otherReducers[action.name];
40
- const oldState = state.stores[action.name];
41
- const newState = reducer(oldState, action.action);
42
- if (oldState !== newState) {
43
- return {
44
- ...state,
45
- stores: {
46
- ...state.stores,
47
- [action.name]: newState,
48
- },
49
- };
50
- }
51
- return state;
52
- }
53
- default: {
54
- return reducer(state, action);
55
- }
56
- }
57
- };
58
- }
59
- return (context) => {
60
- context.includeProvider(provider);
61
- return (_, meta) => ({
62
- createReduxStore(reducer) {
63
- const name = meta.name;
64
- otherReducers[name] = reducer;
65
- store.dispatch({
66
- type: 'create-store',
67
- name,
68
- value: reducer(undefined, { type: '$init' }),
69
- });
70
- const dispatch = (action) => ({
71
- type: 'change-store',
72
- name,
73
- action,
74
- });
75
- return (component) => connect((state) => ({ state: state.stores[name] }), {
76
- dispatch,
77
- })(component);
78
- },
79
- });
80
- };
81
- }
82
- //# sourceMappingURL=create.js.map
package/esm/create.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,WAAW,EAA0B,MAAM,OAAO,CAAC;AAyB5D,SAAS,cAAc,CAAI,KAAQ;IACjC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,SAAsB,EAAE;IACrD,MAAM,EAAE,OAAO,GAAG,cAAc,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IACtD,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,MAAM,YAAY,GAAoB,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACrD,MAAM,KAAK,GAAG,WAAW,CAAC,aAAa,EAAkB,EAAE,QAAQ,CAAC,CAAC;IACrE,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAEpD,SAAS,aAAa;QACpB,OAAO,CAAC,QAAyB,YAAY,EAAE,MAAuC,EAAmB,EAAE;YACzG,QAAQ,MAAM,CAAC,IAAI,EAAE;gBACnB,KAAK,cAAc,CAAC,CAAC;oBACnB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;oBAC5B,OAAO;wBACL,GAAG,KAAK;wBACR,MAAM,EAAE;4BACN,GAAG,MAAM;4BACT,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK;yBAC5B;qBACF,CAAC;iBACH;gBACD,KAAK,eAAe,CAAC,CAAC;oBACpB,MAA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AAC,CAAC;gBACH,MAAM,QAAQ,GAAG,CAAC,MAAW,EAAE,EAAE,CAAC,CAAC;oBACjC,IAAI,EAAE,cAAc;oBACpB,IAAI;oBACJ,MAAM;iBACP,CAAC,CAAC;gBACH,OAAO,CAAC,SAAS,EAAE,EAAE,CACnB,OAAO,CAAwD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;oBACzG,QAAQ;iBACT,CAAC,CAAC,SAAS,CAAQ,CAAC;YACzB,CAAC;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
package/esm/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './create';
2
- export * from './types';
package/esm/index.js DELETED
@@ -1,3 +0,0 @@
1
- export * from './create';
2
- export * from './types';
3
- //# sourceMappingURL=index.js.map
package/esm/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
package/esm/types.d.ts DELETED
@@ -1,45 +0,0 @@
1
- import type { ComponentType, FC } from 'react';
2
- import type { Store, Action, Reducer, Dispatch, AnyAction } from 'redux';
3
- declare module 'piral-core/lib/types/custom' {
4
- interface PiletCustomApi extends PiletReduxApi {
5
- }
6
- }
7
- export interface ReduxStoreConnector {
8
- <TProps extends ReduxConnectorComponentProps>(component: ComponentType<TProps>): FC<Omit<TProps, keyof ReduxConnectorComponentProps>>;
9
- }
10
- export interface ReduxConnectorComponentProps<T = any, A extends Action = AnyAction> {
11
- state: T;
12
- dispatch?: Dispatch<A>;
13
- }
14
- export interface PiletReduxApi {
15
- createReduxStore(reducer: Reducer<any>): ReduxStoreConnector;
16
- }
17
- export interface PiralReduxCustomState {
18
- }
19
- export interface PiralReduxCustomActions {
20
- }
21
- export interface PiralReduxState extends PiralReduxCustomState {
22
- stores: {
23
- [pilet: string]: any;
24
- };
25
- }
26
- export interface PiralReduxActions extends PiralReduxCustomActions {
27
- create: {
28
- type: 'create-store';
29
- name: string;
30
- value: any;
31
- };
32
- destroy: {
33
- type: 'destroy-store';
34
- name: string;
35
- };
36
- change: {
37
- type: 'change-store';
38
- name: string;
39
- action: any;
40
- };
41
- }
42
- export type ReducerUnion<T> = {
43
- [P in keyof T]: T[P] extends Action<any> ? T[P] : never;
44
- }[keyof T];
45
- export type PiralReduxStore = Store<PiralReduxState, ReducerUnion<PiralReduxActions>>;
package/esm/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
package/esm/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}