@webiny/react-properties 6.4.4-beta.2 → 6.4.4-beta.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.
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import type { Property } from "./Properties.js";
3
+ interface AsyncPropertiesContextValue {
4
+ incrementPending(): void;
5
+ decrementPending(): void;
6
+ }
7
+ export declare function useAsyncProperties(): AsyncPropertiesContextValue | undefined;
8
+ interface AsyncPropertiesProps {
9
+ name?: string;
10
+ onChange?(properties: Property[]): void;
11
+ children: React.ReactNode;
12
+ }
13
+ export declare const AsyncProperties: ({ name, onChange, children }: AsyncPropertiesProps) => React.JSX.Element;
14
+ export {};
@@ -0,0 +1,43 @@
1
+ import react, { createContext, useCallback, useContext, useRef } from "react";
2
+ import { Properties, useProperties } from "./Properties.js";
3
+ const AsyncPropertiesContext = /*#__PURE__*/ createContext(void 0);
4
+ function useAsyncProperties() {
5
+ return useContext(AsyncPropertiesContext);
6
+ }
7
+ const StoreCapture = ({ storeRef, children })=>{
8
+ const { store } = useProperties();
9
+ storeRef.current = store;
10
+ return /*#__PURE__*/ react.createElement(react.Fragment, null, children);
11
+ };
12
+ const AsyncProperties = ({ name, onChange, children })=>{
13
+ const pendingRef = useRef(0);
14
+ const onChangeRef = useRef(onChange);
15
+ onChangeRef.current = onChange;
16
+ const storeRef = useRef(null);
17
+ const interceptedOnChange = useCallback((properties)=>{
18
+ if (pendingRef.current > 0) return;
19
+ onChangeRef.current?.(properties);
20
+ }, []);
21
+ const contextValue = useRef({
22
+ incrementPending () {
23
+ pendingRef.current++;
24
+ },
25
+ decrementPending () {
26
+ pendingRef.current = Math.max(0, pendingRef.current - 1);
27
+ if (0 === pendingRef.current) setTimeout(()=>{
28
+ if (0 === pendingRef.current && storeRef.current) storeRef.current.notify();
29
+ }, 0);
30
+ }
31
+ }).current;
32
+ return /*#__PURE__*/ react.createElement(AsyncPropertiesContext.Provider, {
33
+ value: contextValue
34
+ }, /*#__PURE__*/ react.createElement(Properties, {
35
+ name: name,
36
+ onChange: interceptedOnChange
37
+ }, /*#__PURE__*/ react.createElement(StoreCapture, {
38
+ storeRef: storeRef
39
+ }, children)));
40
+ };
41
+ export { AsyncProperties, useAsyncProperties };
42
+
43
+ //# sourceMappingURL=AsyncProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsyncProperties.js","sources":["../src/AsyncProperties.tsx"],"sourcesContent":["import React, { createContext, useCallback, useContext, useRef } from \"react\";\nimport { Properties, useProperties } from \"./Properties.js\";\nimport type { Property } from \"./Properties.js\";\nimport type { PropertyStore } from \"./domain/index.js\";\n\ninterface AsyncPropertiesContextValue {\n incrementPending(): void;\n decrementPending(): void;\n}\n\nconst AsyncPropertiesContext = createContext<AsyncPropertiesContextValue | undefined>(undefined);\n\nexport function useAsyncProperties() {\n return useContext(AsyncPropertiesContext);\n}\n\ninterface AsyncPropertiesProps {\n name?: string;\n onChange?(properties: Property[]): void;\n children: React.ReactNode;\n}\n\nconst StoreCapture = ({\n storeRef,\n children\n}: {\n storeRef: React.MutableRefObject<PropertyStore | null>;\n children: React.ReactNode;\n}) => {\n const { store } = useProperties();\n storeRef.current = store;\n return <>{children}</>;\n};\n\nexport const AsyncProperties = ({ name, onChange, children }: AsyncPropertiesProps) => {\n const pendingRef = useRef(0);\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n const storeRef = useRef<PropertyStore | null>(null);\n\n const interceptedOnChange = useCallback((properties: Property[]) => {\n if (pendingRef.current > 0) {\n return;\n }\n onChangeRef.current?.(properties);\n }, []);\n\n const contextValue = useRef<AsyncPropertiesContextValue>({\n incrementPending() {\n pendingRef.current++;\n },\n decrementPending() {\n pendingRef.current = Math.max(0, pendingRef.current - 1);\n if (pendingRef.current === 0) {\n setTimeout(() => {\n if (pendingRef.current === 0 && storeRef.current) {\n storeRef.current.notify();\n }\n }, 0);\n }\n }\n }).current;\n\n return (\n <AsyncPropertiesContext.Provider value={contextValue}>\n <Properties name={name} onChange={interceptedOnChange}>\n <StoreCapture storeRef={storeRef}>{children}</StoreCapture>\n </Properties>\n </AsyncPropertiesContext.Provider>\n );\n};\n"],"names":["AsyncPropertiesContext","createContext","undefined","useAsyncProperties","useContext","StoreCapture","storeRef","children","store","useProperties","AsyncProperties","name","onChange","pendingRef","useRef","onChangeRef","interceptedOnChange","useCallback","properties","contextValue","Math","setTimeout","Properties"],"mappings":";;AAUA,MAAMA,yBAAyB,WAAHA,GAAGC,cAAuDC;AAE/E,SAASC;IACZ,OAAOC,WAAWJ;AACtB;AAQA,MAAMK,eAAe,CAAC,EAClBC,QAAQ,EACRC,QAAQ,EAIX;IACG,MAAM,EAAEC,KAAK,EAAE,GAAGC;IAClBH,SAAS,OAAO,GAAGE;IACnB,OAAO,WAAP,GAAO,0CAAGD;AACd;AAEO,MAAMG,kBAAkB,CAAC,EAAEC,IAAI,EAAEC,QAAQ,EAAEL,QAAQ,EAAwB;IAC9E,MAAMM,aAAaC,OAAO;IAC1B,MAAMC,cAAcD,OAAOF;IAC3BG,YAAY,OAAO,GAAGH;IACtB,MAAMN,WAAWQ,OAA6B;IAE9C,MAAME,sBAAsBC,YAAY,CAACC;QACrC,IAAIL,WAAW,OAAO,GAAG,GACrB;QAEJE,YAAY,OAAO,GAAGG;IAC1B,GAAG,EAAE;IAEL,MAAMC,eAAeL,OAAoC;QACrD;YACID,WAAW,OAAO;QACtB;QACA;YACIA,WAAW,OAAO,GAAGO,KAAK,GAAG,CAAC,GAAGP,WAAW,OAAO,GAAG;YACtD,IAAIA,AAAuB,MAAvBA,WAAW,OAAO,EAClBQ,WAAW;gBACP,IAAIR,AAAuB,MAAvBA,WAAW,OAAO,IAAUP,SAAS,OAAO,EAC5CA,SAAS,OAAO,CAAC,MAAM;YAE/B,GAAG;QAEX;IACJ,GAAG,OAAO;IAEV,OAAO,WAAP,GACI,oBAACN,uBAAuB,QAAQ;QAAC,OAAOmB;qBACpC,oBAACG,YAAUA;QAAC,MAAMX;QAAM,UAAUK;qBAC9B,oBAACX,cAAYA;QAAC,UAAUC;OAAWC;AAInD"}
package/Await.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface AwaitProps<T> {
3
+ fn: () => Promise<T>;
4
+ children: (value: T) => React.ReactNode;
5
+ }
6
+ export declare function Await<T>({ fn, children }: AwaitProps<T>): React.JSX.Element | null;
7
+ export {};
package/Await.js ADDED
@@ -0,0 +1,44 @@
1
+ import react, { useEffect, useRef, useState } from "react";
2
+ import { useAsyncProperties } from "./AsyncProperties.js";
3
+ function Await({ fn, children }) {
4
+ const async = useAsyncProperties();
5
+ const [result, setResult] = useState(null);
6
+ const registeredRef = useRef(false);
7
+ const settledRef = useRef(false);
8
+ if (!registeredRef.current && async) {
9
+ registeredRef.current = true;
10
+ async.incrementPending();
11
+ }
12
+ useEffect(()=>{
13
+ let cancelled = false;
14
+ fn().then((data)=>{
15
+ if (!cancelled) {
16
+ settledRef.current = true;
17
+ setResult({
18
+ data
19
+ });
20
+ }
21
+ }, (error)=>{
22
+ if (!cancelled) {
23
+ settledRef.current = true;
24
+ setResult({
25
+ error
26
+ });
27
+ }
28
+ });
29
+ return ()=>{
30
+ cancelled = true;
31
+ if (!settledRef.current && async) async.decrementPending();
32
+ };
33
+ }, []);
34
+ useEffect(()=>{
35
+ if (null !== result && async) async.decrementPending();
36
+ }, [
37
+ result
38
+ ]);
39
+ if (result && "data" in result) return /*#__PURE__*/ react.createElement(react.Fragment, null, children(result.data));
40
+ return null;
41
+ }
42
+ export { Await };
43
+
44
+ //# sourceMappingURL=Await.js.map
package/Await.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Await.js","sources":["../src/Await.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport { useAsyncProperties } from \"./AsyncProperties.js\";\n\ninterface AwaitProps<T> {\n fn: () => Promise<T>;\n children: (value: T) => React.ReactNode;\n}\n\nexport function Await<T>({ fn, children }: AwaitProps<T>) {\n const async = useAsyncProperties();\n const [result, setResult] = useState<{ data: T } | { error: unknown } | null>(null);\n const registeredRef = useRef(false);\n const settledRef = useRef(false);\n\n if (!registeredRef.current && async) {\n registeredRef.current = true;\n async.incrementPending();\n }\n\n useEffect(() => {\n let cancelled = false;\n\n fn().then(\n data => {\n if (!cancelled) {\n settledRef.current = true;\n setResult({ data });\n }\n },\n error => {\n if (!cancelled) {\n settledRef.current = true;\n setResult({ error });\n }\n }\n );\n\n return () => {\n cancelled = true;\n if (!settledRef.current && async) {\n async.decrementPending();\n }\n };\n }, []);\n\n useEffect(() => {\n if (result !== null && async) {\n async.decrementPending();\n }\n }, [result]);\n\n if (result && \"data\" in result) {\n return <>{children(result.data)}</>;\n }\n\n return null;\n}\n"],"names":["Await","fn","children","async","useAsyncProperties","result","setResult","useState","registeredRef","useRef","settledRef","useEffect","cancelled","data","error"],"mappings":";;AAQO,SAASA,MAAS,EAAEC,EAAE,EAAEC,QAAQ,EAAiB;IACpD,MAAMC,QAAQC;IACd,MAAM,CAACC,QAAQC,UAAU,GAAGC,SAAkD;IAC9E,MAAMC,gBAAgBC,OAAO;IAC7B,MAAMC,aAAaD,OAAO;IAE1B,IAAI,CAACD,cAAc,OAAO,IAAIL,OAAO;QACjCK,cAAc,OAAO,GAAG;QACxBL,MAAM,gBAAgB;IAC1B;IAEAQ,UAAU;QACN,IAAIC,YAAY;QAEhBX,KAAK,IAAI,CACLY,CAAAA;YACI,IAAI,CAACD,WAAW;gBACZF,WAAW,OAAO,GAAG;gBACrBJ,UAAU;oBAAEO;gBAAK;YACrB;QACJ,GACAC,CAAAA;YACI,IAAI,CAACF,WAAW;gBACZF,WAAW,OAAO,GAAG;gBACrBJ,UAAU;oBAAEQ;gBAAM;YACtB;QACJ;QAGJ,OAAO;YACHF,YAAY;YACZ,IAAI,CAACF,WAAW,OAAO,IAAIP,OACvBA,MAAM,gBAAgB;QAE9B;IACJ,GAAG,EAAE;IAELQ,UAAU;QACN,IAAIN,AAAW,SAAXA,UAAmBF,OACnBA,MAAM,gBAAgB;IAE9B,GAAG;QAACE;KAAO;IAEX,IAAIA,UAAU,UAAUA,QACpB,OAAO,WAAP,GAAO,0CAAGH,SAASG,OAAO,IAAI;IAGlC,OAAO;AACX"}
@@ -19,6 +19,7 @@ export declare class PropertyStore {
19
19
  */
20
20
  private lookup;
21
21
  private scheduleFlush;
22
+ notify(): void;
22
23
  get allProperties(): Property[];
23
24
  subscribe(listener: Listener): () => void;
24
25
  /**
@@ -1,5 +1,13 @@
1
1
  import debounce from "lodash/debounce.js";
2
2
  class PropertyStore {
3
+ notify() {
4
+ this.scheduleFlush.cancel();
5
+ if (this.queue.length > 0) this.processQueue();
6
+ else {
7
+ const properties = this.allProperties;
8
+ for (const listener of this.listeners)listener(properties);
9
+ }
10
+ }
3
11
  get allProperties() {
4
12
  return this.order.filter((id)=>this.map.has(id)).map((id)=>this.map.get(id));
5
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"domain/PropertyStore.js","sources":["../../src/domain/PropertyStore.ts"],"sourcesContent":["import debounce from \"lodash/debounce.js\";\nimport type { Property } from \"../Properties.js\";\n\ninterface AddPropertyOptions {\n after?: string;\n before?: string;\n priority?: number;\n}\n\ntype Operation =\n | { type: \"add\"; property: Property; options: AddPropertyOptions }\n | { type: \"remove\"; id: string }\n | { type: \"replace\"; oldId: string; newProperty: Property };\n\ntype Listener = (properties: Property[]) => void;\n\nexport class PropertyStore {\n private map = new Map<string, Property>();\n private order: string[] = [];\n private queue: Operation[] = [];\n private listeners = new Set<Listener>();\n private priorities = new Map<string, number>();\n /** Properties that were explicitly positioned via before/after. */\n private positioned = new Set<string>();\n\n /**\n * Synchronous lookup map — written immediately on addProperty (before debounce),\n * so useAncestor can find properties during render.\n */\n private lookup = new Map<string, Property>();\n\n private scheduleFlush = debounce(() => {\n this.processQueue();\n }, 0);\n\n get allProperties(): Property[] {\n return this.order.filter(id => this.map.has(id)).map(id => this.map.get(id)!);\n }\n\n subscribe(listener: Listener): () => void {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n /**\n * Returns properties that are children of the given parent ID.\n * Reads from the synchronous lookup map, so it works during render\n * before the debounced queue has flushed.\n */\n getChildrenOf(parentId: string): Property[] {\n return Array.from(this.lookup.values()).filter(p => p.parent === parentId);\n }\n\n /**\n * Find a property by ID from the synchronous lookup map.\n */\n getById(id: string): Property | undefined {\n return this.lookup.get(id);\n }\n\n /**\n * Register a property in the synchronous lookup map during render,\n * so useAncestor can find it before the debounced queue flushes.\n */\n registerLookup(property: Property): void {\n if (this.lookup.has(property.id)) {\n const existing = this.lookup.get(property.id)!;\n this.lookup.set(property.id, { ...existing, ...property });\n } else {\n this.lookup.set(property.id, property);\n }\n }\n\n addProperty(property: Property, options: AddPropertyOptions = {}): void {\n this.registerLookup(property);\n this.queue.push({ type: \"add\", property, options });\n this.scheduleFlush();\n }\n\n removeProperty(id: string): void {\n this.lookup.delete(id);\n this.queue.push({ type: \"remove\", id });\n this.scheduleFlush();\n }\n\n replaceProperty(oldId: string, newProperty: Property): void {\n this.lookup.delete(oldId);\n this.lookup.set(newProperty.id, newProperty);\n this.queue.push({ type: \"replace\", oldId, newProperty });\n this.scheduleFlush();\n }\n\n private processQueue(): void {\n if (this.queue.length === 0) {\n return;\n }\n\n const ops = this.queue.splice(0);\n\n // Stable-sort operations so that \"add\" ops with lower priority numbers\n // are processed first. Non-add operations and adds with default priority (0)\n // keep their original order.\n ops.sort((a, b) => {\n const pa = a.type === \"add\" ? (a.options.priority ?? 0) : 0;\n const pb = b.type === \"add\" ? (b.options.priority ?? 0) : 0;\n return pa - pb;\n });\n\n for (const op of ops) {\n switch (op.type) {\n case \"add\":\n this.executeAdd(op.property, op.options);\n break;\n case \"remove\":\n this.executeRemove(op.id);\n break;\n case \"replace\":\n this.executeReplace(op.oldId, op.newProperty);\n break;\n }\n }\n\n // Stable-sort the order array by priority, but only for properties\n // that were NOT explicitly positioned via before/after. Explicitly\n // positioned properties keep their placement.\n this.order.sort((a, b) => {\n if (this.positioned.has(a) || this.positioned.has(b)) {\n return 0;\n }\n return (this.priorities.get(a) ?? 0) - (this.priorities.get(b) ?? 0);\n });\n\n const properties = this.allProperties;\n for (const listener of this.listeners) {\n listener(properties);\n }\n }\n\n private executeAdd(property: Property, options: AddPropertyOptions): void {\n if (options.after || options.before) {\n this.positioned.add(property.id);\n }\n\n const exists = this.map.has(property.id);\n\n if (exists) {\n // Merge into existing property. Keep the original priority so\n // that a secondary config overriding a primary property doesn't\n // cause the re-sort to move it after all primary properties.\n const existing = this.map.get(property.id)!;\n this.map.set(property.id, { ...existing, ...property });\n\n if (options.after) {\n this.reposition(property.id, options.after, \"after\");\n } else if (options.before) {\n this.reposition(property.id, options.before, \"before\");\n }\n return;\n }\n\n this.map.set(property.id, property);\n // Set priority only for new properties — not merges (handled above).\n this.priorities.set(property.id, options.priority ?? 0);\n\n if (options.after) {\n this.insertAfter(property.id, options.after);\n } else if (options.before) {\n this.insertBefore(property.id, options.before);\n } else {\n this.order.push(property.id);\n }\n }\n\n private executeRemove(id: string): void {\n if (!this.map.has(id)) {\n return;\n }\n this.map.delete(id);\n this.priorities.delete(id);\n this.positioned.delete(id);\n this.order = this.order.filter(oid => oid !== id);\n // Note: we intentionally do NOT call removeDescendants here.\n // React's component lifecycle ensures that when a parent Property\n // unmounts, all child Properties unmount too — each triggering its\n // own removeProperty call. Calling removeDescendants would wipe\n // children that belong to OTHER still-mounted configs sharing the\n // same parent ID (e.g., id=\"pageSettings\" used by both primary\n // and secondary configs).\n }\n\n private executeReplace(oldId: string, newProperty: Property): void {\n const idx = this.order.indexOf(oldId);\n if (idx === -1) {\n return;\n }\n\n this.map.delete(oldId);\n this.map.set(newProperty.id, newProperty);\n this.order[idx] = newProperty.id;\n this.removeDescendants(oldId);\n }\n\n private insertBefore(id: string, before: string): void {\n if (before.endsWith(\"$first\")) {\n this.order.unshift(id);\n return;\n }\n const targetIdx = this.order.indexOf(before);\n if (targetIdx === -1) {\n this.order.push(id);\n return;\n }\n this.order.splice(targetIdx, 0, id);\n }\n\n private insertAfter(id: string, after: string): void {\n if (after.endsWith(\"$last\")) {\n this.order.push(id);\n return;\n }\n const targetIdx = this.order.indexOf(after);\n if (targetIdx === -1) {\n this.order.push(id);\n return;\n }\n this.order.splice(targetIdx + 1, 0, id);\n }\n\n private reposition(id: string, targetId: string, position: \"before\" | \"after\"): void {\n this.order = this.order.filter(oid => oid !== id);\n\n if (position === \"before\") {\n this.insertBefore(id, targetId);\n } else {\n this.insertAfter(id, targetId);\n }\n }\n\n private removeDescendants(parentId: string): void {\n const children = Array.from(this.map.values()).filter(p => p.parent === parentId);\n for (const child of children) {\n this.map.delete(child.id);\n this.order = this.order.filter(oid => oid !== child.id);\n this.removeDescendants(child.id);\n }\n }\n}\n"],"names":["PropertyStore","id","listener","parentId","Array","p","property","existing","options","oldId","newProperty","ops","a","b","pa","pb","op","properties","exists","oid","idx","before","targetIdx","after","targetId","position","children","child","Map","Set","debounce"],"mappings":";AAgBO,MAAMA;IAmBT,IAAI,gBAA4B;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAACC,CAAAA,KAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAACA,KAAK,GAAG,CAACA,CAAAA,KAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAACA;IAC5E;IAEA,UAAUC,QAAkB,EAAc;QACtC,IAAI,CAAC,SAAS,CAAC,GAAG,CAACA;QACnB,OAAO;YACH,IAAI,CAAC,SAAS,CAAC,MAAM,CAACA;QAC1B;IACJ;IAOA,cAAcC,QAAgB,EAAc;QACxC,OAAOC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAACC,CAAAA,IAAKA,EAAE,MAAM,KAAKF;IACrE;IAKA,QAAQF,EAAU,EAAwB;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAACA;IAC3B;IAMA,eAAeK,QAAkB,EAAQ;QACrC,IAAI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GAAG,IAAIC;aACV,KAAK,GAAa,EAAE;aACpB,KAAK,GAAgB,EAAE;aACvB,SAAS,GAAG,IAAIC;aAChB,UAAU,GAAG,IAAID;QACwC,KACzD,UAAU,GAAG,IAAIC;QAKxB,KACO,MAAM,GAAG,IAAID;aAEb,aAAa,GAAGE,SAAS;YAC7B,IAAI,CAAC,YAAY;QACrB,GAAG;;AAuNP"}
1
+ {"version":3,"file":"domain/PropertyStore.js","sources":["../../src/domain/PropertyStore.ts"],"sourcesContent":["import debounce from \"lodash/debounce.js\";\nimport type { Property } from \"../Properties.js\";\n\ninterface AddPropertyOptions {\n after?: string;\n before?: string;\n priority?: number;\n}\n\ntype Operation =\n | { type: \"add\"; property: Property; options: AddPropertyOptions }\n | { type: \"remove\"; id: string }\n | { type: \"replace\"; oldId: string; newProperty: Property };\n\ntype Listener = (properties: Property[]) => void;\n\nexport class PropertyStore {\n private map = new Map<string, Property>();\n private order: string[] = [];\n private queue: Operation[] = [];\n private listeners = new Set<Listener>();\n private priorities = new Map<string, number>();\n /** Properties that were explicitly positioned via before/after. */\n private positioned = new Set<string>();\n\n /**\n * Synchronous lookup map — written immediately on addProperty (before debounce),\n * so useAncestor can find properties during render.\n */\n private lookup = new Map<string, Property>();\n\n private scheduleFlush = debounce(() => {\n this.processQueue();\n }, 0);\n\n notify(): void {\n this.scheduleFlush.cancel();\n if (this.queue.length > 0) {\n this.processQueue();\n } else {\n const properties = this.allProperties;\n for (const listener of this.listeners) {\n listener(properties);\n }\n }\n }\n\n get allProperties(): Property[] {\n return this.order.filter(id => this.map.has(id)).map(id => this.map.get(id)!);\n }\n\n subscribe(listener: Listener): () => void {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n /**\n * Returns properties that are children of the given parent ID.\n * Reads from the synchronous lookup map, so it works during render\n * before the debounced queue has flushed.\n */\n getChildrenOf(parentId: string): Property[] {\n return Array.from(this.lookup.values()).filter(p => p.parent === parentId);\n }\n\n /**\n * Find a property by ID from the synchronous lookup map.\n */\n getById(id: string): Property | undefined {\n return this.lookup.get(id);\n }\n\n /**\n * Register a property in the synchronous lookup map during render,\n * so useAncestor can find it before the debounced queue flushes.\n */\n registerLookup(property: Property): void {\n if (this.lookup.has(property.id)) {\n const existing = this.lookup.get(property.id)!;\n this.lookup.set(property.id, { ...existing, ...property });\n } else {\n this.lookup.set(property.id, property);\n }\n }\n\n addProperty(property: Property, options: AddPropertyOptions = {}): void {\n this.registerLookup(property);\n this.queue.push({ type: \"add\", property, options });\n this.scheduleFlush();\n }\n\n removeProperty(id: string): void {\n this.lookup.delete(id);\n this.queue.push({ type: \"remove\", id });\n this.scheduleFlush();\n }\n\n replaceProperty(oldId: string, newProperty: Property): void {\n this.lookup.delete(oldId);\n this.lookup.set(newProperty.id, newProperty);\n this.queue.push({ type: \"replace\", oldId, newProperty });\n this.scheduleFlush();\n }\n\n private processQueue(): void {\n if (this.queue.length === 0) {\n return;\n }\n\n const ops = this.queue.splice(0);\n\n // Stable-sort operations so that \"add\" ops with lower priority numbers\n // are processed first. Non-add operations and adds with default priority (0)\n // keep their original order.\n ops.sort((a, b) => {\n const pa = a.type === \"add\" ? (a.options.priority ?? 0) : 0;\n const pb = b.type === \"add\" ? (b.options.priority ?? 0) : 0;\n return pa - pb;\n });\n\n for (const op of ops) {\n switch (op.type) {\n case \"add\":\n this.executeAdd(op.property, op.options);\n break;\n case \"remove\":\n this.executeRemove(op.id);\n break;\n case \"replace\":\n this.executeReplace(op.oldId, op.newProperty);\n break;\n }\n }\n\n // Stable-sort the order array by priority, but only for properties\n // that were NOT explicitly positioned via before/after. Explicitly\n // positioned properties keep their placement.\n this.order.sort((a, b) => {\n if (this.positioned.has(a) || this.positioned.has(b)) {\n return 0;\n }\n return (this.priorities.get(a) ?? 0) - (this.priorities.get(b) ?? 0);\n });\n\n const properties = this.allProperties;\n for (const listener of this.listeners) {\n listener(properties);\n }\n }\n\n private executeAdd(property: Property, options: AddPropertyOptions): void {\n if (options.after || options.before) {\n this.positioned.add(property.id);\n }\n\n const exists = this.map.has(property.id);\n\n if (exists) {\n // Merge into existing property. Keep the original priority so\n // that a secondary config overriding a primary property doesn't\n // cause the re-sort to move it after all primary properties.\n const existing = this.map.get(property.id)!;\n this.map.set(property.id, { ...existing, ...property });\n\n if (options.after) {\n this.reposition(property.id, options.after, \"after\");\n } else if (options.before) {\n this.reposition(property.id, options.before, \"before\");\n }\n return;\n }\n\n this.map.set(property.id, property);\n // Set priority only for new properties — not merges (handled above).\n this.priorities.set(property.id, options.priority ?? 0);\n\n if (options.after) {\n this.insertAfter(property.id, options.after);\n } else if (options.before) {\n this.insertBefore(property.id, options.before);\n } else {\n this.order.push(property.id);\n }\n }\n\n private executeRemove(id: string): void {\n if (!this.map.has(id)) {\n return;\n }\n this.map.delete(id);\n this.priorities.delete(id);\n this.positioned.delete(id);\n this.order = this.order.filter(oid => oid !== id);\n // Note: we intentionally do NOT call removeDescendants here.\n // React's component lifecycle ensures that when a parent Property\n // unmounts, all child Properties unmount too — each triggering its\n // own removeProperty call. Calling removeDescendants would wipe\n // children that belong to OTHER still-mounted configs sharing the\n // same parent ID (e.g., id=\"pageSettings\" used by both primary\n // and secondary configs).\n }\n\n private executeReplace(oldId: string, newProperty: Property): void {\n const idx = this.order.indexOf(oldId);\n if (idx === -1) {\n return;\n }\n\n this.map.delete(oldId);\n this.map.set(newProperty.id, newProperty);\n this.order[idx] = newProperty.id;\n this.removeDescendants(oldId);\n }\n\n private insertBefore(id: string, before: string): void {\n if (before.endsWith(\"$first\")) {\n this.order.unshift(id);\n return;\n }\n const targetIdx = this.order.indexOf(before);\n if (targetIdx === -1) {\n this.order.push(id);\n return;\n }\n this.order.splice(targetIdx, 0, id);\n }\n\n private insertAfter(id: string, after: string): void {\n if (after.endsWith(\"$last\")) {\n this.order.push(id);\n return;\n }\n const targetIdx = this.order.indexOf(after);\n if (targetIdx === -1) {\n this.order.push(id);\n return;\n }\n this.order.splice(targetIdx + 1, 0, id);\n }\n\n private reposition(id: string, targetId: string, position: \"before\" | \"after\"): void {\n this.order = this.order.filter(oid => oid !== id);\n\n if (position === \"before\") {\n this.insertBefore(id, targetId);\n } else {\n this.insertAfter(id, targetId);\n }\n }\n\n private removeDescendants(parentId: string): void {\n const children = Array.from(this.map.values()).filter(p => p.parent === parentId);\n for (const child of children) {\n this.map.delete(child.id);\n this.order = this.order.filter(oid => oid !== child.id);\n this.removeDescendants(child.id);\n }\n }\n}\n"],"names":["PropertyStore","properties","listener","id","parentId","Array","p","property","existing","options","oldId","newProperty","ops","a","b","pa","pb","op","exists","oid","idx","before","targetIdx","after","targetId","position","children","child","Map","Set","debounce"],"mappings":";AAgBO,MAAMA;IAmBT,SAAe;QACX,IAAI,CAAC,aAAa,CAAC,MAAM;QACzB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GACpB,IAAI,CAAC,YAAY;aACd;YACH,MAAMC,aAAa,IAAI,CAAC,aAAa;YACrC,KAAK,MAAMC,YAAY,IAAI,CAAC,SAAS,CACjCA,SAASD;QAEjB;IACJ;IAEA,IAAI,gBAA4B;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAACE,CAAAA,KAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAACA,KAAK,GAAG,CAACA,CAAAA,KAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAACA;IAC5E;IAEA,UAAUD,QAAkB,EAAc;QACtC,IAAI,CAAC,SAAS,CAAC,GAAG,CAACA;QACnB,OAAO;YACH,IAAI,CAAC,SAAS,CAAC,MAAM,CAACA;QAC1B;IACJ;IAOA,cAAcE,QAAgB,EAAc;QACxC,OAAOC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAACC,CAAAA,IAAKA,EAAE,MAAM,KAAKF;IACrE;IAKA,QAAQD,EAAU,EAAwB;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAACA;IAC3B;IAMA,eAAeI,QAAkB,EAAQ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Q,GAAG,GAAG,IAAIC;aACV,KAAK,GAAa,EAAE;aACpB,KAAK,GAAgB,EAAE;aACvB,SAAS,GAAG,IAAIC;aAChB,UAAU,GAAG,IAAID;QACwC,KACzD,UAAU,GAAG,IAAIC;QAKxB,KACO,MAAM,GAAG,IAAID;aAEb,aAAa,GAAGE,SAAS;YAC7B,IAAI,CAAC,YAAY;QACrB,GAAG;;AAmOP"}
package/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export * from "./utils.js";
2
2
  export * from "./Properties.js";
3
+ export * from "./AsyncProperties.js";
4
+ export * from "./Await.js";
3
5
  export * from "./useDebugConfig.js";
4
6
  export * from "./useIdGenerator.js";
5
7
  export * from "./createConfigurableComponent.js";
package/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  export * from "./utils.js";
2
2
  export * from "./Properties.js";
3
+ export * from "./AsyncProperties.js";
4
+ export * from "./Await.js";
3
5
  export * from "./useDebugConfig.js";
4
6
  export * from "./useIdGenerator.js";
5
7
  export * from "./createConfigurableComponent.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/react-properties",
3
- "version": "6.4.4-beta.2",
3
+ "version": "6.4.4-beta.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -15,14 +15,14 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@types/react": "18.3.29",
18
- "@webiny/react-composition": "6.4.4-beta.2",
18
+ "@webiny/react-composition": "6.4.4-beta.4",
19
19
  "lodash": "4.18.1",
20
20
  "nanoid": "5.1.11",
21
21
  "react": "18.3.1"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@testing-library/react": "16.3.2",
25
- "@webiny/build-tools": "6.4.4-beta.2",
25
+ "@webiny/build-tools": "6.4.4-beta.4",
26
26
  "oxfmt": "0.51.0",
27
27
  "vitest": "4.1.8"
28
28
  },