@nextwebwg/html-next 1.0.0-alpha.4 → 1.0.0-alpha.5
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/generate.d.ts
CHANGED
package/dist/generate.js
CHANGED
|
@@ -4,7 +4,7 @@ import { generateVue } from "./targets/vue.js";
|
|
|
4
4
|
import { VUE_HOST_PATH, vueHostModule } from "./targets/vue-host.js";
|
|
5
5
|
import { HtmlDiagnosticError } from "./diagnostics.js";
|
|
6
6
|
import { compileComponentStylesForBuild } from "./component-styles-build.js";
|
|
7
|
-
export const GENERATOR_VERSION = "1.0.0-alpha.
|
|
7
|
+
export const GENERATOR_VERSION = "1.0.0-alpha.5";
|
|
8
8
|
export function generateComponent(definition) {
|
|
9
9
|
const vanilla = generateVanilla(definition, GENERATOR_VERSION);
|
|
10
10
|
const vue = convertedToVue(definition);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-host.d.ts","sourceRoot":"","sources":["../../src/targets/vue-host.ts"],"names":[],"mappings":"AAQA,kGAAkG;AAClG,eAAO,MAAM,aAAa,gBAAgB,CAAC;AAC3C,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAE3C,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEtD;
|
|
1
|
+
{"version":3,"file":"vue-host.d.ts","sourceRoot":"","sources":["../../src/targets/vue-host.ts"],"names":[],"mappings":"AAQA,kGAAkG;AAClG,eAAO,MAAM,aAAa,gBAAgB,CAAC;AAC3C,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAE3C,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEtD;AAkKD,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
package/dist/targets/vue-host.js
CHANGED
|
@@ -145,6 +145,10 @@ export function createDispatch(
|
|
|
145
145
|
options: DispatchOptions = {},
|
|
146
146
|
): (name: string, detail?: unknown) => boolean {
|
|
147
147
|
const { declared = {}, checks = {}, modeled = [] } = options;
|
|
148
|
+
// One change can be reported by more than one event — a choice is both a select and a change —
|
|
149
|
+
// and each carries the new value. The prop updates once per change: a value already reported in
|
|
150
|
+
// this turn of the event loop is not reported again.
|
|
151
|
+
const reported = new Map<string, unknown>();
|
|
148
152
|
return (name, detail) => {
|
|
149
153
|
const check = checks[name];
|
|
150
154
|
if (detail !== undefined && check !== undefined && !check(detail)) {
|
|
@@ -153,7 +157,12 @@ export function createDispatch(
|
|
|
153
157
|
emit?.(name, detail);
|
|
154
158
|
if (detail !== null && typeof detail === "object") {
|
|
155
159
|
for (const prop of modeled) {
|
|
156
|
-
if (prop in detail)
|
|
160
|
+
if (!(prop in detail)) continue;
|
|
161
|
+
const value = (detail as Record<string, unknown>)[prop];
|
|
162
|
+
if (reported.has(prop) && Object.is(reported.get(prop), value)) continue;
|
|
163
|
+
if (reported.size === 0) queueMicrotask(() => reported.clear());
|
|
164
|
+
reported.set(prop, value);
|
|
165
|
+
emit?.(\`update:\${prop}\`, value);
|
|
157
166
|
}
|
|
158
167
|
}
|
|
159
168
|
return root.value?.dispatchEvent(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-host.js","sourceRoot":"","sources":["../../src/targets/vue-host.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,kGAAkG;AAClG,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;AAC3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC;AAE3C,4FAA4F;AAC5F,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,IAAI,MAAM,CAAC,YAAY,kBAAkB,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"vue-host.js","sourceRoot":"","sources":["../../src/targets/vue-host.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,kGAAkG;AAClG,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;AAC3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC;AAE3C,4FAA4F;AAC5F,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,IAAI,MAAM,CAAC,YAAY,kBAAkB,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Jd,CAAC;AAEF,kFAAkF;AAClF,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO,SAAS,CAAC,6BAA6B,OAAO,+BAA+B,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC;AACvH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextwebwg/html-next",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.5",
|
|
4
4
|
"description": "Reference runtime and tools for HTML Next: Declarative HTML Components, validity on any element, and HTML Forms request construction.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|