@medyll/idae-be 1.26.0 → 1.28.0
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/be.js +6 -0
- package/dist/modules/dom.js +1 -1
- package/dist/modules/events.d.ts +3 -1
- package/dist/modules/events.js +4 -0
- package/dist/types.d.ts +3 -1
- package/package.json +16 -16
package/dist/be.js
CHANGED
|
@@ -346,3 +346,9 @@ export const be = Be.elem;
|
|
|
346
346
|
export const toBe = Be.toBe;
|
|
347
347
|
export const beId = (id) => Be.elem(`#${id}`);
|
|
348
348
|
export const createBe = Be.createBe;
|
|
349
|
+
// be('.test').dom.update('content', () => {}); // should return be('.test').dom.
|
|
350
|
+
// relies on dom.handle // should return be('.test')
|
|
351
|
+
/* be('.test').dom({
|
|
352
|
+
update: { content: '<p>Updated</p>', callback: () => {} },
|
|
353
|
+
append: { content: '<p>Appended</p>', callback: () => {} }
|
|
354
|
+
}); */
|
package/dist/modules/dom.js
CHANGED
|
@@ -40,7 +40,7 @@ export class DomHandler {
|
|
|
40
40
|
handle(actions) {
|
|
41
41
|
Object.entries(actions).forEach(([method, props]) => {
|
|
42
42
|
switch (method) {
|
|
43
|
-
case 'update':
|
|
43
|
+
case 'update': // be('.test').dom({update: {content: '<p>Updated</p>', callback: () => {}}})
|
|
44
44
|
this.update(props.content, props.callback);
|
|
45
45
|
break;
|
|
46
46
|
case 'append':
|
package/dist/modules/events.d.ts
CHANGED
|
@@ -25,10 +25,11 @@ export interface EventHandlerHandle {
|
|
|
25
25
|
/**
|
|
26
26
|
* Handles event operations for Be elements.
|
|
27
27
|
*/
|
|
28
|
-
export declare class EventsHandler implements CommonHandler<EventsHandler> {
|
|
28
|
+
export declare class EventsHandler implements CommonHandler<EventsHandler, EventHandlerHandle> {
|
|
29
29
|
private beElement;
|
|
30
30
|
static methods: eventsMethods[];
|
|
31
31
|
constructor(beElement: Be);
|
|
32
|
+
methods: eventsMethods[];
|
|
32
33
|
/**
|
|
33
34
|
* Handle event actions (add or remove event listeners).
|
|
34
35
|
* @param actions An object specifying the event actions to perform.
|
|
@@ -76,5 +77,6 @@ export declare class EventsHandler implements CommonHandler<EventsHandler> {
|
|
|
76
77
|
* beInstance.fire('customEvent', { key: 'value' }); // Dispatches a custom event with data
|
|
77
78
|
*/
|
|
78
79
|
fire(eventName: string, detail: unknown, options?: EventInit, callback?: HandlerCallBackFn): Be;
|
|
80
|
+
valueOf(): Be;
|
|
79
81
|
}
|
|
80
82
|
export {};
|
package/dist/modules/events.js
CHANGED
|
@@ -14,6 +14,7 @@ export class EventsHandler {
|
|
|
14
14
|
constructor(beElement) {
|
|
15
15
|
this.beElement = beElement;
|
|
16
16
|
}
|
|
17
|
+
methods = EventsHandler.methods;
|
|
17
18
|
/**
|
|
18
19
|
* Handle event actions (add or remove event listeners).
|
|
19
20
|
* @param actions An object specifying the event actions to perform.
|
|
@@ -105,4 +106,7 @@ export class EventsHandler {
|
|
|
105
106
|
});
|
|
106
107
|
return this.beElement;
|
|
107
108
|
}
|
|
109
|
+
valueOf() {
|
|
110
|
+
return this.beElement;
|
|
111
|
+
}
|
|
108
112
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Be } from './be.js';
|
|
2
|
-
|
|
2
|
+
type CombineElementsHelper<T extends string, Depth extends number[]> = Depth['length'] extends 10 ? never : T | `${T} ${CombineElementsHelper<T, [...Depth, 1]>}`;
|
|
3
|
+
export type CombineElements<T extends string> = CombineElementsHelper<T, []>;
|
|
3
4
|
export type IsWhat = 'element' | 'array' | 'qy';
|
|
4
5
|
export type PositionSnapOptions = 'top' | 'right' | 'bottom' | 'left' | 'center' | `${'top' | 'bottom'} ${'left' | 'right' | 'center'}` | `${'left' | 'right'} ${'top' | 'bottom' | 'center'}`;
|
|
5
6
|
export type HandlerCallbackProps = {
|
|
@@ -21,3 +22,4 @@ export interface CommonHandler<T = unknown, H = unknown, V = unknown> {
|
|
|
21
22
|
methods: string[] | keyof T;
|
|
22
23
|
valueOf: () => V;
|
|
23
24
|
}
|
|
25
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medyll/idae-be",
|
|
3
3
|
"scope": "@medyll",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.28.0",
|
|
5
5
|
"description": "A modern, lightweight, and extensible DOM manipulation library built with TypeScript. Designed for precise element targeting and manipulation using a callback-based approach. Features include advanced DOM traversal, event handling, style management, attribute control, HTTP content loading, timers, and more. Ideal for developers seeking a modular and consistent API for dynamic web applications.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"DOM",
|
|
@@ -47,26 +47,26 @@
|
|
|
47
47
|
"svelte": "^5.0.0-next"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@playwright/test": "^1.
|
|
51
|
-
"@sveltejs/adapter-auto": "^
|
|
52
|
-
"@sveltejs/kit": "^2.20.
|
|
53
|
-
"@sveltejs/package": "^2.3.
|
|
50
|
+
"@playwright/test": "^1.52.0",
|
|
51
|
+
"@sveltejs/adapter-auto": "^6.0.0",
|
|
52
|
+
"@sveltejs/kit": "^2.20.8",
|
|
53
|
+
"@sveltejs/package": "^2.3.11",
|
|
54
54
|
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
|
55
55
|
"@types/eslint": "^9.6.1",
|
|
56
|
-
"eslint": "^9.
|
|
57
|
-
"eslint-config-prettier": "^10.1.
|
|
58
|
-
"eslint-plugin-svelte": "^3.
|
|
59
|
-
"globals": "^16.
|
|
60
|
-
"jsdom": "^26.
|
|
56
|
+
"eslint": "^9.26.0",
|
|
57
|
+
"eslint-config-prettier": "^10.1.3",
|
|
58
|
+
"eslint-plugin-svelte": "^3.5.1",
|
|
59
|
+
"globals": "^16.1.0",
|
|
60
|
+
"jsdom": "^26.1.0",
|
|
61
61
|
"prettier": "^3.5.3",
|
|
62
62
|
"prettier-plugin-svelte": "^3.3.3",
|
|
63
|
-
"svelte": "^5.
|
|
64
|
-
"svelte-check": "^4.1.
|
|
63
|
+
"svelte": "^5.28.2",
|
|
64
|
+
"svelte-check": "^4.1.7",
|
|
65
65
|
"tslib": "^2.8.1",
|
|
66
|
-
"typescript": "^5.8.
|
|
67
|
-
"typescript-eslint": "^8.
|
|
68
|
-
"vite": "^6.
|
|
69
|
-
"vitest": "^3.
|
|
66
|
+
"typescript": "^5.8.3",
|
|
67
|
+
"typescript-eslint": "^8.32.0",
|
|
68
|
+
"vite": "^6.3.5",
|
|
69
|
+
"vitest": "^3.1.3"
|
|
70
70
|
},
|
|
71
71
|
"svelte": "./dist/index.js",
|
|
72
72
|
"types": "./dist/index.d.ts",
|