mount-observer 0.1.26 → 0.1.27

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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "mount-observer",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "description": "Observe and act on css matches.",
5
5
  "main": "MountObserver.js",
6
6
  "module": "MountObserver.js",
7
7
  "dependencies": {
8
- "assign-gingerly": "0.0.25",
8
+ "assign-gingerly": "0.0.26",
9
9
  "id-generation": "0.0.4"
10
10
  },
11
11
  "devDependencies": {
@@ -169,6 +169,7 @@ export type IEnhancementRegistryItem<T = any> = EnhancementConfig<T>;
169
169
  export interface IAssignGingerlyOptions {
170
170
  registry?: typeof EnhancementRegistry | EnhancementRegistry;
171
171
  bypassChecks?: boolean;
172
+ withMethods?: string[] | Set<string>;
172
173
  }
173
174
 
174
175
  /**
@@ -0,0 +1,35 @@
1
+ export interface EndUserProps{
2
+ triggerInsertPosition: InsertPosition;
3
+ cloneInsertPosition: InsertPosition;
4
+ buttonContent: string;
5
+ }
6
+
7
+ export interface AllProps extends EndUserProps{
8
+ enhancedElement: Element;
9
+ byob?: boolean;
10
+ trigger?: HTMLButtonElement;
11
+ resolved: boolean;
12
+ }
13
+
14
+ export type AP = AllProps;
15
+
16
+ export type PAP = Partial<AP>;
17
+
18
+ export type ProPAP = Promise<PAP>;
19
+
20
+ export interface CustomData {
21
+ triggerSettings: {
22
+ type: string;
23
+ //trigger.classList.add('be-clonable-trigger');
24
+ ariaLabel: string;
25
+ title: string;
26
+ }
27
+
28
+ }
29
+
30
+ export interface Actions{
31
+ addCloneBtn(self: AP): ProPAP;
32
+ setBtnContent(self: AP): void;
33
+ beCloned(self: AP): void;
34
+ init(self: AP, enhancedElement: Element, initVals: PAP): Promise<void>
35
+ }
@@ -71,13 +71,32 @@ export interface Positraction<TProps = any, TActions = TProps> extends LogicOp<T
71
71
  assignTo?: Array<null | (keyof TProps & string)>
72
72
  }
73
73
 
74
- export interface RAConfig<TProps = unknown, TActions = TProps, ETProps = TProps> {
74
+ export interface RAConfig<TProps = unknown, TActions = TProps, ETProps = TProps, TCustomData = unknown> {
75
75
  actions?: Actions<TProps,TActions>,
76
76
  compacts?: Compacts<TProps, TActions>,
77
77
  //onsets?: Onsets<TProps, TActions>,
78
78
  handlers?: Handlers<ETProps, TActions>,
79
79
  hitch?: Hitches<TProps, TActions>,
80
80
  positractions?: Positractions<TProps>,
81
+ /**
82
+ * Configure automatic WeakRef wrapping for properties
83
+ *
84
+ * Properties listed here will automatically wrap values in WeakRef when set,
85
+ * and automatically deref when accessed. This prevents memory leaks for
86
+ * DOM elements and other objects that should be garbage collected.
87
+ *
88
+ * Options:
89
+ * - Array of property names: ['trigger', 'enhancedElement']
90
+ * - Object with configuration: { properties: ['trigger'], logIfCollected: 'warn' }
91
+ *
92
+ * When a WeakRef'd value is garbage collected, the getter returns undefined.
93
+ * Use logIfCollected to get notified when this happens.
94
+ */
95
+ weakRef?: WeakRefConfig<TProps>,
96
+
97
+ defaultPropVals?: Partial<{[key in keyof TProps & string]: unknown}>,
98
+
99
+ customData?: TCustomData,
81
100
  }
82
101
 
83
102
  export interface RoundaboutOptions<TProps = unknown, TActions = TProps, ETProps = TProps> extends RAConfig<TProps, TActions, ETProps> {
@@ -107,6 +126,27 @@ export interface RoundaboutOptions<TProps = unknown, TActions = TProps, ETProps
107
126
  * - Diamond dependencies (A→B, A→C, B→D, C→D)
108
127
  */
109
128
  internalRouting?: boolean,
129
+
130
+
131
+ }
132
+
133
+ /**
134
+ * Configuration for automatic WeakRef wrapping
135
+ */
136
+ export interface WeakRefConfig<TProps = any> {
137
+ /**
138
+ * Properties to automatically wrap in WeakRef
139
+ */
140
+ properties: Array<keyof TProps & string>;
141
+
142
+ /**
143
+ * Logging behavior when deref returns null/undefined
144
+ * - 'error': console.error (default)
145
+ * - 'warn': console.warn
146
+ * - 'silent': no logging
147
+ * - function: custom logging function
148
+ */
149
+ logIfCollected?: 'error' | 'warn' | 'silent' | ((propName: string) => void);
110
150
  }
111
151
 
112
152
  export interface RoundaboutReady{