@cocreate/plugins 1.1.0 → 1.1.1
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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/index.js +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.1.1](https://github.com/CoCreate-app/CoCreate-plugins/compare/v1.1.0...v1.1.1) (2026-02-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* change init function to default export and update parameter handling ([654b623](https://github.com/CoCreate-app/CoCreate-plugins/commit/654b623760446cbd9db55cc216e25a07fe7865e3))
|
|
7
|
+
|
|
1
8
|
# [1.1.0](https://github.com/CoCreate-app/CoCreate-plugins/compare/v1.0.3...v1.1.0) (2026-01-15)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -180,7 +180,7 @@ const cssMarker = typeof document !== 'undefined' ? document.querySelector('link
|
|
|
180
180
|
* Processes one or more elements to attach plugins.
|
|
181
181
|
* @param {HTMLElement|NodeList|Array} elements - Element, or Collection of Elements
|
|
182
182
|
*/
|
|
183
|
-
|
|
183
|
+
function init(elements) {
|
|
184
184
|
if (!elements) return;
|
|
185
185
|
|
|
186
186
|
let collection = [];
|
|
@@ -351,10 +351,10 @@ function executeGenericPlugin(el, name) {
|
|
|
351
351
|
* - $anime.stagger(100)
|
|
352
352
|
*/
|
|
353
353
|
function processParams(el, params) {
|
|
354
|
-
if (typeof params === 'string' && params.startsWith('
|
|
354
|
+
if (typeof params === 'string' && params.startsWith('\u0024')) {
|
|
355
355
|
try {
|
|
356
356
|
// 1. Check for Method Call: $root.path.to.func(arg)
|
|
357
|
-
const callMatch = params.match(
|
|
357
|
+
const callMatch = params.match(/^\u0024([^.]+)\.(.+)\((.*)\)$/);
|
|
358
358
|
if (callMatch) {
|
|
359
359
|
const [_, root, path, arg] = callMatch;
|
|
360
360
|
const obj = (root === 'this') ? el : window[root];
|
|
@@ -371,7 +371,7 @@ function processParams(el, params) {
|
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
// 2. Check for Property Access: $root.path.to.prop or just $root
|
|
374
|
-
const propMatch = params.match(
|
|
374
|
+
const propMatch = params.match(/^\u0024([^.]+)(?:\.(.+))?$/);
|
|
375
375
|
if (propMatch) {
|
|
376
376
|
const [_, root, path] = propMatch;
|
|
377
377
|
const obj = (root === 'this') ? el : window[root];
|
|
@@ -410,4 +410,6 @@ Observer.init({
|
|
|
410
410
|
// Auto-init for existing elements
|
|
411
411
|
if (typeof document !== 'undefined') {
|
|
412
412
|
init(document.querySelectorAll("[plugin]"));
|
|
413
|
-
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export default { init }
|