@fiddle-digital/string-tune 1.1.23 → 1.1.25

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/index.d.mts CHANGED
@@ -873,6 +873,18 @@ interface StringContext {
873
873
  events: EventManager;
874
874
  }
875
875
 
876
+ interface ModuleLifecyclePermissionsItem {
877
+ rebuild: {
878
+ width: boolean;
879
+ height: boolean;
880
+ scrollHeight: boolean;
881
+ };
882
+ }
883
+ declare class ModuleLifecyclePermissions {
884
+ desktop: ModuleLifecyclePermissionsItem;
885
+ mobile: ModuleLifecyclePermissionsItem;
886
+ }
887
+
876
888
  /**
877
889
  * Internal class representing a DOM-bound interactive object.
878
890
  * Connected to modules and holds its own internal state.
@@ -955,6 +967,7 @@ declare class StringObject {
955
967
  * Base interface for scroll/interaction modules in the StringScroll system.
956
968
  */
957
969
  interface IStringModule {
970
+ permissions: ModuleLifecyclePermissions;
958
971
  /** Cleans up all internal state and detaches from the system. */
959
972
  destroy(): void;
960
973
  /** Called once when the module is initialized. */
@@ -963,6 +976,8 @@ interface IStringModule {
963
976
  onFrame(data: StringData): void;
964
977
  /** Called when the window or layout is resized. */
965
978
  onResize(): void;
979
+ /** Called when the layout is resize width. */
980
+ onResizeWidth(): void;
966
981
  /** Called when the system rebuilds the DOM (e.g. after mutations). */
967
982
  onDOMRebuild(): void;
968
983
  /** Called when scroll position changes. */
@@ -1130,6 +1145,7 @@ declare class StringModule implements IStringModule {
1130
1145
  * Supports custom event emitting, listening, and unsubscription.
1131
1146
  */
1132
1147
  protected events: EventManager;
1148
+ permissions: ModuleLifecyclePermissions;
1133
1149
  constructor(context: StringContext);
1134
1150
  /**
1135
1151
  * Initializes a `StringObject` by mapping attributes from an HTML element
@@ -1243,6 +1259,8 @@ declare class StringModule implements IStringModule {
1243
1259
  onFrame(data: StringData): void;
1244
1260
  /** Called when the window or layout is resized. */
1245
1261
  onResize(): void;
1262
+ /** Called when the layout is resized width. */
1263
+ onResizeWidth(): void;
1246
1264
  /** Called when scroll position changes. */
1247
1265
  onScroll(data: StringData): void;
1248
1266
  /** Called when user changed scroll diraction. */
@@ -1301,28 +1319,17 @@ declare class StringMagnetic extends StringModule {
1301
1319
 
1302
1320
  /**
1303
1321
  * Module that handles lazy-loading of images with `string-lazy` attribute.
1304
- * Automatically loads and applies aspect-ratio once image is loaded.
1322
+ * It loads the image only once, calculates its aspect-ratio to prevent layout shift,
1323
+ * and then displays it.
1305
1324
  */
1306
1325
  declare class StringLazy extends StringModule {
1307
1326
  private isStartLoaded;
1308
1327
  private loadingCount;
1309
1328
  constructor(context: StringContext);
1310
- /**
1311
- * Called on module start — preloads all <img string-lazy> in DOM.
1312
- */
1313
1329
  onInit(): void;
1314
- /**
1315
- * Called when an image becomes a managed object.
1316
- */
1317
1330
  onObjectConnected(object: StringObject): void;
1318
- /**
1319
- * Loads image and sets aspect-ratio based on real dimensions.
1320
- */
1321
1331
  private loadImage;
1322
- /**
1323
- * Loads image data to extract real dimensions and apply aspect-ratio style.
1324
- */
1325
- private setAspectRatio;
1332
+ private handleLoadingCompletion;
1326
1333
  }
1327
1334
 
1328
1335
  /**
@@ -1489,7 +1496,7 @@ declare class StringScrollbar extends StringModule {
1489
1496
  */
1490
1497
  declare class StringSplit extends StringModule {
1491
1498
  constructor(context: StringContext);
1492
- onResize(): void;
1499
+ onResizeWidth(): void;
1493
1500
  onObjectConnected(object: StringObject): void;
1494
1501
  split(element: HTMLElement, options: ISplitOptions): {
1495
1502
  fragment: DocumentFragment;
package/dist/index.d.ts CHANGED
@@ -873,6 +873,18 @@ interface StringContext {
873
873
  events: EventManager;
874
874
  }
875
875
 
876
+ interface ModuleLifecyclePermissionsItem {
877
+ rebuild: {
878
+ width: boolean;
879
+ height: boolean;
880
+ scrollHeight: boolean;
881
+ };
882
+ }
883
+ declare class ModuleLifecyclePermissions {
884
+ desktop: ModuleLifecyclePermissionsItem;
885
+ mobile: ModuleLifecyclePermissionsItem;
886
+ }
887
+
876
888
  /**
877
889
  * Internal class representing a DOM-bound interactive object.
878
890
  * Connected to modules and holds its own internal state.
@@ -955,6 +967,7 @@ declare class StringObject {
955
967
  * Base interface for scroll/interaction modules in the StringScroll system.
956
968
  */
957
969
  interface IStringModule {
970
+ permissions: ModuleLifecyclePermissions;
958
971
  /** Cleans up all internal state and detaches from the system. */
959
972
  destroy(): void;
960
973
  /** Called once when the module is initialized. */
@@ -963,6 +976,8 @@ interface IStringModule {
963
976
  onFrame(data: StringData): void;
964
977
  /** Called when the window or layout is resized. */
965
978
  onResize(): void;
979
+ /** Called when the layout is resize width. */
980
+ onResizeWidth(): void;
966
981
  /** Called when the system rebuilds the DOM (e.g. after mutations). */
967
982
  onDOMRebuild(): void;
968
983
  /** Called when scroll position changes. */
@@ -1130,6 +1145,7 @@ declare class StringModule implements IStringModule {
1130
1145
  * Supports custom event emitting, listening, and unsubscription.
1131
1146
  */
1132
1147
  protected events: EventManager;
1148
+ permissions: ModuleLifecyclePermissions;
1133
1149
  constructor(context: StringContext);
1134
1150
  /**
1135
1151
  * Initializes a `StringObject` by mapping attributes from an HTML element
@@ -1243,6 +1259,8 @@ declare class StringModule implements IStringModule {
1243
1259
  onFrame(data: StringData): void;
1244
1260
  /** Called when the window or layout is resized. */
1245
1261
  onResize(): void;
1262
+ /** Called when the layout is resized width. */
1263
+ onResizeWidth(): void;
1246
1264
  /** Called when scroll position changes. */
1247
1265
  onScroll(data: StringData): void;
1248
1266
  /** Called when user changed scroll diraction. */
@@ -1301,28 +1319,17 @@ declare class StringMagnetic extends StringModule {
1301
1319
 
1302
1320
  /**
1303
1321
  * Module that handles lazy-loading of images with `string-lazy` attribute.
1304
- * Automatically loads and applies aspect-ratio once image is loaded.
1322
+ * It loads the image only once, calculates its aspect-ratio to prevent layout shift,
1323
+ * and then displays it.
1305
1324
  */
1306
1325
  declare class StringLazy extends StringModule {
1307
1326
  private isStartLoaded;
1308
1327
  private loadingCount;
1309
1328
  constructor(context: StringContext);
1310
- /**
1311
- * Called on module start — preloads all <img string-lazy> in DOM.
1312
- */
1313
1329
  onInit(): void;
1314
- /**
1315
- * Called when an image becomes a managed object.
1316
- */
1317
1330
  onObjectConnected(object: StringObject): void;
1318
- /**
1319
- * Loads image and sets aspect-ratio based on real dimensions.
1320
- */
1321
1331
  private loadImage;
1322
- /**
1323
- * Loads image data to extract real dimensions and apply aspect-ratio style.
1324
- */
1325
- private setAspectRatio;
1332
+ private handleLoadingCompletion;
1326
1333
  }
1327
1334
 
1328
1335
  /**
@@ -1489,7 +1496,7 @@ declare class StringScrollbar extends StringModule {
1489
1496
  */
1490
1497
  declare class StringSplit extends StringModule {
1491
1498
  constructor(context: StringContext);
1492
- onResize(): void;
1499
+ onResizeWidth(): void;
1493
1500
  onObjectConnected(object: StringObject): void;
1494
1501
  split(element: HTMLElement, options: ISplitOptions): {
1495
1502
  fragment: DocumentFragment;