@mintjamsinc/ichigojs 0.1.8 → 0.1.9
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/README.md +19 -0
- package/dist/ichigo.esm.js +48 -5
- package/dist/ichigo.esm.js.map +1 -1
- package/dist/ichigo.esm.min.js +1 -1
- package/dist/ichigo.esm.min.js.map +1 -1
- package/dist/ichigo.umd.js +48 -5
- package/dist/ichigo.umd.js.map +1 -1
- package/dist/ichigo.umd.min.js +1 -1
- package/dist/ichigo.umd.min.js.map +1 -1
- package/dist/types/ichigo/directives/StandardDirectiveName.d.ts +13 -0
- package/dist/types/ichigo/directives/VConditionalDirective.d.ts +5 -0
- package/dist/types/ichigo/directives/VDirectiveParserRegistry.d.ts +4 -0
- package/dist/types/ichigo/directives/VPerformanceDirective.d.ts +105 -0
- package/dist/types/ichigo/directives/VResizeDirective.d.ts +5 -0
- package/dist/types/ichigo/util/ExpressionUtils.d.ts +3 -0
- package/dist/types/ichigo/util/LogLevel.d.ts +4 -0
- package/package.json +1 -1
package/dist/ichigo.umd.js
CHANGED
@@ -9,6 +9,10 @@
|
|
9
9
|
}
|
10
10
|
|
11
11
|
// Copyright (c) 2025 MintJams Inc. Licensed under MIT License.
|
12
|
+
/**
|
13
|
+
* Registry for managing directive parsers.
|
14
|
+
* This class allows registering, unregistering, and finding directive parsers.
|
15
|
+
*/
|
12
16
|
class VDirectiveParserRegistry {
|
13
17
|
/**
|
14
18
|
* The list of registered directive parsers.
|
@@ -49,17 +53,30 @@
|
|
49
53
|
}
|
50
54
|
|
51
55
|
// Copyright (c) 2025 MintJams Inc. Licensed under MIT License.
|
56
|
+
/**
|
57
|
+
* Standard directive names used in the framework.
|
58
|
+
*/
|
52
59
|
var StandardDirectiveName;
|
53
60
|
(function (StandardDirectiveName) {
|
61
|
+
/** Conditional rendering directives (if). */
|
54
62
|
StandardDirectiveName["V_IF"] = "v-if";
|
63
|
+
/** Conditional rendering directives (else if). */
|
55
64
|
StandardDirectiveName["V_ELSE_IF"] = "v-else-if";
|
65
|
+
/** Conditional rendering directives (else). */
|
56
66
|
StandardDirectiveName["V_ELSE"] = "v-else";
|
67
|
+
/** Conditional rendering directives (show). */
|
57
68
|
StandardDirectiveName["V_SHOW"] = "v-show";
|
69
|
+
/** List rendering directives. */
|
58
70
|
StandardDirectiveName["V_FOR"] = "v-for";
|
71
|
+
/** Event handling directives. */
|
59
72
|
StandardDirectiveName["V_ON"] = "v-on";
|
73
|
+
/** Attribute binding directives. */
|
60
74
|
StandardDirectiveName["V_BIND"] = "v-bind";
|
75
|
+
/** Two-way data binding directives. */
|
61
76
|
StandardDirectiveName["V_MODEL"] = "v-model";
|
77
|
+
/** Slot content insertion directives. */
|
62
78
|
StandardDirectiveName["V_RESIZE"] = "v-resize";
|
79
|
+
/** Intersection observer directives. */
|
63
80
|
StandardDirectiveName["V_INTERSECTION"] = "v-intersection";
|
64
81
|
})(StandardDirectiveName || (StandardDirectiveName = {}));
|
65
82
|
|
@@ -6581,6 +6598,9 @@
|
|
6581
6598
|
};
|
6582
6599
|
|
6583
6600
|
// Copyright (c) 2025 MintJams Inc. Licensed under MIT License.
|
6601
|
+
/**
|
6602
|
+
* Utility class for analyzing JavaScript expressions to extract variable and function dependencies.
|
6603
|
+
*/
|
6584
6604
|
class ExpressionUtils {
|
6585
6605
|
/**
|
6586
6606
|
* Extracts variable and function names used in the expression.
|
@@ -8317,6 +8337,11 @@
|
|
8317
8337
|
}
|
8318
8338
|
|
8319
8339
|
// Copyright (c) 2025 MintJams Inc. Licensed under MIT License.
|
8340
|
+
/**
|
8341
|
+
* Base class for conditional directives such as v-if, v-else-if, and v-else.
|
8342
|
+
* This class manages the rendering of the associated virtual node based on the evaluation of the directive's condition.
|
8343
|
+
* It also coordinates with other related conditional directives to ensure only one block is rendered at a time.
|
8344
|
+
*/
|
8320
8345
|
class VConditionalDirective {
|
8321
8346
|
/**
|
8322
8347
|
* The virtual node to which this directive is applied.
|
@@ -9909,6 +9934,7 @@
|
|
9909
9934
|
*
|
9910
9935
|
* Example usage:
|
9911
9936
|
* <div v-resize="handleResize">Resizable content</div>
|
9937
|
+
* <div v-resize="handleResize" :options.resize="{box: 'border-box'}">Resizable content</div>
|
9912
9938
|
*
|
9913
9939
|
* The handler receives ResizeObserverEntry array as the first argument and $ctx as the second:
|
9914
9940
|
* handleResize(entries, $ctx) {
|
@@ -9916,6 +9942,10 @@
|
|
9916
9942
|
* console.log(`Size: ${width}x${height}`);
|
9917
9943
|
* }
|
9918
9944
|
*
|
9945
|
+
* Options can be provided via :options or :options.resize attribute:
|
9946
|
+
* :options="{box: 'border-box'}"
|
9947
|
+
* :options.resize="{box: 'content-box'}"
|
9948
|
+
*
|
9919
9949
|
* This directive is useful for responsive layouts, charts, and other components
|
9920
9950
|
* that need to adapt to size changes.
|
9921
9951
|
*/
|
@@ -10008,11 +10038,24 @@
|
|
10008
10038
|
const element = this.#vNode.node;
|
10009
10039
|
const handler = this.#handlerWrapper;
|
10010
10040
|
return () => {
|
10041
|
+
// Get options from :options.resize or :options directive
|
10042
|
+
let optionsDirective = this.#vNode.directiveManager?.optionsDirective('resize');
|
10043
|
+
// Evaluate the options expression
|
10044
|
+
let options;
|
10045
|
+
if (optionsDirective && optionsDirective.expression) {
|
10046
|
+
// Evaluate the options expression
|
10047
|
+
const identifiers = optionsDirective.dependentIdentifiers;
|
10048
|
+
const values = identifiers.map(id => this.#vNode.bindings?.get(id));
|
10049
|
+
const args = identifiers.join(", ");
|
10050
|
+
const funcBody = `return (${optionsDirective.expression});`;
|
10051
|
+
const func = new Function(args, funcBody);
|
10052
|
+
options = func(...values);
|
10053
|
+
}
|
10011
10054
|
// Create ResizeObserver and start observing
|
10012
10055
|
this.#resizeObserver = new ResizeObserver((entries) => {
|
10013
10056
|
handler(entries);
|
10014
10057
|
});
|
10015
|
-
this.#resizeObserver.observe(element);
|
10058
|
+
this.#resizeObserver.observe(element, options);
|
10016
10059
|
};
|
10017
10060
|
}
|
10018
10061
|
/**
|
@@ -10371,13 +10414,13 @@
|
|
10371
10414
|
*/
|
10372
10415
|
var LogLevel;
|
10373
10416
|
(function (LogLevel) {
|
10374
|
-
|
10417
|
+
/** Debug level */
|
10375
10418
|
LogLevel["DEBUG"] = "debug";
|
10376
|
-
|
10419
|
+
/** Info level */
|
10377
10420
|
LogLevel["INFO"] = "info";
|
10378
|
-
|
10421
|
+
/** Warning level */
|
10379
10422
|
LogLevel["WARN"] = "warn";
|
10380
|
-
|
10423
|
+
/** Error level */
|
10381
10424
|
LogLevel["ERROR"] = "error";
|
10382
10425
|
})(LogLevel || (LogLevel = {}));
|
10383
10426
|
|