@elliemae/ds-zustand-helpers 3.16.0-next.2 → 3.16.0-next.4
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/dist/cjs/withZustand.js
CHANGED
|
@@ -29,7 +29,7 @@ __export(withZustand_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(withZustand_exports);
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
31
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
-
var
|
|
32
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
33
33
|
var import_useInternalStoreCreator = require("./useInternalStoreCreator");
|
|
34
34
|
var import_AutoUpdaterComponent = require("./AutoUpdaterComponent");
|
|
35
35
|
var import_usePropsStoreCreator = require("./usePropsStoreCreator");
|
|
@@ -47,7 +47,7 @@ const withZustand = (Component, config) => {
|
|
|
47
47
|
usePropsStore
|
|
48
48
|
} = config;
|
|
49
49
|
const ComponentWithStore = (props) => {
|
|
50
|
-
const propsWithDefault = (0,
|
|
50
|
+
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, defaultProps);
|
|
51
51
|
const autoCalculatedData = useAutoCalculated(propsWithDefault);
|
|
52
52
|
const internalStoreCreator = (0, import_useInternalStoreCreator.useInternalStoreCreator)({
|
|
53
53
|
internalAtomDefaultValues,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/withZustand.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable indent */\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable indent */\n\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { useInternalStoreCreator } from './useInternalStoreCreator';\nimport type { ZustandT } from './types';\nimport { AutoUpdaterComponent } from './AutoUpdaterComponent';\nimport { usePropsStoreCreator } from './usePropsStoreCreator';\n\nconst noopish = <T extends object>() => ({} as T);\n\nexport const withZustand = <\n U extends object,\n P extends object,\n A extends object,\n C extends object,\n S extends object,\n R extends object,\n>(\n Component: React.ComponentType<Record<string, never>>,\n config: ZustandT.Config<P, A, C, S, R>,\n) => {\n const {\n defaultProps,\n internalAtomDefaultValues,\n useAutoCalculated,\n selectors = noopish,\n reducers = noopish,\n subscribers = noopish,\n PropsProvider,\n InternalProvider,\n usePropsStore,\n } = config;\n\n const ComponentWithStore = (props: U) => {\n const propsWithDefault = useMemoMergePropsWithDefault<P>(props, defaultProps);\n\n const autoCalculatedData = useAutoCalculated(propsWithDefault);\n\n const internalStoreCreator = useInternalStoreCreator({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n });\n\n const propsStoreCreator = usePropsStoreCreator(propsWithDefault, autoCalculatedData);\n\n return (\n <PropsProvider createStore={propsStoreCreator}>\n <InternalProvider createStore={internalStoreCreator}>\n <AutoUpdaterComponent\n Component={Component}\n usePropsStore={usePropsStore}\n autoCalculatedData={autoCalculatedData}\n propsWithDefault={propsWithDefault}\n />\n </InternalProvider>\n </PropsProvider>\n );\n };\n return ComponentWithStore;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkDb;AAhDV,8BAA6C;AAC7C,qCAAwC;AAExC,kCAAqC;AACrC,kCAAqC;AAErC,MAAM,UAAU,OAAyB,CAAC;AAEnC,MAAM,cAAc,CAQzB,WACA,WACG;AACH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,qBAAqB,CAAC,UAAa;AACvC,UAAM,uBAAmB,sDAAgC,OAAO,YAAY;AAE5E,UAAM,qBAAqB,kBAAkB,gBAAgB;AAE7D,UAAM,2BAAuB,wDAAwB;AAAA,MACnD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,UAAM,wBAAoB,kDAAqB,kBAAkB,kBAAkB;AAEnF,WACE,4CAAC,iBAAc,aAAa,mBAC1B,sDAAC,oBAAiB,aAAa,sBAC7B;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF,GACF,GACF;AAAA,EAEJ;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/withZustand.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useMemoMergePropsWithDefault } from "@elliemae/ds-
|
|
3
|
+
import { useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
4
4
|
import { useInternalStoreCreator } from "./useInternalStoreCreator";
|
|
5
5
|
import { AutoUpdaterComponent } from "./AutoUpdaterComponent";
|
|
6
6
|
import { usePropsStoreCreator } from "./usePropsStoreCreator";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/withZustand.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { useInternalStoreCreator } from './useInternalStoreCreator';\nimport type { ZustandT } from './types';\nimport { AutoUpdaterComponent } from './AutoUpdaterComponent';\nimport { usePropsStoreCreator } from './usePropsStoreCreator';\n\nconst noopish = <T extends object>() => ({} as T);\n\nexport const withZustand = <\n U extends object,\n P extends object,\n A extends object,\n C extends object,\n S extends object,\n R extends object,\n>(\n Component: React.ComponentType<Record<string, never>>,\n config: ZustandT.Config<P, A, C, S, R>,\n) => {\n const {\n defaultProps,\n internalAtomDefaultValues,\n useAutoCalculated,\n selectors = noopish,\n reducers = noopish,\n subscribers = noopish,\n PropsProvider,\n InternalProvider,\n usePropsStore,\n } = config;\n\n const ComponentWithStore = (props: U) => {\n const propsWithDefault = useMemoMergePropsWithDefault<P>(props, defaultProps);\n\n const autoCalculatedData = useAutoCalculated(propsWithDefault);\n\n const internalStoreCreator = useInternalStoreCreator({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n });\n\n const propsStoreCreator = usePropsStoreCreator(propsWithDefault, autoCalculatedData);\n\n return (\n <PropsProvider createStore={propsStoreCreator}>\n <InternalProvider createStore={internalStoreCreator}>\n <AutoUpdaterComponent\n Component={Component}\n usePropsStore={usePropsStore}\n autoCalculatedData={autoCalculatedData}\n propsWithDefault={propsWithDefault}\n />\n </InternalProvider>\n </PropsProvider>\n );\n };\n return ComponentWithStore;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACkDb;AAhDV,SAAS,oCAAoC;AAC7C,SAAS,+BAA+B;AAExC,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AAErC,MAAM,UAAU,OAAyB,CAAC;AAEnC,MAAM,cAAc,CAQzB,WACA,WACG;AACH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,qBAAqB,CAAC,UAAa;AACvC,UAAM,mBAAmB,6BAAgC,OAAO,YAAY;AAE5E,UAAM,qBAAqB,kBAAkB,gBAAgB;AAE7D,UAAM,uBAAuB,wBAAwB;AAAA,MACnD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,UAAM,oBAAoB,qBAAqB,kBAAkB,kBAAkB;AAEnF,WACE,oBAAC,iBAAc,aAAa,mBAC1B,8BAAC,oBAAiB,aAAa,sBAC7B;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF,GACF,GACF;AAAA,EAEJ;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-zustand-helpers",
|
|
3
|
-
"version": "3.16.0-next.
|
|
3
|
+
"version": "3.16.0-next.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Zustand Helpers",
|
|
6
6
|
"files": [
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"immer": "9.0.19",
|
|
43
43
|
"zustand": "4.1.4",
|
|
44
|
-
"@elliemae/ds-
|
|
44
|
+
"@elliemae/ds-props-helpers": "3.16.0-next.4",
|
|
45
|
+
"@elliemae/ds-utilities": "3.16.0-next.4"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@testing-library/jest-dom": "~5.16.5",
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../.eslintrc.js' src/",
|
|
58
59
|
"dts": "node ../../scripts/dts.mjs",
|
|
59
60
|
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
60
|
-
"dev:build": "pnpm --filter {.}... build
|
|
61
|
+
"dev:build": "pnpm --filter {.}... build",
|
|
61
62
|
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
62
63
|
"checkDeps": "npx -yes ../ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\"",
|
|
63
64
|
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch"
|