@wcomp/elementum 0.1.0 → 0.2.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.
@@ -78,26 +78,26 @@ export class ElBadge extends Elementum {
78
78
 
79
79
  :host([variant="success"]) span {
80
80
  background: #dcfce7;
81
- color: var(--el-color-success, #16a34a);
82
- border: 1px solid rgba(22, 163, 74, 0.2);
81
+ color: #15803d;
82
+ border: 1px solid rgba(21, 128, 61, 0.25);
83
83
  }
84
84
 
85
85
  :host([variant="danger"]) span {
86
86
  background: #fee2e2;
87
- color: var(--el-color-danger, #dc2626);
88
- border: 1px solid rgba(220, 38, 38, 0.2);
87
+ color: #b91c1c;
88
+ border: 1px solid rgba(185, 28, 28, 0.25);
89
89
  }
90
90
 
91
91
  :host([variant="warning"]) span {
92
92
  background: #fef3c7;
93
- color: #b45309;
94
- border: 1px solid rgba(180, 83, 9, 0.2);
93
+ color: #92400e;
94
+ border: 1px solid rgba(146, 64, 14, 0.25);
95
95
  }
96
96
 
97
97
  :host([variant="info"]) span {
98
98
  background: #e0f2fe;
99
- color: #0284c7;
100
- border: 1px solid rgba(2, 132, 199, 0.2);
99
+ color: #0369a1;
100
+ border: 1px solid rgba(3, 105, 161, 0.25);
101
101
  }
102
102
 
103
103
  :host([variant="outline"]) span {
@@ -6,6 +6,7 @@
6
6
  import { Elementum } from '../elementum.js';
7
7
  import { html, css } from '../template.js';
8
8
  import { signal } from '../signal.js';
9
+ import { createPressBehavior } from '../behaviors/index.js';
9
10
 
10
11
  export class ElButton extends Elementum {
11
12
  static formAssociated = true;
@@ -180,6 +181,16 @@ export class ElButton extends Elementum {
180
181
  }
181
182
  }
182
183
 
184
+ rendered() {
185
+ const btn = this.root?.querySelector?.('button');
186
+ if (btn) {
187
+ createPressBehavior(this, btn, {
188
+ isDisabled: () => Boolean(this.disabled.value),
189
+ signal: this.signal,
190
+ });
191
+ }
192
+ }
193
+
183
194
  render() {
184
195
  return html`
185
196
  <button
@@ -6,6 +6,7 @@
6
6
  import { Elementum } from '../elementum.js';
7
7
  import { html, css } from '../template.js';
8
8
  import { signal, computed } from '../signal.js';
9
+ import { formatLocaleDate } from '../behaviors/index.js';
9
10
 
10
11
  const MONTH_NAMES = [
11
12
  'January', 'February', 'March', 'April', 'May', 'June',
@@ -14,6 +15,21 @@ const MONTH_NAMES = [
14
15
 
15
16
  const WEEKDAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
16
17
 
18
+ function getLocalizedMonths(locale) {
19
+ if (!locale || locale === 'en-US') return MONTH_NAMES;
20
+ return Array.from({ length: 12 }, (_, m) =>
21
+ formatLocaleDate(new Date(2026, m, 15), locale, { month: 'long' })
22
+ );
23
+ }
24
+
25
+ function getLocalizedWeekdays(locale) {
26
+ if (!locale || locale === 'en-US') return WEEKDAYS;
27
+ // 2026-01-04 is a Sunday
28
+ return Array.from({ length: 7 }, (_, d) =>
29
+ formatLocaleDate(new Date(2026, 0, 4 + d), locale, { weekday: 'short' }).slice(0, 2)
30
+ );
31
+ }
32
+
17
33
  function padZero(n) {
18
34
  return n < 10 ? '0' + n : String(n);
19
35
  }
@@ -23,16 +39,18 @@ function formatDateString(year, month, day) {
23
39
  }
24
40
 
25
41
  export class ElCalendar extends Elementum {
26
- static observedAttributes = ['value', 'min-year', 'max-year'];
42
+ static observedAttributes = ['value', 'min-year', 'max-year', 'locale'];
27
43
 
28
44
  value = signal(''); // 'YYYY-MM-DD'
29
45
  viewYear = signal(new Date().getFullYear());
30
46
  viewMonth = signal(new Date().getMonth()); // 0 - 11
31
47
  minYear = signal(new Date().getFullYear() - 50);
32
48
  maxYear = signal(new Date().getFullYear() + 20);
49
+ locale = signal('en-US');
33
50
 
34
51
  monthTitle = computed(() => {
35
- return `${MONTH_NAMES[this.viewMonth.value]} ${this.viewYear.value}`;
52
+ const months = getLocalizedMonths(this.locale.value);
53
+ return `${months[this.viewMonth.value]} ${this.viewYear.value}`;
36
54
  });
37
55
 
38
56
  static styles = css`
@@ -187,6 +205,9 @@ export class ElCalendar extends Elementum {
187
205
  const parsed = Number(this.getAttribute('max-year'));
188
206
  if (!isNaN(parsed)) this.maxYear.value = parsed;
189
207
  }
208
+ if (this.hasAttribute('locale')) {
209
+ this.locale.value = this.getAttribute('locale') || 'en-US';
210
+ }
190
211
  if (this.value.value) {
191
212
  const parts = this.value.value.split('-').map(Number);
192
213
  if (parts.length === 3) {
@@ -210,6 +231,8 @@ export class ElCalendar extends Elementum {
210
231
  } else if (name === 'max-year' && newValue) {
211
232
  const parsed = Number(newValue);
212
233
  if (!isNaN(parsed)) this.maxYear.value = parsed;
234
+ } else if (name === 'locale') {
235
+ this.locale.value = newValue || 'en-US';
213
236
  }
214
237
  return true;
215
238
  }
@@ -349,7 +372,7 @@ export class ElCalendar extends Elementum {
349
372
  @change=${this.#onMonthSelect}
350
373
  >
351
374
  ${() =>
352
- MONTH_NAMES.map(
375
+ getLocalizedMonths(this.locale.value).map(
353
376
  (name, idx) => html`
354
377
  <option
355
378
  value="${idx}"
@@ -382,7 +405,7 @@ export class ElCalendar extends Elementum {
382
405
  </div>
383
406
 
384
407
  <div class="weekdays">
385
- ${WEEKDAYS.map((w) => html`<div>${w}</div>`)}
408
+ ${() => getLocalizedWeekdays(this.locale.value).map((w) => html`<div>${w}</div>`)}
386
409
  </div>
387
410
 
388
411
  <div class="grid" role="grid">
@@ -6,6 +6,7 @@
6
6
  import { Elementum } from '../elementum.js';
7
7
  import { html, css } from '../template.js';
8
8
  import { signal } from '../signal.js';
9
+ import { announce } from '../behaviors/index.js';
9
10
 
10
11
  const LANGUAGE_LABELS = {
11
12
  html: 'HTML',
@@ -172,6 +173,7 @@ export class ElCodeBlock extends Elementum {
172
173
  }, 1500);
173
174
 
174
175
  this.emit('copy', { code: text });
176
+ announce('Code copied to clipboard', 'polite');
175
177
  }
176
178
 
177
179
  #getLanguageLabel() {
@@ -209,7 +211,7 @@ export class ElCodeBlock extends Elementum {
209
211
  `;
210
212
  }}
211
213
  <div class="code-body" part="body">
212
- <pre part="pre"><code part="code">${() => this.code.value}<slot style=${() => (this.code.value ? 'display:none;' : '')}></slot></code></pre>
214
+ <pre part="pre" tabindex="0"><code part="code">${() => this.code.value}<slot style=${() => (this.code.value ? 'display:none;' : '')}></slot></code></pre>
213
215
  ${() => {
214
216
  const langLabel = this.#getLanguageLabel();
215
217
  const hasHeader = Boolean(langLabel) && !this.compact.value;
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Elementum } from '../elementum.js';
7
7
  import { html, css } from '../template.js';
8
- import { signal } from '../signal.js';
8
+ import { signal, effect } from '../signal.js';
9
9
 
10
10
  export class ElInput extends Elementum {
11
11
  static formAssociated = true;
@@ -23,8 +23,11 @@ export class ElInput extends Elementum {
23
23
 
24
24
  connected() {
25
25
  this.required.value = this.hasAttribute('required');
26
- this.setFormValue(this.value.value);
27
- this.validate();
26
+ effect(() => {
27
+ const val = String(this.value.value ?? '');
28
+ this.setFormValue(val);
29
+ this.validate();
30
+ }, { signal: this.signal });
28
31
  }
29
32
 
30
33
  formReset() {
@@ -34,7 +37,21 @@ export class ElInput extends Elementum {
34
37
  }
35
38
 
36
39
  attributeChanged(name, oldValue, newValue) {
37
- if (name === 'required') {
40
+ if (name === 'value') {
41
+ this.value.value = newValue ?? '';
42
+ this.setFormValue(this.value.value);
43
+ this.validate();
44
+ } else if (name === 'placeholder') {
45
+ this.placeholder.value = newValue ?? '';
46
+ } else if (name === 'disabled') {
47
+ this.disabled.value = newValue !== null && newValue !== 'false';
48
+ } else if (name === 'readonly') {
49
+ this.readonly.value = newValue !== null && newValue !== 'false';
50
+ } else if (name === 'type') {
51
+ this.type.value = newValue || 'text';
52
+ } else if (name === 'size') {
53
+ this.size.value = newValue || 'md';
54
+ } else if (name === 'required') {
38
55
  this.required.value = newValue !== null && newValue !== 'false';
39
56
  this.validate();
40
57
  } else if (name === 'pattern') {
@@ -160,6 +160,7 @@ export class ElMeter extends Elementum {
160
160
  <div
161
161
  class="meter-container"
162
162
  role="meter"
163
+ aria-label=${() => this.getAttribute?.('aria-label') || 'Meter'}
163
164
  aria-valuenow=${() => this.value.value}
164
165
  aria-valuemin=${() => this.min.value}
165
166
  aria-valuemax=${() => this.max.value}
@@ -1,6 +1,7 @@
1
1
  import { Elementum } from '../elementum.js';
2
2
  import { html, css } from '../template.js';
3
3
  import { signal, effect } from '../signal.js';
4
+ import { formatLocaleNumber } from '../behaviors/index.js';
4
5
 
5
6
  /**
6
7
  * <el-number-flow>
@@ -10,15 +11,17 @@ import { signal, effect } from '../signal.js';
10
11
  * @attr {string} prefix - Optional prefix (e.g. '$' or '+')
11
12
  * @attr {string} suffix - Optional suffix (e.g. '%' or 'ms')
12
13
  * @attr {number} duration - Animation duration in ms (default: 400)
14
+ * @attr {string} locale - Optional BCP 47 locale for Intl.NumberFormat (e.g. 'en-US', 'de-DE')
13
15
  */
14
16
  export class ElNumberFlow extends Elementum {
15
- static observedAttributes = ['value', 'prefix', 'suffix', 'duration', 'animated'];
17
+ static observedAttributes = ['value', 'prefix', 'suffix', 'duration', 'animated', 'locale'];
16
18
 
17
19
  value = signal('0');
18
20
  prefix = signal('');
19
21
  suffix = signal('');
20
22
  duration = signal(400);
21
23
  animated = signal(true);
24
+ locale = signal('');
22
25
 
23
26
  connected() {
24
27
  this.#sync();
@@ -34,6 +37,7 @@ export class ElNumberFlow extends Elementum {
34
37
  if (this.hasAttribute('suffix')) this.suffix.value = this.getAttribute('suffix') || '';
35
38
  if (this.hasAttribute('duration')) this.duration.value = Number(this.getAttribute('duration')) || 400;
36
39
  if (this.hasAttribute('animated')) this.animated.value = this.getAttribute('animated') !== 'false';
40
+ if (this.hasAttribute('locale')) this.locale.value = this.getAttribute('locale') || '';
37
41
  }
38
42
 
39
43
  static styles = css`
@@ -97,7 +101,14 @@ export class ElNumberFlow extends Elementum {
97
101
  `;
98
102
 
99
103
  render() {
100
- const rawVal = () => String(this.value.value ?? '0');
104
+ const rawVal = () => {
105
+ const str = String(this.value.value ?? '0');
106
+ const loc = (this.locale.value || '').trim();
107
+ if (loc && /^-?\d+(\.\d+)?$/.test(str)) {
108
+ return formatLocaleNumber(Number(str), loc);
109
+ }
110
+ return str;
111
+ };
101
112
  const fullText = () => `${this.prefix.value}${rawVal()}${this.suffix.value}`;
102
113
 
103
114
  return html`
@@ -1,6 +1,7 @@
1
1
  import { Elementum } from '../elementum.js';
2
2
  import { html, css } from '../template.js';
3
3
  import { signal, computed } from '../signal.js';
4
+ import { announce } from '../behaviors/index.js';
4
5
 
5
6
  export class ElPagination extends Elementum {
6
7
  static observedAttributes = ['page', 'total', 'page-size', 'sibling-count'];
@@ -42,6 +43,7 @@ export class ElPagination extends Elementum {
42
43
  this.page.value = target;
43
44
  this.setAttribute('page', String(target));
44
45
  this.emit('pagechange', { page: target, pageSize: this.pageSize.value });
46
+ announce(`Page ${target} of ${this.totalPages.value}`, 'polite');
45
47
  }
46
48
  }
47
49
 
@@ -185,6 +185,7 @@ export class ElSelect extends Elementum {
185
185
  <div class="wrapper" part="wrapper">
186
186
  <select
187
187
  part="select"
188
+ aria-label=${() => this.getAttribute('aria-label') || this.placeholder.value || this.getAttribute('name') || 'Select option'}
188
189
  ?disabled=${this.disabled}
189
190
  @change=${this.#onChange}
190
191
  >
@@ -106,9 +106,9 @@ export class ElThemeSwitch extends Elementum {
106
106
  type="button"
107
107
  part="button"
108
108
  @click=${this.toggle}
109
- aria-label="Toggle color theme"
109
+ aria-label=${() => `${this.theme.value === 'dark' ? 'Dark' : 'Light'} — toggle color theme`}
110
110
  >
111
- <span class="icon">${() => (this.theme.value === 'dark' ? '🌙' : '☀️')}</span>
111
+ <span class="icon" aria-hidden="true">${() => (this.theme.value === 'dark' ? '🌙' : '☀️')}</span>
112
112
  <span>${() => (this.theme.value === 'dark' ? 'Dark' : 'Light')}</span>
113
113
  </button>
114
114
  `;
package/src/elementum.js CHANGED
@@ -5,6 +5,7 @@
5
5
 
6
6
  import { render, CSSResult, html, css } from './template.js';
7
7
  import { signal, isSignal, effect } from './signal.js';
8
+ import { setHostState } from './behaviors/index.js';
8
9
 
9
10
  export { html, css };
10
11
 
@@ -138,6 +139,15 @@ export class Elementum extends BaseElement {
138
139
  this.internals.setValidity(flags, message);
139
140
  }
140
141
  }
142
+ this.setHostState('invalid', isInvalid);
143
+ }
144
+
145
+ /**
146
+ * Reflect a standardized component state onto the host element via both
147
+ * `data-<name>` attributes and `ElementInternals.states` (`:state(<name>)`).
148
+ */
149
+ setHostState(name, active) {
150
+ setHostState(this, name, active);
141
151
  }
142
152
 
143
153
  setCustomValidity(message = '') {
@@ -368,8 +378,8 @@ export class Elementum extends BaseElement {
368
378
  }
369
379
  this.root = this.shadowRoot;
370
380
 
371
- // 2. Adopt Constructable Stylesheets
372
- if (this.constructor.styles) {
381
+ // 2. Adopt Constructable Stylesheets (skip when `unstyled` attribute is present for headless styling)
382
+ if (this.constructor.styles && !this.hasAttribute('unstyled')) {
373
383
  const rawStyles = Array.isArray(this.constructor.styles)
374
384
  ? this.constructor.styles
375
385
  : [this.constructor.styles];
@@ -417,6 +427,11 @@ export class Elementum extends BaseElement {
417
427
  }
418
428
  }
419
429
 
430
+ // Reflect initial disabled host state if present
431
+ if (this.hasAttribute('disabled') && this.getAttribute('disabled') !== 'false') {
432
+ this.setHostState('disabled', true);
433
+ }
434
+
420
435
  // 4. User lifecycle hook
421
436
  if (typeof this.connected === 'function') {
422
437
  this.connected();
@@ -455,6 +470,10 @@ export class Elementum extends BaseElement {
455
470
  attributeChangedCallback(name, oldValue, newValue) {
456
471
  if (oldValue === newValue) return;
457
472
 
473
+ if (name === 'disabled') {
474
+ this.setHostState('disabled', newValue !== null && newValue !== 'false');
475
+ }
476
+
458
477
  this.#syncingAttr = true;
459
478
  try {
460
479
  if (typeof this.attributeChanged === 'function') {
package/src/index.d.ts CHANGED
@@ -776,6 +776,92 @@ export function renderComponentToDSD(
776
776
  lightDOMChildren?: string
777
777
  ): string;
778
778
 
779
+ // ==========================================
780
+ // AG-UI Protocol Adapter
781
+ // ==========================================
782
+
783
+ export function getByPointer(obj: any, pointer: string): any;
784
+ export function applyJsonPatch<T = any>(target: T, patch?: Array<{ op: 'add' | 'replace' | 'remove'; path: string; value?: any }>): T;
785
+ export function createAgUiStore<T extends Record<string, any> = Record<string, any>>(initialState?: T): {
786
+ state: Signal<T>;
787
+ status: Signal<'idle' | 'running' | 'finished' | 'error'>;
788
+ runId: Signal<string>;
789
+ stepName: Signal<string>;
790
+ thinking: Signal<boolean>;
791
+ thinkingText: Signal<string>;
792
+ currentText: Signal<string>;
793
+ messages: Signal<any[]>;
794
+ toolCalls: Signal<any[]>;
795
+ error: Signal<string | null>;
796
+ events: Signal<any[]>;
797
+ dispatch: (event: any) => void;
798
+ pathSignal: <V = any>(pointer: string, fallback?: V) => Signal<V>;
799
+ onEvent: (listener: (event: any) => void) => () => void;
800
+ bindComponents: (bindings?: Record<string, any>) => () => void;
801
+ connectSSE: (source: Response | ReadableStream | AsyncIterable<any>) => Promise<void>;
802
+ };
803
+
804
+ // ==========================================
805
+ // Behavior Controllers (React-Aria-Inspired)
806
+ // ==========================================
807
+
808
+ export function setHostState(host: Element, name: string, active: boolean): void;
809
+ export function isRTL(el?: Element | null): boolean;
810
+ export function formatLocaleNumber(value: number | string, locale?: string, options?: Intl.NumberFormatOptions): string;
811
+ export function formatLocaleDate(date: Date | number | string, locale?: string, options?: Intl.DateTimeFormatOptions): string;
812
+ export function announce(message: string, politeness?: 'polite' | 'assertive'): void;
813
+ export function clearAnnouncer(): void;
814
+ export function createPressBehavior(
815
+ host: Element,
816
+ target?: EventTarget,
817
+ options?: { isDisabled?: () => boolean; onPress?: (e: Event) => void; signal?: AbortSignal }
818
+ ): () => void;
819
+ export function createRovingFocus(
820
+ host: Element,
821
+ options?: {
822
+ getItems: () => HTMLElement[];
823
+ orientation?: 'horizontal' | 'vertical' | 'both' | (() => 'horizontal' | 'vertical' | 'both');
824
+ loop?: boolean;
825
+ typeahead?: boolean;
826
+ onFocusItem?: (el: HTMLElement, index: number) => void;
827
+ signal?: AbortSignal;
828
+ }
829
+ ): () => void;
830
+ export function createDismissableLayer(
831
+ host: Element,
832
+ options?: {
833
+ isOpen?: () => boolean;
834
+ onDismiss: (reason: 'escape' | 'outside-click', event: Event) => void;
835
+ closeOnEscape?: boolean;
836
+ closeOnOutsideClick?: boolean;
837
+ signal?: AbortSignal;
838
+ }
839
+ ): () => void;
840
+ export function createSelectionBehavior<K = string>(options?: {
841
+ mode?: 'single' | 'multiple' | 'none';
842
+ getKeys?: () => K[];
843
+ initialKeys?: K[];
844
+ disabledKeys?: K[];
845
+ onSelectionChange?: (selected: Set<K>) => void;
846
+ }): {
847
+ selectedKeys: Signal<Set<K>>;
848
+ isSelected: (key: K) => boolean;
849
+ select: (key: K, opts?: { shiftKey?: boolean; ctrlKey?: boolean; metaKey?: boolean; toggle?: boolean }) => void;
850
+ toggle: (key: K) => void;
851
+ selectRange: (fromKey: K, toKey: K) => void;
852
+ selectAll: () => void;
853
+ clear: () => void;
854
+ };
855
+ export function createReorderBehavior(
856
+ host: Element,
857
+ options: {
858
+ getItems: () => HTMLElement[];
859
+ orientation?: 'vertical' | 'horizontal';
860
+ onReorder: (detail: { fromIndex: number; toIndex: number; item: HTMLElement }) => void;
861
+ signal?: AbortSignal;
862
+ }
863
+ ): () => void;
864
+
779
865
  // ==========================================
780
866
  // DOM & JSX Global Typings
781
867
  // ==========================================
package/src/index.js CHANGED
@@ -97,3 +97,16 @@ export { createAgUiStore, applyJsonPatch, getByPointer } from './ag-ui.js';
97
97
 
98
98
  // Server-Side Rendering (Declarative Shadow DOM)
99
99
  export { renderTemplateToString, renderComponentToDSD } from './ssr.js';
100
+ export {
101
+ setHostState,
102
+ isRTL,
103
+ formatLocaleNumber,
104
+ formatLocaleDate,
105
+ announce,
106
+ clearAnnouncer,
107
+ createPressBehavior,
108
+ createRovingFocus,
109
+ createDismissableLayer,
110
+ createSelectionBehavior,
111
+ createReorderBehavior,
112
+ } from './behaviors/index.js';
package/src/signal.js CHANGED
@@ -110,7 +110,9 @@ export class Computed extends Signal {
110
110
  super(undefined);
111
111
  this._getter = getter;
112
112
  this._dirty = true;
113
+ this._computing = false;
113
114
  this._computedEffect = new ReactiveEffect(() => {
115
+ if (this._dirty) return;
114
116
  this._dirty = true;
115
117
  // Notify downstreams
116
118
  const subs = Array.from(this.subscribers);
@@ -120,17 +122,26 @@ export class Computed extends Signal {
120
122
  });
121
123
  }
122
124
 
125
+ #evaluate() {
126
+ if (this._computing) {
127
+ throw new Error('Circular dependency detected in computed signal');
128
+ }
129
+ this._computing = true;
130
+ effectStack.push(activeEffect);
131
+ activeEffect = this._computedEffect;
132
+ this._computedEffect.cleanup();
133
+ try {
134
+ this._value = this._getter();
135
+ this._dirty = false;
136
+ } finally {
137
+ activeEffect = effectStack.pop();
138
+ this._computing = false;
139
+ }
140
+ }
141
+
123
142
  get value() {
124
143
  if (this._dirty) {
125
- effectStack.push(activeEffect);
126
- activeEffect = this._computedEffect;
127
- this._computedEffect.cleanup();
128
- try {
129
- this._value = this._getter();
130
- this._dirty = false;
131
- } finally {
132
- activeEffect = effectStack.pop();
133
- }
144
+ this.#evaluate();
134
145
  }
135
146
  if (activeEffect) {
136
147
  this.subscribers.add(activeEffect);
@@ -138,6 +149,13 @@ export class Computed extends Signal {
138
149
  }
139
150
  return this._value;
140
151
  }
152
+
153
+ peek() {
154
+ if (this._dirty) {
155
+ this.#evaluate();
156
+ }
157
+ return this._value;
158
+ }
141
159
  }
142
160
 
143
161
  export function computed(getter) {
@@ -149,10 +167,12 @@ class ReactiveEffect {
149
167
  this.fn = fn;
150
168
  this.dependencies = new Set();
151
169
  this.active = true;
170
+ this._running = false;
152
171
  }
153
172
 
154
173
  run() {
155
- if (!this.active) return;
174
+ if (!this.active || this._running) return;
175
+ this._running = true;
156
176
  this.cleanup();
157
177
  effectStack.push(activeEffect);
158
178
  activeEffect = this;
@@ -160,6 +180,7 @@ class ReactiveEffect {
160
180
  this.fn();
161
181
  } finally {
162
182
  activeEffect = effectStack.pop();
183
+ this._running = false;
163
184
  }
164
185
  }
165
186
 
package/src/ssr.js CHANGED
@@ -38,7 +38,7 @@ function resolveValue(val) {
38
38
  if (val instanceof TemplateResult) {
39
39
  return renderTemplateToString(val);
40
40
  }
41
- return String(val);
41
+ return escapeHtml(String(val));
42
42
  }
43
43
 
44
44
  /**