smsmslib 1.0.59 → 1.0.65

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.
@@ -9,7 +9,7 @@
9
9
  * pattern, facilitating synchronization between the media element and
10
10
  * its associated UI components.
11
11
  *
12
- * @module src/av_controller/AvControllerState_t
12
+ * @module javascr/av_controller/AvControllerState_t
13
13
  */
14
14
 
15
15
 
@@ -8,7 +8,7 @@
8
8
  * observer linked to a specific DOM element and
9
9
  * ensures the UI is revealed only when the media state is initialized.
10
10
  *
11
- * @module src/HtmlControl_t
11
+ * @module javascr/av_controller/HtmlControl_t
12
12
  */
13
13
 
14
14
 
@@ -7,7 +7,7 @@
7
7
  * observer for HTMLMediaElements (e.g., <video> or <audio>). It facilitates
8
8
  * bidirectional synchronization:
9
9
  *
10
- * @module src/av_controller/HtmlMedia_t
10
+ * @module javascr/av_controller/HtmlMedia_t
11
11
  */
12
12
 
13
13
  /** ---------------------------------------------------------------------------
@@ -8,7 +8,7 @@
8
8
  * the button's visual state with the application's playback state and handles
9
9
  * user toggle interactions.
10
10
  *
11
- * @module src/HtmlPlay_t
11
+ * @module javascr/av_controller/HtmlPlay_t
12
12
  */
13
13
 
14
14
  /** ---------------------------------------------------------------------------
@@ -7,7 +7,7 @@
7
7
  * observer for a skip-forward control. It handles user interactions to
8
8
  * instantly move the media playback position to the end of the seekable range.
9
9
  *
10
- * @module src/HtmlSkipForward_t
10
+ * @module javascr/av_controller/HtmlSkipForward_t
11
11
  */
12
12
 
13
13
  /** ---------------------------------------------------------------------------
@@ -7,7 +7,7 @@
7
7
  * observer for a skip-rewind control. It handles user interactions to
8
8
  * instantly move the media playback position to the start of the seekable range.
9
9
  *
10
- * @module src/HtmlSkipRewind_t
10
+ * @module javascr/av_controller/HtmlSkipRewind_t
11
11
  */
12
12
 
13
13
  /** ---------------------------------------------------------------------------
@@ -11,7 +11,7 @@
11
11
  * The logic includes both initial state synchronization and real-time updates
12
12
  * triggered by media playback events.
13
13
  *
14
- * @module src/av_controller/HtmlTimerDigit_t
14
+ * @module javascr/av_controller/HtmlTimerDigit_t
15
15
  */
16
16
 
17
17
  /** ---------------------------------------------------------------------------
@@ -8,7 +8,7 @@
8
8
  * actual rendered width of the progress bar's frame and synchronize that
9
9
  * measurement with the shared application state.
10
10
  *
11
- * @module src/av_controller/HtmlTimerFrame_t
11
+ * @module javascr/av_controller/HtmlTimerFrame_t
12
12
  * --------------------------------------------------------------------------- */
13
13
 
14
14
  /** ---------------------------------------------------------------------------
@@ -5,7 +5,7 @@
5
5
  * This module provides high-level controller functions to manage the creation,
6
6
  * initialization, and disposal of `Subject_t`.
7
7
  *
8
- * @module src/av_controller/av_controller
8
+ * @module javascr/av_controller/av_controller
9
9
  * --------------------------------------------------------------------------- */
10
10
 
11
11
  /** ---------------------------------------------------------------------------
@@ -2,7 +2,7 @@
2
2
  * @file
3
3
  * Entry point for the av_controller module.
4
4
  *
5
- * @module src/av_controller/index
5
+ * @module javascr/av_controller/index
6
6
  */
7
7
 
8
8
  export * from "./AvControllerState_t.js";
package/javascr/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * @file
3
3
  * Entry point for the javascr module.
4
4
  *
5
- * @module smsmslib/javascr/index
5
+ * @module javascr/index
6
6
  */
7
7
 
8
8
  export * from "./system/index.js";
@@ -2,7 +2,7 @@
2
2
  * @file App_t.js
3
3
  * @brief Application root class providing a central access point for state management.
4
4
  *
5
- * @module src/App_t
5
+ * @module javascr/system/App_t
6
6
  * --------------------------------------------------------------------------- */
7
7
 
8
8
  /** ---------------------------------------------------------------------------
@@ -8,7 +8,7 @@
8
8
  * JavaScript objects and their corresponding HTML elements, providing a
9
9
  * structured way to manage DOM nodes as observer instances.
10
10
  *
11
- * @module src/HtmlElement_t
11
+ * @module javascr/system/HtmlElement_t
12
12
  */
13
13
 
14
14
  /** ---------------------------------------------------------------------------
@@ -7,7 +7,7 @@
7
7
  * should override these methods to implement specific behaviors, such as
8
8
  * updating DOM elements or handling application-level events.
9
9
  *
10
- * @module src/Observer_t
10
+ * @module javascr/system/Observer_t
11
11
  * --------------------------------------------------------------------------- */
12
12
 
13
13
  /**
@@ -7,7 +7,7 @@
7
7
  * to organize various data domains (e.g., user profiles, settings, state)
8
8
  * under unique keys and provides mechanisms for collective operations.
9
9
  *
10
- * @module src/SubjectSet_t
10
+ * @module javascr/system/SubjectSet_t
11
11
  * --------------------------------------------------------------------------- */
12
12
 
13
13
  /** ---------------------------------------------------------------------------
@@ -18,7 +18,7 @@
18
18
  * via `data_get()`, editing it, and then explicitly calling `observer_update()`
19
19
  * to trigger observer synchronization.
20
20
  *
21
- * @module src/Subject_t
21
+ * @module javascr/system/Subject_t
22
22
  * --------------------------------------------------------------------------- */
23
23
 
24
24
  /** ---------------------------------------------------------------------------
@@ -3,7 +3,7 @@
3
3
  * Provides core utility functions for **safe inspection and property modification**
4
4
  * of Array instances.
5
5
  *
6
- * @module src/array
6
+ * @module javascr/system/array
7
7
  */
8
8
 
9
9
  /** ---------------------------------------------------------------------------
@@ -3,7 +3,7 @@
3
3
  * Provides utility functions for **safely merging and concatenating**
4
4
  * Array instances.
5
5
  *
6
- * @module src/arrayconcat
6
+ * @module javascr/system/arrayconcat
7
7
  */
8
8
 
9
9
  /** ---------------------------------------------------------------------------
@@ -3,7 +3,7 @@
3
3
  * Provides utility functions for **creating and initializing** Array instances
4
4
  * safely.
5
5
  *
6
- * @module src/arraynew
6
+ * @module javascr/system/arraynew
7
7
  */
8
8
 
9
9
  /** ---------------------------------------------------------------------------
@@ -3,7 +3,7 @@
3
3
  * Provides utility functions for **safely adding elements** to the end of
4
4
  * Array instances.
5
5
  *
6
- * @module src/arraypush
6
+ * @module javascr/system/arraypush
7
7
  */
8
8
 
9
9
 
@@ -3,7 +3,7 @@
3
3
  * Provides utility functions for **safely modifying array contents** through
4
4
  * splicing, removal, and replacement.
5
5
  *
6
- * @module src/arraysplice
6
+ * @module javascr/system/arraysplice
7
7
  */
8
8
 
9
9
  /** ---------------------------------------------------------------------------
@@ -2,7 +2,7 @@
2
2
  * @file
3
3
  * Utility functions for safe DOM document access and element selection.
4
4
  *
5
- * @module src/system/document
5
+ * @module javascr/system/document
6
6
  */
7
7
 
8
8
  /** ---------------------------------------------------------------------------
@@ -2,7 +2,7 @@
2
2
  * @file
3
3
  * Utility functions for accessing the HTML root element.
4
4
  *
5
- * @module src/system/html
5
+ * @module javascr/system/html
6
6
  */
7
7
 
8
8
  /** ---------------------------------------------------------------------------
@@ -2,7 +2,7 @@
2
2
  * @file
3
3
  * Entry point for the system module.
4
4
  *
5
- * @module src/system/index
5
+ * @module javascr/system/index
6
6
  */
7
7
 
8
8
  export * from "./App_t.js";
@@ -1,7 +1,8 @@
1
- /**
1
+ /**
2
2
  * @file
3
+ * Provides functionality for creating multi-dimensional arrays (matrices).
3
4
  *
4
- * @module src/matnew
5
+ * @module javascr/system/matnew
5
6
  */
6
7
 
7
8
  /** ---------------------------------------------------------------------------
@@ -21,6 +22,24 @@ from "./array.js";
21
22
  * Functions.
22
23
  * --------------------------------------------------------------------------- */
23
24
 
25
+ /**
26
+ * Creates a multi-dimensional array (matrix) with specified dimensions.
27
+ * This function constructs a nested array structure based on the provided
28
+ * dimension arguments.
29
+ *
30
+ * @param {...number} ai_dim [in]
31
+ * A variable number of arguments defining the size of each dimension.
32
+ * For example, `sj_mat_new(2, 3)` creates a 2x3 matrix. All arguments
33
+ * must be positive integers.
34
+ *
35
+ * @returns {Array | null}
36
+ * A new multi-dimensional array initialized with 0 at the deepest level.
37
+ * Returns `null` if any dimension is invalid or if allocation fails.
38
+ *
39
+ * @see mat_new_init
40
+ * @see mat_new_push
41
+ * @see mat_new_pop
42
+ */
24
43
  export function sj_mat_new(...ai_dim)
25
44
  {
26
45
  let a_mat = null;
@@ -48,6 +67,20 @@ export function sj_mat_new(...ai_dim)
48
67
  }
49
68
 
50
69
 
70
+ /**
71
+ * Validates matrix dimensions and initializes the root array.
72
+ * This function ensures that `ai_dim` contains only positive integers.
73
+ * If valid, it creates and returns the first-order (root) array.
74
+ *
75
+ * @param {number[]} ai_dim [in]
76
+ * An array where `ai_dim[n]` represents the size of the n-th order dimension.
77
+ * Must contain at least one element, and all elements must be positive integers.
78
+ *
79
+ * @returns {Array | null}
80
+ * A new empty array for the first dimension if validation passes.
81
+ * Returns `null` if `ai_dim` is empty, contains invalid dimensions,
82
+ * or if array allocation fails.
83
+ */
51
84
  function mat_new_init(ai_dim)
52
85
  {
53
86
  let a_mat = null;
@@ -67,6 +100,22 @@ function mat_new_init(ai_dim)
67
100
  }
68
101
 
69
102
 
103
+ /**
104
+ * Creates a new empty array for a deeper dimension and pushes the current
105
+ * array `a_mat` onto the stack.
106
+ *
107
+ * @param {Array<Array>} aa_stack [in/out]
108
+ * A stack used to store parent array references as the construction
109
+ * moves to deeper dimensions.
110
+ *
111
+ * @param {Array} a_mat [in]
112
+ * The current array level that will now act as a parent to the
113
+ * newly created array.
114
+ *
115
+ * @returns {Array | null}
116
+ * The newly created array instance (the new current level).
117
+ * Returns `null` if array creation or pushing fails.
118
+ */
70
119
  function mat_new_push(aa_stack, a_mat)
71
120
  {
72
121
  const a_push = sj_array_new(0, 0);
@@ -90,6 +139,27 @@ function mat_new_push(aa_stack, a_mat)
90
139
  }
91
140
 
92
141
 
142
+ /**
143
+ * Pops the stack to find the next available parent level after a_mat
144
+ * has been fully populated.
145
+ *
146
+ * This function repeatedly executes `a_mat = aa_stack.pop()` until the
147
+ * condition `a_mat.length < ai_dim[aa_stack.length]` is met, ensuring
148
+ * the returned array has space for the next element at its specific depth.
149
+ *
150
+ * @param {Array<Array>} aa_stack [in/out]
151
+ * A stack containing references to the parent arrays of `a_mat`.
152
+ *
153
+ * @param {Array} a_mat [in]
154
+ * The current array level having been populated.
155
+ *
156
+ * @param {number[]} ai_dim [in]
157
+ * An array where `ai_dim[n]` represents the size of the n-th order dimension.
158
+ *
159
+ * @returns {Array}
160
+ * The parent array of `a_mat` that has available capacity.
161
+ * Returns `a_mat` as is if no popping was necessary.
162
+ */
93
163
  function mat_new_pop(aa_stack, a_mat, ai_dim)
94
164
  {
95
165
  let a_mat_now = a_mat;
@@ -3,7 +3,7 @@
3
3
  * Set utility functions.
4
4
  * Provides helper functions for creating and managing Set objects.
5
5
  *
6
- * @module src/set
6
+ * @module javascr/system/set
7
7
  */
8
8
 
9
9
  /** ---------------------------------------------------------------------------
@@ -6,7 +6,7 @@
6
6
  * This module provides comprehensive and reliable functions for type determination,
7
7
  * going beyond the limitations of the standard 'typeof' operator.
8
8
  *
9
- * @module src/type
9
+ * @module javascr/system/type
10
10
  */
11
11
 
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smsmslib",
3
- "version": "1.0.59",
3
+ "version": "1.0.65",
4
4
  "description": "Reusable functions for me.",
5
5
  "files": [
6
6
  "javascr/**/*.js",
@@ -19,6 +19,6 @@
19
19
  "author": "",
20
20
  "license": "ISC",
21
21
  "dependencies": {
22
- "smsmslib": "^1.0.59"
22
+ "smsmslib": "^1.0.65"
23
23
  }
24
24
  }
package/react/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * @file
3
3
  * Entry point for the react module.
4
4
  *
5
- * @module smsmslib/react/index
5
+ * @module react/index
6
6
  */
7
7
 
8
8
  export * from "../javascr/index.js";
@@ -2,7 +2,7 @@
2
2
  * @file
3
3
  * Entry point for the react/system module.
4
4
  *
5
- * @module smsmslib/react/system/index
5
+ * @module react/system/index
6
6
  */
7
7
 
8
8
  export * from "./useeffect.js";