assign-gingerly 0.0.65 → 0.0.66

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.
@@ -250,8 +250,21 @@ export type IEnhancementRegistryItem<T = any> = EnhancementConfig<T>;
250
250
  export interface IAssignGingerlyOptions {
251
251
  registry?: typeof EnhancementRegistry | EnhancementRegistry;
252
252
  bypassChecks?: boolean;
253
+ /**
254
+ * Method names to call during path evaluation (e.g., for `?.method()` calls)
255
+ */
253
256
  withMethods?: string[] | Set<string>;
257
+ /**
258
+ * Alias mappings for property and method names.
259
+ */
254
260
  aka?: Record<string, string>;
261
+
262
+ /**
263
+ * Shorthand for binding method aliases from the source object.
264
+ * Each entry maps an alias to a method name and is normalized into
265
+ * the existing withMethods + aka behavior.
266
+ */
267
+ akaMethods?: Record<string, string>;
255
268
 
256
269
  /**
257
270
  * AbortSignal for cleaning up reactive subscriptions (@eachTime)
@@ -838,3 +851,48 @@ export declare class LazyLoadHandler implements AssignFromHandler {
838
851
  assign(lhsTarget: any, resolvedParams: Record<string, any>, options?: any): Promise<void>;
839
852
  protected onCloneInserted(nodes: Node[], lhsTarget: Element, resolvedParams: Record<string, any>): Promise<void>;
840
853
  }
854
+
855
+ //#region Event Handler
856
+
857
+ export interface AssignDispatchVector {
858
+ toTarget?: Record<string, any>,
859
+ toHost?: Record<string, any>,
860
+ toLHS?: Record<string, any>,
861
+ withOptions?: AssignFromOptions,
862
+ toTargetOptions?: AssignFromOptions,
863
+ toHostOptions?: AssignFromOptions,
864
+ toLHSOptions?: AssignFromOptions,
865
+ dispatch?: DispatchEventConfig
866
+ }
867
+
868
+ export interface DispatchEventConfig{
869
+ type?: string,
870
+ eventCtr?: string | typeof Event | typeof CustomEvent,
871
+ detail?: any,
872
+ bubbles?: boolean,
873
+ cancelable?: boolean,
874
+ composed?: boolean
875
+ }
876
+
877
+
878
+ export interface AddEventListenerConfig extends AssignDispatchVector {
879
+ on: string,
880
+ get?: {
881
+ abortController?: string | AbortController,
882
+
883
+ nudge?: boolean,
884
+ options?: AddEventListenerOptions,
885
+ //make this part of dispatch?
886
+ stopPropagation?: boolean,
887
+ preventDefault?: boolean
888
+ dispatch?: DispatchEventConfig
889
+ },
890
+
891
+ fromLHS?: AssignDispatchVector,
892
+ fromHost?: AssignDispatchVector,
893
+ fromEvent?: AssignDispatchVector,
894
+ fromTarget?: AssignDispatchVector,
895
+
896
+
897
+ }
898
+ //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assign-gingerly",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
4
4
  "description": "This package provides a utility function for carefully merging one object into another.",
5
5
  "homepage": "https://github.com/bahrus/assign-gingerly#readme",
6
6
  "bugs": {
@@ -158,9 +158,9 @@
158
158
  "default": "./assignFromAsync-extension.js",
159
159
  "types": "./assignFromAsync-extension.ts"
160
160
  },
161
- "./builtInEmoji.js": {
162
- "default": "./builtInEmoji.js",
163
- "types": "./builtInEmoji.ts"
161
+ "./emojis.js": {
162
+ "default": "./emojis.js",
163
+ "types": "./emojis.ts"
164
164
  },
165
165
  "./assignFeatures.js": {
166
166
  "default": "./assignFeatures.js",
@@ -745,11 +745,11 @@ export interface LazyLoadResolvedParams {
745
745
  * Used for SSR placeholder content (e.g., "Loading..." text) that disappears once real content loads. */
746
746
  placeholder?: string;
747
747
  /** Assignment config applied to cloned content before insertion.
748
- * Same shape as manageTemplateList's fromEachItem: { assignToFragment, withOptions } or { configs: [...] } */
748
+ * Same shape as manageTemplateList's fromEachItem: { toClone, withOptions } or { configs: [...] } */
749
749
  assign?: {
750
- assignToFragment?: Record<string, any>;
750
+ toClone?: Record<string, any>;
751
751
  withOptions?: Record<string, any>;
752
- configs?: Array<{ assignToFragment?: Record<string, any>; withOptions?: Record<string, any> }>;
752
+ configs?: Array<{ toClone?: Record<string, any>; withOptions?: Record<string, any> }>;
753
753
  };
754
754
  }
755
755
 
@@ -795,7 +795,7 @@ export interface LazyLoadSwitchResolvedParams extends Omit<LazyLoadResolvedParam
795
795
  }
796
796
 
797
797
  export interface FromEachItemConfig {
798
- assignToFragment?: Record<string, any>;
798
+ toClone?: Record<string, any>;
799
799
  withOptions?: AssignFromOptions;
800
800
  resolve?: {
801
801
  key?: string;
@@ -854,28 +854,44 @@ export declare class LazyLoadHandler implements AssignFromHandler {
854
854
 
855
855
  //#region Event Handler
856
856
 
857
- export interface AssignVector {
858
- assignToTarget?: Record<string, any>,
859
- assignToSource?: Record<string, any>,
860
- assignToLHS?: Record<string, any>,
857
+ export interface AssignDispatchVector {
858
+ toTarget?: Record<string, any>,
859
+ toHost?: Record<string, any>,
860
+ toLHS?: Record<string, any>,
861
861
  withOptions?: AssignFromOptions,
862
- withAssignToTargetOptions?: AssignFromOptions,
863
- withAssignToSourceOptions?: AssignFromOptions,
864
- withAssignToLHSOptions?: AssignFromOptions,
865
- }
866
-
867
-
868
- export interface AddEventListenerConfig extends AssignVector {
869
- get?: {
870
- abortController?: string | AbortController,
871
- on?: string,
872
- nudge?: boolean,
873
- options?: AddEventListenerOptions,
862
+ toTargetOptions?: AssignFromOptions,
863
+ toHostOptions?: AssignFromOptions,
864
+ toLHSOptions?: AssignFromOptions,
865
+ dispatch?: DispatchEventConfig
866
+ }
867
+
868
+ export interface DispatchEventConfig{
869
+ type?: string,
870
+ eventCtr?: string | typeof Event | typeof CustomEvent,
871
+ detail?: any,
872
+ bubbles?: boolean,
873
+ cancelable?: boolean,
874
+ composed?: boolean
875
+ }
876
+
877
+
878
+ export interface AddEventListenerConfig extends AssignDispatchVector {
879
+ on: string,
880
+ get?: {
881
+ abortController?: string | AbortController,
882
+
883
+ nudge?: boolean,
884
+ options?: AddEventListenerOptions,
885
+ //make this part of dispatch?
886
+ stopPropagation?: boolean,
887
+ preventDefault?: boolean
888
+ dispatch?: DispatchEventConfig
874
889
  },
875
890
 
876
- fromLHS?: AssignVector,
877
- fromSource?: AssignVector,
878
- fromEvent?: AssignVector,
891
+ fromLHS?: AssignDispatchVector,
892
+ fromHost?: AssignDispatchVector,
893
+ fromEvent?: AssignDispatchVector,
894
+ fromTarget?: AssignDispatchVector,
879
895
 
880
896
 
881
897
  }
package/builtInEmoji.js DELETED
@@ -1,26 +0,0 @@
1
- /**
2
- * builtInEmoji.js — Predefined emoji aliases for built-in handlers.
3
- *
4
- * Import and spread into the `handlers` option for concise handler configs:
5
- *
6
- * @example
7
- * import { builtInEmoji } from 'assign-gingerly/builtInEmoji.js';
8
- *
9
- * assignFrom(target, {
10
- * '?.el =>': { do: '🔗', get: { value: ['?.first', ' ', '?.last'] } }
11
- * }, { from: vm, handlers: builtInEmoji });
12
- */
13
-
14
- /**
15
- * Emoji → built-in handler name mapping.
16
- */
17
- export const builtInEmoji = {
18
- '📦': 'builtIns.lazyLoad',
19
- '🎚️': 'builtIns.lazyLoadSwitch',
20
- '🔗': 'builtIns.join',
21
- '🏷️': 'builtIns.microDataJoin',
22
- '📋': 'builtIns.manageTemplateList',
23
- '📊': 'builtIns.rangeSelector',
24
- };
25
-
26
- export default builtInEmoji;