@adia-ai/web-components 0.5.15 → 0.5.17

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.
@@ -95,3 +95,87 @@ describe('html template — §250 (v0.5.11) ?attr=${bool} silent-failure trap',
95
95
  expect(warnSpy).not.toHaveBeenCalled();
96
96
  });
97
97
  });
98
+
99
+ describe('html template — FB-40 (v0.5.16) apostrophe in HTML comments does NOT mis-classify subsequent placeholders', () => {
100
+ // FEEDBACK-06 §1 P0 (long resolved) made `inTag()` comment-aware:
101
+ // when scan() hits `<!--` outside a string context, it jumps past
102
+ // `-->` wholesale. FB-40 (filed 2026-05-16 post-v0.5.16 cut) reported
103
+ // crashes attributed to apostrophes in comments. This suite verifies
104
+ // empirically that the comment-aware logic still holds — the FB-40
105
+ // diagnosis is mistaken about the mechanism (the existing fix covers
106
+ // the apostrophe-in-comment case).
107
+
108
+ let container;
109
+ let warnSpy;
110
+
111
+ beforeEach(() => {
112
+ container = document.createElement('div');
113
+ document.body.appendChild(container);
114
+ warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});
115
+ });
116
+
117
+ afterEach(() => {
118
+ container.remove();
119
+ warnSpy.mockRestore();
120
+ });
121
+
122
+ it('@event=${handler} placeholder AFTER apostrophe-bearing comment is classified as attribute-position', () => {
123
+ let received = null;
124
+ const handler = (e) => { received = e; };
125
+ const tpl = html`
126
+ <div>
127
+ <!-- editor-shell's named slots -->
128
+ <button data-test="probe" @click=${handler}>X</button>
129
+ </div>
130
+ `;
131
+ stamp(tpl, container);
132
+ const btn = container.querySelector('[data-test="probe"]');
133
+ expect(btn).not.toBeNull();
134
+ btn.click();
135
+ expect(received).not.toBeNull();
136
+ expect(received.type).toBe('click');
137
+ });
138
+
139
+ it('double-quote in HTML comment does not mis-classify subsequent attribute placeholder', () => {
140
+ const tpl = html`
141
+ <div>
142
+ <!-- the "Stop Override" button below -->
143
+ <button data-test="probe" data-id=${'42'}></button>
144
+ </div>
145
+ `;
146
+ stamp(tpl, container);
147
+ const btn = container.querySelector('[data-test="probe"]');
148
+ expect(btn).not.toBeNull();
149
+ expect(btn.getAttribute('data-id')).toBe('42');
150
+ });
151
+
152
+ it('multiple apostrophes across multiple comments still keep subsequent placeholders attribute-position', () => {
153
+ let received = null;
154
+ const tpl = html`
155
+ <div>
156
+ <!-- one's first comment -->
157
+ <span>x</span>
158
+ <!-- two's second comment -->
159
+ <button data-test="probe" @click=${(e) => { received = e; }}></button>
160
+ </div>
161
+ `;
162
+ stamp(tpl, container);
163
+ container.querySelector('[data-test="probe"]').click();
164
+ expect(received).not.toBeNull();
165
+ });
166
+
167
+ it('apostrophe + em-dash (U+2014) in a single comment does not break parsing', () => {
168
+ // dts-export-drawer.ts case from FB-40's cited crashes:
169
+ // <!-- 2026-05-14 — migrated number inputs ... -->
170
+ let received = null;
171
+ const tpl = html`
172
+ <div>
173
+ <!-- 2026-05-14 — author's notes about migrated number inputs -->
174
+ <button data-test="probe" @click=${(e) => { received = e; }}></button>
175
+ </div>
176
+ `;
177
+ stamp(tpl, container);
178
+ container.querySelector('[data-test="probe"]').click();
179
+ expect(received).not.toBeNull();
180
+ });
181
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-components",
3
- "version": "0.5.15",
3
+ "version": "0.5.17",
4
4
  "description": "AdiaUI web components — vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui-runtime.",
5
5
  "type": "module",
6
6
  "types": "./index.d.ts",