juxscript 1.1.81 → 1.1.82

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "totalComponents": 63,
3
- "generatedAt": "2026-02-12T04:07:13.437Z",
3
+ "generatedAt": "2026-02-12T04:14:03.006Z",
4
4
  "components": [
5
5
  {
6
6
  "file": "alert.js",
@@ -13,8 +13,16 @@ export declare class Paragraph extends BaseComponent<ParagraphState> {
13
13
  constructor(id: string, options?: ParagraphOptions);
14
14
  protected getTriggerEvents(): readonly string[];
15
15
  protected getCallbackEvents(): readonly string[];
16
+ /**
17
+ * ✅ Reactive update implementation for Paragraph
18
+ * Called automatically when this.state[prop] changes via Proxy
19
+ */
16
20
  update(prop: string, value: any): void;
17
21
  content(value: string): this;
22
+ /**
23
+ * Alias for content() - more intuitive naming
24
+ */
25
+ text(value: string): this;
18
26
  render(targetId?: string | HTMLElement | BaseComponent<any>): this;
19
27
  }
20
28
  export declare function paragraph(id: string, options?: ParagraphOptions): Paragraph;
@@ -1 +1 @@
1
- {"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["paragraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAMxD,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,cAAc,GAAG;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,SAAU,SAAQ,aAAa,CAAC,cAAc,CAAC;gBAC5C,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQtD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAA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CAAC,GAAG,IAAI;CAuCrE;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,SAAS,CAE/E"}
@@ -16,8 +16,33 @@ export class Paragraph extends BaseComponent {
16
16
  getCallbackEvents() {
17
17
  return CALLBACK_EVENTS;
18
18
  }
19
+ /**
20
+ * ✅ Reactive update implementation for Paragraph
21
+ * Called automatically when this.state[prop] changes via Proxy
22
+ */
19
23
  update(prop, value) {
20
- // No reactive updates needed
24
+ const el = document.getElementById(this._id);
25
+ if (!el)
26
+ return;
27
+ // Handle paragraph-specific properties
28
+ switch (prop) {
29
+ case 'content':
30
+ el.textContent = value;
31
+ break;
32
+ case 'class':
33
+ // Preserve base jux-paragraph class, add custom classes
34
+ const baseClass = 'jux-paragraph';
35
+ const userClasses = value.split(' ').filter((c) => c);
36
+ el.className = [baseClass, ...userClasses].join(' ');
37
+ break;
38
+ case 'style':
39
+ el.setAttribute('style', value);
40
+ break;
41
+ default:
42
+ // Call parent for base properties (visible, disabled, loading, etc.)
43
+ super.update(prop, value);
44
+ break;
45
+ }
21
46
  }
22
47
  /* ═════════════════════════════════════════════════════════════════
23
48
  * FLUENT API
@@ -27,9 +52,15 @@ export class Paragraph extends BaseComponent {
27
52
  // - bind(), sync(), renderTo()
28
53
  // - All other base methods
29
54
  content(value) {
30
- this.state.content = value;
55
+ this.state.content = value; // ✅ Triggers update()
31
56
  return this;
32
57
  }
58
+ /**
59
+ * Alias for content() - more intuitive naming
60
+ */
61
+ text(value) {
62
+ return this.content(value);
63
+ }
33
64
  /* ═════════════════════════════════════════════════════════════════
34
65
  * RENDER
35
66
  * ═════════════════════════════════════════════════════════════════ */
@@ -33,8 +33,36 @@ export class Paragraph extends BaseComponent<ParagraphState> {
33
33
  return CALLBACK_EVENTS;
34
34
  }
35
35
 
36
+ /**
37
+ * ✅ Reactive update implementation for Paragraph
38
+ * Called automatically when this.state[prop] changes via Proxy
39
+ */
36
40
  update(prop: string, value: any): void {
37
- // No reactive updates needed
41
+ const el = document.getElementById(this._id);
42
+ if (!el) return;
43
+
44
+ // Handle paragraph-specific properties
45
+ switch (prop) {
46
+ case 'content':
47
+ el.textContent = value;
48
+ break;
49
+
50
+ case 'class':
51
+ // Preserve base jux-paragraph class, add custom classes
52
+ const baseClass = 'jux-paragraph';
53
+ const userClasses = value.split(' ').filter((c: string) => c);
54
+ el.className = [baseClass, ...userClasses].join(' ');
55
+ break;
56
+
57
+ case 'style':
58
+ el.setAttribute('style', value);
59
+ break;
60
+
61
+ default:
62
+ // Call parent for base properties (visible, disabled, loading, etc.)
63
+ super.update(prop, value);
64
+ break;
65
+ }
38
66
  }
39
67
 
40
68
  /* ═════════════════════════════════════════════════════════════════
@@ -47,10 +75,17 @@ export class Paragraph extends BaseComponent<ParagraphState> {
47
75
  // - All other base methods
48
76
 
49
77
  content(value: string): this {
50
- this.state.content = value;
78
+ this.state.content = value; // ✅ Triggers update()
51
79
  return this;
52
80
  }
53
81
 
82
+ /**
83
+ * Alias for content() - more intuitive naming
84
+ */
85
+ text(value: string): this {
86
+ return this.content(value);
87
+ }
88
+
54
89
  /* ═════════════════════════════════════════════════════════════════
55
90
  * RENDER
56
91
  * ═════════════════════════════════════════════════════════════════ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.1.81",
3
+ "version": "1.1.82",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
6
  "main": "index.js",