cross-state 0.37.5 → 0.37.7
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/index.cjs +16 -16
- package/dist/cjs/patches/index.cjs +4 -1
- package/dist/cjs/patches/index.cjs.map +1 -1
- package/dist/cjs/propAccess.cjs +1 -1
- package/dist/cjs/propAccess.cjs.map +1 -1
- package/dist/cjs/react/index.cjs +1 -1
- package/dist/cjs/react/register.cjs +2 -2
- package/dist/es/index.mjs +16 -16
- package/dist/es/patches/index.mjs +4 -1
- package/dist/es/patches/index.mjs.map +1 -1
- package/dist/es/propAccess.mjs +1 -1
- package/dist/es/propAccess.mjs.map +1 -1
- package/dist/es/react/index.mjs +1 -1
- package/dist/es/react/register.mjs +2 -2
- package/package.json +16 -16
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const diff = require("./diff.cjs");
|
|
4
|
-
const store = require("./store.cjs");
|
|
5
|
-
const propAccess = require("./propAccess.cjs");
|
|
6
3
|
const scope = require("./scope.cjs");
|
|
4
|
+
const store = require("./store.cjs");
|
|
7
5
|
const urlStore = require("./urlStore.cjs");
|
|
6
|
+
const diff = require("./diff.cjs");
|
|
7
|
+
const propAccess = require("./propAccess.cjs");
|
|
8
8
|
function findOrDefault(array, predicate, defaultValue) {
|
|
9
9
|
const index = array.findIndex(predicate);
|
|
10
10
|
if (index >= 0) {
|
|
@@ -194,8 +194,14 @@ function persist(store2, options) {
|
|
|
194
194
|
function isPlainPath(p) {
|
|
195
195
|
return typeof p === "string" || Array.isArray(p);
|
|
196
196
|
}
|
|
197
|
-
exports.
|
|
198
|
-
exports.
|
|
197
|
+
exports.Cache = scope.Cache;
|
|
198
|
+
exports.InstanceCache = scope.InstanceCache;
|
|
199
|
+
exports.ResourceGroup = scope.ResourceGroup;
|
|
200
|
+
exports.Scope = scope.Scope;
|
|
201
|
+
exports.allResources = scope.allResources;
|
|
202
|
+
exports.createCache = scope.createCache;
|
|
203
|
+
exports.createResourceGroup = scope.createResourceGroup;
|
|
204
|
+
exports.createScope = scope.createScope;
|
|
199
205
|
exports.Store = store.Store;
|
|
200
206
|
exports.arrayMethods = store.arrayMethods;
|
|
201
207
|
exports.calcDuration = store.calcDuration;
|
|
@@ -203,22 +209,16 @@ exports.createStore = store.createStore;
|
|
|
203
209
|
exports.mapMethods = store.mapMethods;
|
|
204
210
|
exports.recordMethods = store.recordMethods;
|
|
205
211
|
exports.setMethods = store.setMethods;
|
|
212
|
+
exports.connectUrl = urlStore.connectUrl;
|
|
213
|
+
exports.createUrlStore = urlStore.createUrlStore;
|
|
214
|
+
exports.updateUrlStore = urlStore.updateUrlStore;
|
|
215
|
+
exports.applyPatches = diff.applyPatches;
|
|
216
|
+
exports.diff = diff.diff;
|
|
206
217
|
exports.deepEqual = propAccess.deepEqual;
|
|
207
218
|
exports.get = propAccess.get;
|
|
208
219
|
exports.set = propAccess.set;
|
|
209
220
|
exports.shallowEqual = propAccess.shallowEqual;
|
|
210
221
|
exports.strictEqual = propAccess.strictEqual;
|
|
211
|
-
exports.Cache = scope.Cache;
|
|
212
|
-
exports.InstanceCache = scope.InstanceCache;
|
|
213
|
-
exports.ResourceGroup = scope.ResourceGroup;
|
|
214
|
-
exports.Scope = scope.Scope;
|
|
215
|
-
exports.allResources = scope.allResources;
|
|
216
|
-
exports.createCache = scope.createCache;
|
|
217
|
-
exports.createResourceGroup = scope.createResourceGroup;
|
|
218
|
-
exports.createScope = scope.createScope;
|
|
219
|
-
exports.connectUrl = urlStore.connectUrl;
|
|
220
|
-
exports.createUrlStore = urlStore.createUrlStore;
|
|
221
|
-
exports.updateUrlStore = urlStore.updateUrlStore;
|
|
222
222
|
exports.findOrDefault = findOrDefault;
|
|
223
223
|
exports.persist = persist;
|
|
224
224
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -12,7 +12,10 @@ function subscribePatches(listener, options) {
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
const { stopAt, runNow, ...subscribeOptions } = options ?? {};
|
|
15
|
-
const cancel = this.__patches.subscribe((p) => listener(...p),
|
|
15
|
+
const cancel = this.__patches.subscribe((p) => listener(...p), {
|
|
16
|
+
...subscribeOptions,
|
|
17
|
+
runNow: false
|
|
18
|
+
});
|
|
16
19
|
if (runNow) {
|
|
17
20
|
listener(...diff.diff(void 0, this.get(), options));
|
|
18
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/patches/patchMethods.ts"],"sourcesContent":["import type { Cancel, SubscribeOptions } from '@core/commonTypes';\nimport type { Store } from '@core/store';\nimport { applyPatches as _applyPatches } from '@lib/applyPatches';\nimport { diff, type DiffOptions, type Patch } from '@lib/diff';\n\ndeclare module '@core' {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n interface Store<T> {\n __patches?: Store<[Patch[], Patch[]]>;\n }\n}\n\nexport interface SubscribePatchOptions extends SubscribeOptions, DiffOptions {\n /** @default false */\n runNow?: boolean;\n}\n\nexport interface SyncMessage {\n id: string;\n previousId?: string;\n patches: Patch[];\n}\n\nexport type InteropPatch = Patch | { op: 'add' | 'replace' | 'remove'; value?: any };\n\nconst genId = () => Math.random().toString(36).slice(2);\n\nfunction subscribePatches<T>(\n this: Store<T>,\n listener: (patches: Patch[], reversePatches: Patch[]) => void,\n options?: SubscribePatchOptions,\n): Cancel {\n if (!this.__patches) {\n let previousValue = this.get();\n\n this.__patches = this.map((value) => {\n const result = diff(previousValue, value, options);\n previousValue = value;\n return result;\n });\n }\n\n const { stopAt, runNow, ...subscribeOptions } = options ?? {};\n\n const cancel = this.__patches.subscribe((p) => listener(...p), subscribeOptions);\n\n if (runNow) {\n listener(...diff(undefined, this.get(), options));\n }\n\n return cancel;\n}\n\nfunction applyPatches<T>(this: Store<T>, patches: InteropPatch[]): void;\nfunction applyPatches<T>(this: Store<T>, ...patches: InteropPatch[]): void;\nfunction applyPatches<T>(this: Store<T>, ...patches: (InteropPatch | InteropPatch[])[]): void {\n this.set((value) => _applyPatches(value, ...(patches.flat() as Patch[])));\n}\n\nfunction sync<T>(\n this: Store<T>,\n listener: (syncMessage: SyncMessage) => void,\n options?: Omit<SubscribePatchOptions, 'runNow'>,\n): Cancel {\n let previousId: string | undefined;\n\n return this.subscribePatches(\n (patches) => {\n const id = genId();\n const message = { id, previousId, patches };\n previousId = id;\n\n listener(message);\n },\n { ...options, runNow: true },\n );\n}\n\nfunction acceptSync<T>(this: Store<T>): (message: SyncMessage) => void {\n let previousId: string | undefined;\n\n return (message) => {\n if (message.previousId && message.previousId !== previousId) {\n throw new Error('previousId mismatch');\n }\n\n previousId = message.id;\n this.applyPatches(...message.patches);\n };\n}\n\nexport const patchMethods = {\n subscribePatches,\n applyPatches,\n sync,\n acceptSync,\n};\n"],"names":["diff","_applyPatches"],"mappings":";;;AAyBA,MAAM,QAAQ,MAAM,KAAK,SAAS,SAAS,EAAE,EAAE,MAAM,CAAC;AAEtD,SAAS,iBAEP,UACA,SACQ;AACJ,MAAA,CAAC,KAAK,WAAW;AACf,QAAA,gBAAgB,KAAK;AAEzB,SAAK,YAAY,KAAK,IAAI,CAAC,UAAU;AACnC,YAAM,SAASA,KAAA,KAAK,eAAe,OAAO,OAAO;AACjC,sBAAA;AACT,aAAA;AAAA,IAAA,CACR;AAAA,EACH;AAEA,QAAM,EAAE,QAAQ,QAAQ,GAAG,iBAAiB,IAAI,WAAW;AAErD,QAAA,SAAS,KAAK,UAAU,UAAU,CAAC,MAAM,SAAS,GAAG,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/patches/patchMethods.ts"],"sourcesContent":["import type { Cancel, SubscribeOptions } from '@core/commonTypes';\nimport type { Store } from '@core/store';\nimport { applyPatches as _applyPatches } from '@lib/applyPatches';\nimport { diff, type DiffOptions, type Patch } from '@lib/diff';\n\ndeclare module '@core' {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n interface Store<T> {\n __patches?: Store<[Patch[], Patch[]]>;\n }\n}\n\nexport interface SubscribePatchOptions extends SubscribeOptions, DiffOptions {\n /** @default false */\n runNow?: boolean;\n}\n\nexport interface SyncMessage {\n id: string;\n previousId?: string;\n patches: Patch[];\n}\n\nexport type InteropPatch = Patch | { op: 'add' | 'replace' | 'remove'; value?: any };\n\nconst genId = () => Math.random().toString(36).slice(2);\n\nfunction subscribePatches<T>(\n this: Store<T>,\n listener: (patches: Patch[], reversePatches: Patch[]) => void,\n options?: SubscribePatchOptions,\n): Cancel {\n if (!this.__patches) {\n let previousValue = this.get();\n\n this.__patches = this.map((value) => {\n const result = diff(previousValue, value, options);\n previousValue = value;\n return result;\n });\n }\n\n const { stopAt, runNow, ...subscribeOptions } = options ?? {};\n\n const cancel = this.__patches.subscribe((p) => listener(...p), {\n ...subscribeOptions,\n runNow: false,\n });\n\n if (runNow) {\n listener(...diff(undefined, this.get(), options));\n }\n\n return cancel;\n}\n\nfunction applyPatches<T>(this: Store<T>, patches: InteropPatch[]): void;\nfunction applyPatches<T>(this: Store<T>, ...patches: InteropPatch[]): void;\nfunction applyPatches<T>(this: Store<T>, ...patches: (InteropPatch | InteropPatch[])[]): void {\n this.set((value) => _applyPatches(value, ...(patches.flat() as Patch[])));\n}\n\nfunction sync<T>(\n this: Store<T>,\n listener: (syncMessage: SyncMessage) => void,\n options?: Omit<SubscribePatchOptions, 'runNow'>,\n): Cancel {\n let previousId: string | undefined;\n\n return this.subscribePatches(\n (patches) => {\n const id = genId();\n const message = { id, previousId, patches };\n previousId = id;\n\n listener(message);\n },\n { ...options, runNow: true },\n );\n}\n\nfunction acceptSync<T>(this: Store<T>): (message: SyncMessage) => void {\n let previousId: string | undefined;\n\n return (message) => {\n if (message.previousId && message.previousId !== previousId) {\n throw new Error('previousId mismatch');\n }\n\n previousId = message.id;\n this.applyPatches(...message.patches);\n };\n}\n\nexport const pat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AAQ,OAAO;AAAA,EAAA;AAExC;AAEO,MAAM,eAAe;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;"}
|
package/dist/cjs/propAccess.cjs
CHANGED
|
@@ -106,7 +106,7 @@ function set(object, path, value, rootPath = path) {
|
|
|
106
106
|
if (!child && rest.length > 0) {
|
|
107
107
|
const _rootPath = castArrayPath(rootPath);
|
|
108
108
|
const prefix = _rootPath.slice(0, -rest.length);
|
|
109
|
-
throw new Error(`Cannot set ${
|
|
109
|
+
throw new Error(`Cannot set ${_rootPath.join(".")} because ${prefix.join(".")} is ${child}`);
|
|
110
110
|
}
|
|
111
111
|
return set(child, rest, value, rootPath);
|
|
112
112
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propAccess.cjs","sources":["../../src/lib/equals.ts","../../src/lib/helpers.ts","../../src/lib/clone.ts","../../src/lib/propAccess.ts"],"sourcesContent":["export function strictEqual(a: any, b: any) {\n return a === b;\n}\n\nexport function shallowEqual(a: any, b: any): boolean {\n return internalEqual(strictEqual)(a, b);\n}\n\nexport function deepEqual(a: any, b: any): boolean {\n return internalEqual(deepEqual)(a, b);\n}\n\nconst internalEqual = (comp: (a: any, b: any) => boolean) => (a: any, b: any) => {\n if (a === b) {\n return true;\n }\n\n if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') {\n // eslint-disable-next-line no-self-compare\n return a !== a && b !== b;\n }\n\n if (a.constructor !== b.constructor) {\n return false;\n }\n\n if (a.constructor === Object || Array.isArray(a)) {\n const entries1 = Object.entries(a);\n const entries2 = Object.entries(b);\n return (\n entries1.length === entries2.length && entries1.every(([key, value]) => comp(value, b[key]))\n );\n }\n\n if (a instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (a instanceof RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n\n if (a instanceof Map) {\n return a.size === b.size && [...a.entries()].every(([key, value]) => comp(value, b.get(key)));\n }\n\n if (a instanceof Set) {\n return a.size === b.size && [...a.values()].every((value) => b.has(value));\n }\n\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView(a)) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n const a_ = new Int8Array(a.buffer);\n const b_ = new Int8Array(b.buffer);\n return a_.every((value, i) => value === b_[i]);\n }\n\n return false;\n};\n","export function isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n return (\n (prototype === null ||\n prototype === Object.prototype ||\n Object.getPrototypeOf(prototype) === null) &&\n !(Symbol.toStringTag in value) &&\n !(Symbol.iterator in value)\n );\n}\n","import { isObject } from '@lib/helpers';\n\nexport function flatClone<T>(object: T): T {\n if (object instanceof Map) {\n return new Map(object) as any;\n }\n\n if (object instanceof Set) {\n return new Set(object) as any;\n }\n\n if (Array.isArray(object)) {\n return [...object] as any;\n }\n\n if (isObject(object)) {\n return { ...object };\n }\n\n return object;\n}\n","import { isObject } from '@lib/helpers';\nimport type { Update } from '../core/commonTypes';\nimport { flatClone } from './clone';\nimport type { KeyType, Path, Value } from './path';\n\nexport function castArrayPath(path: string | KeyType[]): KeyType[] {\n if (Array.isArray(path)) {\n return path;\n }\n\n if (path === '') {\n return [];\n }\n\n return (path as string).split('.');\n}\n\nexport function get<T, P extends Path<T>>(object: T, path: P): Value<T, P> {\n const _path = castArrayPath(path as any);\n const [first, ...rest] = _path;\n\n if (first === undefined || !object) {\n return object as Value<T, P>;\n }\n\n if (object instanceof Map) {\n return get(object.get(first), rest);\n }\n\n if (object instanceof Set) {\n return get(Array.from(object)[Number(first)], rest);\n }\n\n if (isObject(object)) {\n return get(object[first as keyof T], rest as any) as Value<T, P>;\n }\n\n throw new Error(`Could not get ${path} of ${object}`);\n}\n\nexport function set<T, P extends Path<T>>(\n object: T,\n path: P,\n value: Update<Value<T, P>>,\n rootPath = path,\n): T {\n const _path = castArrayPath(path as any);\n const [first, ...rest] = _path;\n\n if (first === undefined) {\n return value as any;\n }\n\n const updateChild = (child: any) => {\n if (!child && rest.length > 0) {\n const _rootPath = castArrayPath(rootPath as any);\n\n const prefix = _rootPath.slice(0, -rest.length);\n throw new Error(`Cannot set ${
|
|
1
|
+
{"version":3,"file":"propAccess.cjs","sources":["../../src/lib/equals.ts","../../src/lib/helpers.ts","../../src/lib/clone.ts","../../src/lib/propAccess.ts"],"sourcesContent":["export function strictEqual(a: any, b: any) {\n return a === b;\n}\n\nexport function shallowEqual(a: any, b: any): boolean {\n return internalEqual(strictEqual)(a, b);\n}\n\nexport function deepEqual(a: any, b: any): boolean {\n return internalEqual(deepEqual)(a, b);\n}\n\nconst internalEqual = (comp: (a: any, b: any) => boolean) => (a: any, b: any) => {\n if (a === b) {\n return true;\n }\n\n if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') {\n // eslint-disable-next-line no-self-compare\n return a !== a && b !== b;\n }\n\n if (a.constructor !== b.constructor) {\n return false;\n }\n\n if (a.constructor === Object || Array.isArray(a)) {\n const entries1 = Object.entries(a);\n const entries2 = Object.entries(b);\n return (\n entries1.length === entries2.length && entries1.every(([key, value]) => comp(value, b[key]))\n );\n }\n\n if (a instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (a instanceof RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n\n if (a instanceof Map) {\n return a.size === b.size && [...a.entries()].every(([key, value]) => comp(value, b.get(key)));\n }\n\n if (a instanceof Set) {\n return a.size === b.size && [...a.values()].every((value) => b.has(value));\n }\n\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView(a)) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n const a_ = new Int8Array(a.buffer);\n const b_ = new Int8Array(b.buffer);\n return a_.every((value, i) => value === b_[i]);\n }\n\n return false;\n};\n","export function isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n return (\n (prototype === null ||\n prototype === Object.prototype ||\n Object.getPrototypeOf(prototype) === null) &&\n !(Symbol.toStringTag in value) &&\n !(Symbol.iterator in value)\n );\n}\n","import { isObject } from '@lib/helpers';\n\nexport function flatClone<T>(object: T): T {\n if (object instanceof Map) {\n return new Map(object) as any;\n }\n\n if (object instanceof Set) {\n return new Set(object) as any;\n }\n\n if (Array.isArray(object)) {\n return [...object] as any;\n }\n\n if (isObject(object)) {\n return { ...object };\n }\n\n return object;\n}\n","import { isObject } from '@lib/helpers';\nimport type { Update } from '../core/commonTypes';\nimport { flatClone } from './clone';\nimport type { KeyType, Path, Value } from './path';\n\nexport function castArrayPath(path: string | KeyType[]): KeyType[] {\n if (Array.isArray(path)) {\n return path;\n }\n\n if (path === '') {\n return [];\n }\n\n return (path as string).split('.');\n}\n\nexport function get<T, P extends Path<T>>(object: T, path: P): Value<T, P> {\n const _path = castArrayPath(path as any);\n const [first, ...rest] = _path;\n\n if (first === undefined || !object) {\n return object as Value<T, P>;\n }\n\n if (object instanceof Map) {\n return get(object.get(first), rest);\n }\n\n if (object instanceof Set) {\n return get(Array.from(object)[Number(first)], rest);\n }\n\n if (isObject(object)) {\n return get(object[first as keyof T], rest as any) as Value<T, P>;\n }\n\n throw new Error(`Could not get ${path} of ${object}`);\n}\n\nexport function set<T, P extends Path<T>>(\n object: T,\n path: P,\n value: Update<Value<T, P>>,\n rootPath = path,\n): T {\n const _path = castArrayPath(path as any);\n const [first, ...rest] = _path;\n\n if (first === undefined) {\n return value as any;\n }\n\n const updateChild = (child: any) => {\n if (!child && rest.length > 0) {\n const _rootPath = castArrayPath(rootPath as any);\n\n const prefix = _rootPath.slice(0, -rest.length);\n throw new Error(`Cannot set ${_rootPath.join('.')} because ${prefix.join('.')} is ${child}`);\n }\n\n return set(child, rest as any, value, rootPath);\n };\n\n if (object instanceof Map) {\n const copy = flatClone(object);\n const child = copy.get(first);\n copy.set(first, updateChild(child));\n return copy;\n }\n\n if (object instanceof Set) {\n const copy = [...object];\n const child = copy[Number(first)];\n copy[Number(first)] = updateChild(child);\n return new Set(copy) as any;\n }\n\n if (isObject(object) || object === undefined) {\n const copy = flatClone(object ?? ({} as T));\n copy[first as keyof T] = updateChild(copy[first as keyof T]);\n return copy;\n }\n\n throw new Error(`Could not set ${path} of ${object}`);\n}\n\nexport function remove<T, P extends Path<T, true>>(object: T, path: P): T {\n const _path = castArrayPath(path as any);\n\n if (_path.length === 0) {\n return undefined as any;\n }\n\n const parentPath = _path.slice(0, -1);\n const key = _path[_path.length - 1];\n\n const parent = flatClone(get(object, parentPath as any));\n\n if (parent instanceof Map) {\n parent.delete(key);\n } else if (parent instanceof Set) {\n const value = Array.from(parent)[Number(key)];\n parent.delete(value);\n } else {\n delete parent[key as keyof typeof parent];\n }\n\n return set(object, parentPath as any, parent);\n}\n\nexport function join(a: string, b: string) {\n return [a, b].filter(Boolean).join('.');\n}\n"],"names":[],"mappings":";AAAgB,SAAA,YAAY,GAAQ,GAAQ;AAC1C,SAAO,MAAM;AACf;AAEgB,SAAA,aAAa,GAAQ,GAAiB;AACpD,SAAO,cAAc,WAAW,EAAE,GAAG,CAAC;AACxC;AAEgB,SAAA,UAAU,GAAQ,GAAiB;AACjD,SAAO,cAAc,SAAS,EAAE,GAAG,CAAC;AACtC;AAEA,MAAM,gBAAgB,CAAC,SAAsC,CAAC,GAAQ,MAAW;AAC/E,MAAI,MAAM,GAAG;AACJ,WAAA;AAAA,EACT;AAEI,MAAA,MAAM,QAAQ,MAAM,QAAQ,OAAO,MAAM,YAAY,OAAO,MAAM,UAAU;AAEvE,WAAA,MAAM,KAAK,MAAM;AAAA,EAC1B;AAEI,MAAA,EAAE,gBAAgB,EAAE,aAAa;AAC5B,WAAA;AAAA,EACT;AAEA,MAAI,EAAE,gBAAgB,UAAU,MAAM,QAAQ,CAAC,GA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AAO,GAAG;AAAA,EAAA,WACR,kBAAkB,KAAK;AAChC,UAAM,QAAQ,MAAM,KAAK,MAAM,EAAE,OAAO,GAAG,CAAC;AAC5C,WAAO,OAAO,KAAK;AAAA,EAAA,OACd;AACL,WAAO,OAAO,GAA0B;AAAA,EAC1C;AAEO,SAAA,IAAI,QAAQ,YAAmB,MAAM;AAC9C;AAEgB,SAAA,KAAK,GAAW,GAAW;AAClC,SAAA,CAAC,GAAG,CAAC,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AACxC;;;;;;;;;;;"}
|
package/dist/cjs/react/index.cjs
CHANGED
|
@@ -5,8 +5,8 @@ const require$$0 = require("react");
|
|
|
5
5
|
const store = require("../store.cjs");
|
|
6
6
|
const hash = require("../hash.cjs");
|
|
7
7
|
const jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
const propAccess = require("../propAccess.cjs");
|
|
9
8
|
const urlStore = require("../urlStore.cjs");
|
|
9
|
+
const propAccess = require("../propAccess.cjs");
|
|
10
10
|
function CustomInput({ name, children, ...props }) {
|
|
11
11
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12
12
|
"div",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const useCache = require("../useCache.cjs");
|
|
3
|
-
const store = require("../store.cjs");
|
|
4
2
|
const scope = require("../scope.cjs");
|
|
3
|
+
const store = require("../store.cjs");
|
|
4
|
+
const useCache = require("../useCache.cjs");
|
|
5
5
|
const cacheMethods = {
|
|
6
6
|
useCache(options) {
|
|
7
7
|
return useCache.useCache(this, options);
|
package/dist/es/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a } from "./diff.mjs";
|
|
1
|
+
import { C, I, R, S, a, c, b, d } from "./scope.mjs";
|
|
3
2
|
import { q as queue } from "./store.mjs";
|
|
4
|
-
import { S, e, d, c, f, r, s } from "./store.mjs";
|
|
3
|
+
import { S as S2, e, d as d2, c as c2, f, r, s } from "./store.mjs";
|
|
4
|
+
import { c as c3, a as a2, u } from "./urlStore.mjs";
|
|
5
|
+
import { d as diff } from "./diff.mjs";
|
|
6
|
+
import { a as a3 } from "./diff.mjs";
|
|
5
7
|
import { c as castArrayPath, b as shallowEqual, g as get, s as set } from "./propAccess.mjs";
|
|
6
|
-
import { d as
|
|
7
|
-
import { C, I, R, S as S2, a as a2, c as c2, b, d as d3 } from "./scope.mjs";
|
|
8
|
-
import { c as c3, a as a3, u } from "./urlStore.mjs";
|
|
8
|
+
import { d as d3, e as e2 } from "./propAccess.mjs";
|
|
9
9
|
function findOrDefault(array, predicate, defaultValue) {
|
|
10
10
|
const index = array.findIndex(predicate);
|
|
11
11
|
if (index >= 0) {
|
|
@@ -199,19 +199,19 @@ export {
|
|
|
199
199
|
C as Cache,
|
|
200
200
|
I as InstanceCache,
|
|
201
201
|
R as ResourceGroup,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
202
|
+
S as Scope,
|
|
203
|
+
S2 as Store,
|
|
204
|
+
a as allResources,
|
|
205
|
+
a3 as applyPatches,
|
|
206
206
|
e as arrayMethods,
|
|
207
|
-
|
|
207
|
+
d2 as calcDuration,
|
|
208
208
|
c3 as connectUrl,
|
|
209
|
-
|
|
209
|
+
c as createCache,
|
|
210
210
|
b as createResourceGroup,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
d as createScope,
|
|
212
|
+
c2 as createStore,
|
|
213
|
+
a2 as createUrlStore,
|
|
214
|
+
d3 as deepEqual,
|
|
215
215
|
diff,
|
|
216
216
|
findOrDefault,
|
|
217
217
|
get,
|
|
@@ -10,7 +10,10 @@ function subscribePatches(listener, options) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
const { stopAt, runNow, ...subscribeOptions } = options ?? {};
|
|
13
|
-
const cancel = this.__patches.subscribe((p) => listener(...p),
|
|
13
|
+
const cancel = this.__patches.subscribe((p) => listener(...p), {
|
|
14
|
+
...subscribeOptions,
|
|
15
|
+
runNow: false
|
|
16
|
+
});
|
|
14
17
|
if (runNow) {
|
|
15
18
|
listener(...diff(void 0, this.get(), options));
|
|
16
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/patches/patchMethods.ts"],"sourcesContent":["import type { Cancel, SubscribeOptions } from '@core/commonTypes';\nimport type { Store } from '@core/store';\nimport { applyPatches as _applyPatches } from '@lib/applyPatches';\nimport { diff, type DiffOptions, type Patch } from '@lib/diff';\n\ndeclare module '@core' {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n interface Store<T> {\n __patches?: Store<[Patch[], Patch[]]>;\n }\n}\n\nexport interface SubscribePatchOptions extends SubscribeOptions, DiffOptions {\n /** @default false */\n runNow?: boolean;\n}\n\nexport interface SyncMessage {\n id: string;\n previousId?: string;\n patches: Patch[];\n}\n\nexport type InteropPatch = Patch | { op: 'add' | 'replace' | 'remove'; value?: any };\n\nconst genId = () => Math.random().toString(36).slice(2);\n\nfunction subscribePatches<T>(\n this: Store<T>,\n listener: (patches: Patch[], reversePatches: Patch[]) => void,\n options?: SubscribePatchOptions,\n): Cancel {\n if (!this.__patches) {\n let previousValue = this.get();\n\n this.__patches = this.map((value) => {\n const result = diff(previousValue, value, options);\n previousValue = value;\n return result;\n });\n }\n\n const { stopAt, runNow, ...subscribeOptions } = options ?? {};\n\n const cancel = this.__patches.subscribe((p) => listener(...p), subscribeOptions);\n\n if (runNow) {\n listener(...diff(undefined, this.get(), options));\n }\n\n return cancel;\n}\n\nfunction applyPatches<T>(this: Store<T>, patches: InteropPatch[]): void;\nfunction applyPatches<T>(this: Store<T>, ...patches: InteropPatch[]): void;\nfunction applyPatches<T>(this: Store<T>, ...patches: (InteropPatch | InteropPatch[])[]): void {\n this.set((value) => _applyPatches(value, ...(patches.flat() as Patch[])));\n}\n\nfunction sync<T>(\n this: Store<T>,\n listener: (syncMessage: SyncMessage) => void,\n options?: Omit<SubscribePatchOptions, 'runNow'>,\n): Cancel {\n let previousId: string | undefined;\n\n return this.subscribePatches(\n (patches) => {\n const id = genId();\n const message = { id, previousId, patches };\n previousId = id;\n\n listener(message);\n },\n { ...options, runNow: true },\n );\n}\n\nfunction acceptSync<T>(this: Store<T>): (message: SyncMessage) => void {\n let previousId: string | undefined;\n\n return (message) => {\n if (message.previousId && message.previousId !== previousId) {\n throw new Error('previousId mismatch');\n }\n\n previousId = message.id;\n this.applyPatches(...message.patches);\n };\n}\n\nexport const patchMethods = {\n subscribePatches,\n applyPatches,\n sync,\n acceptSync,\n};\n"],"names":["_applyPatches"],"mappings":";AAyBA,MAAM,QAAQ,MAAM,KAAK,SAAS,SAAS,EAAE,EAAE,MAAM,CAAC;AAEtD,SAAS,iBAEP,UACA,SACQ;AACJ,MAAA,CAAC,KAAK,WAAW;AACf,QAAA,gBAAgB,KAAK;AAEzB,SAAK,YAAY,KAAK,IAAI,CAAC,UAAU;AACnC,YAAM,SAAS,KAAK,eAAe,OAAO,OAAO;AACjC,sBAAA;AACT,aAAA;AAAA,IAAA,CACR;AAAA,EACH;AAEA,QAAM,EAAE,QAAQ,QAAQ,GAAG,iBAAiB,IAAI,WAAW;AAErD,QAAA,SAAS,KAAK,UAAU,UAAU,CAAC,MAAM,SAAS,GAAG,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/patches/patchMethods.ts"],"sourcesContent":["import type { Cancel, SubscribeOptions } from '@core/commonTypes';\nimport type { Store } from '@core/store';\nimport { applyPatches as _applyPatches } from '@lib/applyPatches';\nimport { diff, type DiffOptions, type Patch } from '@lib/diff';\n\ndeclare module '@core' {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n interface Store<T> {\n __patches?: Store<[Patch[], Patch[]]>;\n }\n}\n\nexport interface SubscribePatchOptions extends SubscribeOptions, DiffOptions {\n /** @default false */\n runNow?: boolean;\n}\n\nexport interface SyncMessage {\n id: string;\n previousId?: string;\n patches: Patch[];\n}\n\nexport type InteropPatch = Patch | { op: 'add' | 'replace' | 'remove'; value?: any };\n\nconst genId = () => Math.random().toString(36).slice(2);\n\nfunction subscribePatches<T>(\n this: Store<T>,\n listener: (patches: Patch[], reversePatches: Patch[]) => void,\n options?: SubscribePatchOptions,\n): Cancel {\n if (!this.__patches) {\n let previousValue = this.get();\n\n this.__patches = this.map((value) => {\n const result = diff(previousValue, value, options);\n previousValue = value;\n return result;\n });\n }\n\n const { stopAt, runNow, ...subscribeOptions } = options ?? {};\n\n const cancel = this.__patches.subscribe((p) => listener(...p), {\n ...subscribeOptions,\n runNow: false,\n });\n\n if (runNow) {\n listener(...diff(undefined, this.get(), options));\n }\n\n return cancel;\n}\n\nfunction applyPatches<T>(this: Store<T>, patches: InteropPatch[]): void;\nfunction applyPatches<T>(this: Store<T>, ...patches: InteropPatch[]): void;\nfunction applyPatches<T>(this: Store<T>, ...patches: (InteropPatch | InteropPatch[])[]): void {\n this.set((value) => _applyPatches(value, ...(patches.flat() as Patch[])));\n}\n\nfunction sync<T>(\n this: Store<T>,\n listener: (syncMessage: SyncMessage) => void,\n options?: Omit<SubscribePatchOptions, 'runNow'>,\n): Cancel {\n let previousId: string | undefined;\n\n return this.subscribePatches(\n (patches) => {\n const id = genId();\n const message = { id, previousId, patches };\n previousId = id;\n\n listener(message);\n },\n { ...options, runNow: true },\n );\n}\n\nfunction acceptSync<T>(this: Store<T>): (message: SyncMessage) => void {\n let previousId: string | undefined;\n\n return (message) => {\n if (message.previousId && message.previousId !== previousId) {\n throw new Error('previousId mismatch');\n }\n\n previousId = message.id;\n this.applyPatches(...message.patches);\n };\n}\n\nexport const patchMethods = {\n subscribePatches,\n applyPatches,\n sync,\n acceptSync,\n};\n"],"names":["_applyPatches"],"mappings":";AAyBA,MAAM,QAAQ,MAAM,KAAK,SAAS,SAAS,EAAE,EAAE,MAAM,CAAC;AAEtD,SAAS,iBAEP,UACA,SACQ;AACJ,MAAA,CAAC,KAAK,WAAW;AACf,QAAA,gBAAgB,KAAK;AAEzB,SAAK,YAAY,KAAK,IAAI,CAAC,UAAU;AACnC,YAAM,SAAS,KAAK,eAAe,OAAO,OAAO;AACjC,sBAAA;AACT,aAAA;AAAA,IAAA,CACR;AAAA,EACH;AAEA,QAAM,EAAE,QAAQ,QAAQ,GAAG,iBAAiB,IAAI,WAAW;AAErD,QAAA,SAAS,KAAK,UAAU,UAAU,CAAC,MAAM,SAAS,GAAG,CAAC,GAAG;AAAA,IAC7D,GAAG;AAAA,IACH,QAAQ;AAAA,EAAA,CACT;AAED,MAAI,QAAQ;AACV,aAAS,GAAG,KAAK,QAAW,KAAK,IAAI,GAAG,OAAO,CAAC;AAAA,EAClD;AAEO,SAAA;AACT;AAIA,SAAS,gBAAmC,SAAkD;AACvF,OAAA,IAAI,CAAC,UAAUA,eAAc,OAAO,GAAI,QAAQ,KAAkB,CAAA,CAAC;AAC1E;AAEA,SAAS,KAEP,UACA,SACQ;AACJ,MAAA;AAEJ,SAAO,KAAK;AAAA,IACV,CAAC,YAAY;AACX,YAAM,KAAK;AACX,YAAM,UAAU,EAAE,IAAI,YAAY,QAAQ;AAC7B,mBAAA;AAEb,eAAS,OAAO;AAAA,IAClB;AAAA,IACA,EAAE,GAAG,SAAS,QAAQ,KAAK;AAAA,EAAA;AAE/B;AAEA,SAAS,aAA8D;AACjE,MAAA;AAEJ,SAAO,CAAC,YAAY;AAClB,QAAI,QAAQ,cAAc,QAAQ,eAAe,YAAY;AACrD,YAAA,IAAI,MAAM,qBAAqB;AAAA,IACvC;AAEA,iBAAa,QAAQ;AAChB,SAAA,aAAa,GAAG,QAAQ,OAAO;AAAA,EAAA;AAExC;AAEO,MAAM,eAAe;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
|
package/dist/es/propAccess.mjs
CHANGED
|
@@ -105,7 +105,7 @@ function set(object, path, value, rootPath = path) {
|
|
|
105
105
|
if (!child && rest.length > 0) {
|
|
106
106
|
const _rootPath = castArrayPath(rootPath);
|
|
107
107
|
const prefix = _rootPath.slice(0, -rest.length);
|
|
108
|
-
throw new Error(`Cannot set ${
|
|
108
|
+
throw new Error(`Cannot set ${_rootPath.join(".")} because ${prefix.join(".")} is ${child}`);
|
|
109
109
|
}
|
|
110
110
|
return set(child, rest, value, rootPath);
|
|
111
111
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propAccess.mjs","sources":["../../src/lib/equals.ts","../../src/lib/helpers.ts","../../src/lib/clone.ts","../../src/lib/propAccess.ts"],"sourcesContent":["export function strictEqual(a: any, b: any) {\n return a === b;\n}\n\nexport function shallowEqual(a: any, b: any): boolean {\n return internalEqual(strictEqual)(a, b);\n}\n\nexport function deepEqual(a: any, b: any): boolean {\n return internalEqual(deepEqual)(a, b);\n}\n\nconst internalEqual = (comp: (a: any, b: any) => boolean) => (a: any, b: any) => {\n if (a === b) {\n return true;\n }\n\n if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') {\n // eslint-disable-next-line no-self-compare\n return a !== a && b !== b;\n }\n\n if (a.constructor !== b.constructor) {\n return false;\n }\n\n if (a.constructor === Object || Array.isArray(a)) {\n const entries1 = Object.entries(a);\n const entries2 = Object.entries(b);\n return (\n entries1.length === entries2.length && entries1.every(([key, value]) => comp(value, b[key]))\n );\n }\n\n if (a instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (a instanceof RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n\n if (a instanceof Map) {\n return a.size === b.size && [...a.entries()].every(([key, value]) => comp(value, b.get(key)));\n }\n\n if (a instanceof Set) {\n return a.size === b.size && [...a.values()].every((value) => b.has(value));\n }\n\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView(a)) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n const a_ = new Int8Array(a.buffer);\n const b_ = new Int8Array(b.buffer);\n return a_.every((value, i) => value === b_[i]);\n }\n\n return false;\n};\n","export function isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n return (\n (prototype === null ||\n prototype === Object.prototype ||\n Object.getPrototypeOf(prototype) === null) &&\n !(Symbol.toStringTag in value) &&\n !(Symbol.iterator in value)\n );\n}\n","import { isObject } from '@lib/helpers';\n\nexport function flatClone<T>(object: T): T {\n if (object instanceof Map) {\n return new Map(object) as any;\n }\n\n if (object instanceof Set) {\n return new Set(object) as any;\n }\n\n if (Array.isArray(object)) {\n return [...object] as any;\n }\n\n if (isObject(object)) {\n return { ...object };\n }\n\n return object;\n}\n","import { isObject } from '@lib/helpers';\nimport type { Update } from '../core/commonTypes';\nimport { flatClone } from './clone';\nimport type { KeyType, Path, Value } from './path';\n\nexport function castArrayPath(path: string | KeyType[]): KeyType[] {\n if (Array.isArray(path)) {\n return path;\n }\n\n if (path === '') {\n return [];\n }\n\n return (path as string).split('.');\n}\n\nexport function get<T, P extends Path<T>>(object: T, path: P): Value<T, P> {\n const _path = castArrayPath(path as any);\n const [first, ...rest] = _path;\n\n if (first === undefined || !object) {\n return object as Value<T, P>;\n }\n\n if (object instanceof Map) {\n return get(object.get(first), rest);\n }\n\n if (object instanceof Set) {\n return get(Array.from(object)[Number(first)], rest);\n }\n\n if (isObject(object)) {\n return get(object[first as keyof T], rest as any) as Value<T, P>;\n }\n\n throw new Error(`Could not get ${path} of ${object}`);\n}\n\nexport function set<T, P extends Path<T>>(\n object: T,\n path: P,\n value: Update<Value<T, P>>,\n rootPath = path,\n): T {\n const _path = castArrayPath(path as any);\n const [first, ...rest] = _path;\n\n if (first === undefined) {\n return value as any;\n }\n\n const updateChild = (child: any) => {\n if (!child && rest.length > 0) {\n const _rootPath = castArrayPath(rootPath as any);\n\n const prefix = _rootPath.slice(0, -rest.length);\n throw new Error(`Cannot set ${
|
|
1
|
+
{"version":3,"file":"propAccess.mjs","sources":["../../src/lib/equals.ts","../../src/lib/helpers.ts","../../src/lib/clone.ts","../../src/lib/propAccess.ts"],"sourcesContent":["export function strictEqual(a: any, b: any) {\n return a === b;\n}\n\nexport function shallowEqual(a: any, b: any): boolean {\n return internalEqual(strictEqual)(a, b);\n}\n\nexport function deepEqual(a: any, b: any): boolean {\n return internalEqual(deepEqual)(a, b);\n}\n\nconst internalEqual = (comp: (a: any, b: any) => boolean) => (a: any, b: any) => {\n if (a === b) {\n return true;\n }\n\n if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') {\n // eslint-disable-next-line no-self-compare\n return a !== a && b !== b;\n }\n\n if (a.constructor !== b.constructor) {\n return false;\n }\n\n if (a.constructor === Object || Array.isArray(a)) {\n const entries1 = Object.entries(a);\n const entries2 = Object.entries(b);\n return (\n entries1.length === entries2.length && entries1.every(([key, value]) => comp(value, b[key]))\n );\n }\n\n if (a instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (a instanceof RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n\n if (a instanceof Map) {\n return a.size === b.size && [...a.entries()].every(([key, value]) => comp(value, b.get(key)));\n }\n\n if (a instanceof Set) {\n return a.size === b.size && [...a.values()].every((value) => b.has(value));\n }\n\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView(a)) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n const a_ = new Int8Array(a.buffer);\n const b_ = new Int8Array(b.buffer);\n return a_.every((value, i) => value === b_[i]);\n }\n\n return false;\n};\n","export function isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n return (\n (prototype === null ||\n prototype === Object.prototype ||\n Object.getPrototypeOf(prototype) === null) &&\n !(Symbol.toStringTag in value) &&\n !(Symbol.iterator in value)\n );\n}\n","import { isObject } from '@lib/helpers';\n\nexport function flatClone<T>(object: T): T {\n if (object instanceof Map) {\n return new Map(object) as any;\n }\n\n if (object instanceof Set) {\n return new Set(object) as any;\n }\n\n if (Array.isArray(object)) {\n return [...object] as any;\n }\n\n if (isObject(object)) {\n return { ...object };\n }\n\n return object;\n}\n","import { isObject } from '@lib/helpers';\nimport type { Update } from '../core/commonTypes';\nimport { flatClone } from './clone';\nimport type { KeyType, Path, Value } from './path';\n\nexport function castArrayPath(path: string | KeyType[]): KeyType[] {\n if (Array.isArray(path)) {\n return path;\n }\n\n if (path === '') {\n return [];\n }\n\n return (path as string).split('.');\n}\n\nexport function get<T, P extends Path<T>>(object: T, path: P): Value<T, P> {\n const _path = castArrayPath(path as any);\n const [first, ...rest] = _path;\n\n if (first === undefined || !object) {\n return object as Value<T, P>;\n }\n\n if (object instanceof Map) {\n return get(object.get(first), rest);\n }\n\n if (object instanceof Set) {\n return get(Array.from(object)[Number(first)], rest);\n }\n\n if (isObject(object)) {\n return get(object[first as keyof T], rest as any) as Value<T, P>;\n }\n\n throw new Error(`Could not get ${path} of ${object}`);\n}\n\nexport function set<T, P extends Path<T>>(\n object: T,\n path: P,\n value: Update<Value<T, P>>,\n rootPath = path,\n): T {\n const _path = castArrayPath(path as any);\n const [first, ...rest] = _path;\n\n if (first === undefined) {\n return value as any;\n }\n\n const updateChild = (child: any) => {\n if (!child && rest.length > 0) {\n const _rootPath = castArrayPath(rootPath as any);\n\n const prefix = _rootPath.slice(0, -rest.length);\n throw new Error(`Cannot set ${_rootPath.join('.')} because ${prefix.join('.')} is ${child}`);\n }\n\n return set(child, rest as any, value, rootPath);\n };\n\n if (object instanceof Map) {\n const copy = flatClone(object);\n const child = copy.get(first);\n copy.set(first, updateChild(child));\n return copy;\n }\n\n if (object instanceof Set) {\n const copy = [...object];\n const child = copy[Number(first)];\n copy[Number(first)] = updateChild(child);\n return new Set(copy) as any;\n }\n\n if (isObject(object) || object === undefined) {\n const copy = flatClone(object ?? ({} as T));\n copy[first as keyof T] = updateChild(copy[first as keyof T]);\n return copy;\n }\n\n throw new Error(`Could not set ${path} of ${object}`);\n}\n\nexport function remove<T, P extends Path<T, true>>(object: T, path: P): T {\n const _path = castArrayPath(path as any);\n\n if (_path.length === 0) {\n return undefined as any;\n }\n\n const parentPath = _path.slice(0, -1);\n const key = _path[_path.length - 1];\n\n const parent = flatClone(get(object, parentPath as any));\n\n if (parent instanceof Map) {\n parent.delete(key);\n } else if (parent instanceof Set) {\n const value = Array.from(parent)[Number(key)];\n parent.delete(value);\n } else {\n delete parent[key as keyof typeof parent];\n }\n\n return set(object, parentPath as any, parent);\n}\n\nexport function join(a: string, b: string) {\n return [a, b].filter(Boolean).join('.');\n}\n"],"names":[],"mappings":"AAAgB,SAAA,YAAY,GAAQ,GAAQ;AAC1C,SAAO,MAAM;AACf;AAEgB,SAAA,aAAa,GAAQ,GAAiB;AACpD,SAAO,cAAc,WAAW,EAAE,GAAG,CAAC;AACxC;AAEgB,SAAA,UAAU,GAAQ,GAAiB;AACjD,SAAO,cAAc,SAAS,EAAE,GAAG,CAAC;AACtC;AAEA,MAAM,gBAAgB,CAAC,SAAsC,CAAC,GAAQ,MAAW;AAC/E,MAAI,MAAM,GAAG;AACJ,WAAA;AAAA,EACT;AAEI,MAAA,MAAM,QAAQ,MAAM,QAAQ,OAAO,MAAM,YAAY,OAAO,MAAM,UAAU;AAEvE,WAAA,MAAM,KAAK,MAAM;AAAA,EAC1B;AAEI,MAAA,EAAE,gBAAgB,EAAE,aAAa;AAC5B,WAAA;AAAA,EACT;AAEA,MAAI,EAAE,gBAAgB,UAAU,MAAM,QAAQ,CAAC,GAAG;AAC1C,UAAA,WAAW,OAAO,QAAQ,CAAC;AAC3B,UAAA,WAAW,OAAO,QAAQ,CAAC;AACjC,WACE,SAAS,WAAW,SAAS,UAAU,SAAS,MAAM,CAAC,CAAC,KAAK,KAAK,MAAM,KAAK,OAAO,EAAE,GAAG,CAAC,CAAC;AAAA,EAE/F;AAEA,MAAI,aAAa,MAAM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AEgB,SAAA,KAAK,GAAW,GAAW;AAClC,SAAA,CAAC,GAAG,CAAC,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AACxC;"}
|
package/dist/es/react/index.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import { useState, useEffect, createElement, useCallback, Fragment as Fragment$1
|
|
|
4
4
|
import { d as calcDuration, q as queue, g as debounce, a as autobind, c as createStore, t as throttle } from "../store.mjs";
|
|
5
5
|
import { h as hash } from "../hash.mjs";
|
|
6
6
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
7
|
-
import { c as castArrayPath, a as isObject, d as deepEqual, g as get, j as join } from "../propAccess.mjs";
|
|
8
7
|
import { c as connectUrl } from "../urlStore.mjs";
|
|
8
|
+
import { c as castArrayPath, a as isObject, d as deepEqual, g as get, j as join } from "../propAccess.mjs";
|
|
9
9
|
function CustomInput({ name, children, ...props }) {
|
|
10
10
|
return /* @__PURE__ */ jsxs(
|
|
11
11
|
"div",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as reactMethods, u as useCache, a as useScope, b as useScopeStore, c as useScopeProp, S as ScopeProvider } from "../useCache.mjs";
|
|
2
|
-
import { S as Store } from "../store.mjs";
|
|
3
1
|
import { C as Cache, S as Scope } from "../scope.mjs";
|
|
2
|
+
import { S as Store } from "../store.mjs";
|
|
3
|
+
import { r as reactMethods, u as useCache, a as useScope, b as useScopeStore, c as useScopeProp, S as ScopeProvider } from "../useCache.mjs";
|
|
4
4
|
const cacheMethods = {
|
|
5
5
|
useCache(options) {
|
|
6
6
|
return useCache(this, options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cross-state",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.7",
|
|
4
4
|
"description": "(React) state library",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "schummar/cross-state",
|
|
@@ -126,24 +126,24 @@
|
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
128
|
"devDependencies": {
|
|
129
|
-
"@emotion/styled": "11.11.
|
|
130
|
-
"@mantine/core": "7.
|
|
131
|
-
"@mui/material": "5.15.
|
|
129
|
+
"@emotion/styled": "11.11.5",
|
|
130
|
+
"@mantine/core": "7.7.1",
|
|
131
|
+
"@mui/material": "5.15.15",
|
|
132
132
|
"@schummar/eslint-config": "github:schummar/eslint-config",
|
|
133
133
|
"@schummar/prettier-config": "github:schummar/prettier-config",
|
|
134
134
|
"@schummar/runp": "2.0.2",
|
|
135
|
-
"@size-limit/preset-small-lib": "11.1.
|
|
136
|
-
"@testing-library/react": "14.2.
|
|
137
|
-
"@types/react": "18.2.
|
|
138
|
-
"@types/react-dom": "18.2.
|
|
135
|
+
"@size-limit/preset-small-lib": "11.1.2",
|
|
136
|
+
"@testing-library/react": "14.2.2",
|
|
137
|
+
"@types/react": "18.2.74",
|
|
138
|
+
"@types/react-dom": "18.2.24",
|
|
139
139
|
"@types/seedrandom": "3.0.8",
|
|
140
140
|
"@types/use-sync-external-store": "0.0.6",
|
|
141
141
|
"@types/ws": "8.5.10",
|
|
142
142
|
"@vitejs/plugin-react": "4.2.1",
|
|
143
|
-
"@vitest/coverage-v8": "1.
|
|
144
|
-
"esbuild": "0.20.
|
|
143
|
+
"@vitest/coverage-v8": "1.4.0",
|
|
144
|
+
"esbuild": "0.20.2",
|
|
145
145
|
"eslint": "8.57.0",
|
|
146
|
-
"happy-dom": "
|
|
146
|
+
"happy-dom": "14.5.1",
|
|
147
147
|
"jsdom": "24.0.0",
|
|
148
148
|
"mutative": "1.0.3",
|
|
149
149
|
"prettier": "3.2.5",
|
|
@@ -152,14 +152,14 @@
|
|
|
152
152
|
"react-dom": "18.2.0",
|
|
153
153
|
"rimraf": "5.0.5",
|
|
154
154
|
"seedrandom": "3.0.5",
|
|
155
|
-
"semantic-release": "23.0.
|
|
156
|
-
"size-limit": "11.1.
|
|
155
|
+
"semantic-release": "23.0.7",
|
|
156
|
+
"size-limit": "11.1.2",
|
|
157
157
|
"tsc-alias": "1.8.8",
|
|
158
|
-
"typescript": "5.4.
|
|
158
|
+
"typescript": "5.4.4",
|
|
159
159
|
"use-sync-external-store": "1.2.0",
|
|
160
|
-
"vite": "5.
|
|
160
|
+
"vite": "5.2.8",
|
|
161
161
|
"vite-tsconfig-paths": "4.3.2",
|
|
162
|
-
"vitest": "1.
|
|
162
|
+
"vitest": "1.4.0"
|
|
163
163
|
},
|
|
164
164
|
"volta": {
|
|
165
165
|
"node": "20.11.0",
|