@atom.io/spa 0.0.9 → 0.0.11
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/README.md +30 -10
- package/README.mdx +16 -5
- package/dist/BrandMarkScene-BeWazldB.js +140 -0
- package/dist/BrandMarkScene-BeWazldB.js.map +1 -0
- package/dist/astro-application.d.ts +1 -1
- package/dist/astro-application.js +1 -1
- package/dist/astro-client.d.ts +1 -1
- package/dist/astro-client.js +5 -5
- package/dist/{astro-context-OdlexHR4.js → astro-context-B9XKrz8c.js} +1 -1
- package/dist/{astro-context-OdlexHR4.js.map → astro-context-B9XKrz8c.js.map} +1 -1
- package/dist/astro-middleware.js +2 -2
- package/dist/{development/astro-request-DRKvDjsO.js → astro-request-C0eYQlmS.js} +2 -2
- package/dist/{astro-request-DRKvDjsO.js.map → astro-request-C0eYQlmS.js.map} +1 -1
- package/dist/astro-resumability-client.d.ts +1 -1
- package/dist/astro-resumability-client.js +1 -1
- package/dist/astro-resumability-server.js +1 -1
- package/dist/astro-server.js +4 -4
- package/dist/{astro-shared-KxK9OUSj.d.ts → astro-shared-C-iO4PVU.d.ts} +2 -2
- package/dist/{astro-shared-KxK9OUSj.d.ts.map → astro-shared-C-iO4PVU.d.ts.map} +1 -1
- package/dist/{astro-shared-DBwINQav.js → astro-shared-CwBaV3Xu.js} +2 -2
- package/dist/{astro-shared-DBwINQav.js.map → astro-shared-CwBaV3Xu.js.map} +1 -1
- package/dist/astro.d.ts +2 -2
- package/dist/astro.js +1 -1
- package/dist/brand-css.d.ts +2 -0
- package/dist/brand-model.d.ts +32 -0
- package/dist/brand-model.d.ts.map +1 -0
- package/dist/brand-model.js +120 -0
- package/dist/brand-model.js.map +1 -0
- package/dist/brand.css +37 -0
- package/dist/brand.d.ts +13 -0
- package/dist/brand.d.ts.map +1 -0
- package/dist/brand.js +94 -0
- package/dist/brand.js.map +1 -0
- package/dist/{capabilities-ChgSs6bp.d.ts → capabilities-BNnXgvo5.d.ts} +3 -3
- package/dist/{capabilities-ChgSs6bp.d.ts.map → capabilities-BNnXgvo5.d.ts.map} +1 -1
- package/dist/client.min.js +1 -1
- package/dist/{core-DD2giR6E.js → core-N07x1OaR.js} +1 -1
- package/dist/{core-DD2giR6E.js.map → core-N07x1OaR.js.map} +1 -1
- package/dist/development/BrandMarkScene-B282kBA3.js +140 -0
- package/dist/development/BrandMarkScene-B282kBA3.js.map +1 -0
- package/dist/development/astro-application.js +1 -1
- package/dist/development/astro-client.js +5 -5
- package/dist/development/{astro-context-OdlexHR4.js → astro-context-B9XKrz8c.js} +1 -1
- package/dist/development/{astro-context-OdlexHR4.js.map → astro-context-B9XKrz8c.js.map} +1 -1
- package/dist/development/astro-middleware.js +2 -2
- package/dist/{astro-request-DRKvDjsO.js → development/astro-request-C0eYQlmS.js} +2 -2
- package/dist/development/{astro-request-DRKvDjsO.js.map → astro-request-C0eYQlmS.js.map} +1 -1
- package/dist/development/astro-resumability-client.js +1 -1
- package/dist/development/astro-resumability-server.js +1 -1
- package/dist/development/astro-server.js +4 -4
- package/dist/development/{astro-shared-DBwINQav.js → astro-shared-CwBaV3Xu.js} +2 -2
- package/dist/development/{astro-shared-DBwINQav.js.map → astro-shared-CwBaV3Xu.js.map} +1 -1
- package/dist/development/astro.js +1 -1
- package/dist/development/brand-model.js +120 -0
- package/dist/development/brand-model.js.map +1 -0
- package/dist/development/brand.css +37 -0
- package/dist/development/brand.js +94 -0
- package/dist/development/brand.js.map +1 -0
- package/dist/development/{core-DrUd8x25.js → core-D1FWUMMC.js} +1 -1
- package/dist/development/{core-DrUd8x25.js.map → core-D1FWUMMC.js.map} +1 -1
- package/dist/development/{dom-BRFv7FP_.js → dom-C1cVf5Vm.js} +6 -5
- package/dist/development/dom-C1cVf5Vm.js.map +1 -0
- package/dist/development/floating.js +1 -1
- package/dist/development/floating.js.map +1 -1
- package/dist/development/hot.js +3 -3
- package/dist/development/hot.js.map +1 -1
- package/dist/{identity-oFU5p-Qj.js → development/identity-DWHH6jbd.js} +3 -3
- package/dist/development/{identity-DwB8MTM1.js.map → identity-DWHH6jbd.js.map} +1 -1
- package/dist/development/index.js +4 -4
- package/dist/development/{jsx-runtime-BGDPK50B.js → jsx-runtime-B2XxfA3E.js} +1 -1
- package/dist/development/{jsx-runtime-BGDPK50B.js.map → jsx-runtime-B2XxfA3E.js.map} +1 -1
- package/dist/development/jsx-runtime.js +1 -1
- package/dist/development/konva.js +4 -4
- package/dist/development/motion.js +39 -20
- package/dist/development/motion.js.map +1 -1
- package/dist/development/renderer.js +3 -3
- package/dist/{server-renderer-BYFDmqnM.js → development/server-renderer-B-L5tNg7.js} +4 -4
- package/dist/development/{server-renderer-u1-c5PGd.js.map → server-renderer-B-L5tNg7.js.map} +1 -1
- package/dist/development/server.js +1 -1
- package/dist/development/{src-CB7ruwRs.js → src-By4JY4qf.js} +2 -2
- package/dist/development/{src-CB7ruwRs.js.map → src-By4JY4qf.js.map} +1 -1
- package/dist/development/three-F5D1OnE9.js +527 -0
- package/dist/development/three-F5D1OnE9.js.map +1 -0
- package/dist/development/three.js +1 -509
- package/dist/development/{vite-WUiz1ju6.js → vite-BKxEE-ZO.js} +1 -1
- package/dist/development/{vite-WUiz1ju6.js.map → vite-BKxEE-ZO.js.map} +1 -1
- package/dist/development/vite.js +1 -1
- package/dist/{dom--HZvmgqd.js → dom-BbfEAPpR.js} +6 -5
- package/dist/dom-BbfEAPpR.js.map +1 -0
- package/dist/floating.d.ts +1 -1
- package/dist/floating.js +1 -1
- package/dist/floating.js.map +1 -1
- package/dist/hot.d.ts +1 -1
- package/dist/hot.d.ts.map +1 -1
- package/dist/hot.js +1 -1
- package/dist/hot.js.map +1 -1
- package/dist/{development/identity-DwB8MTM1.js → identity-wPtz6EJM.js} +3 -3
- package/dist/{identity-oFU5p-Qj.js.map → identity-wPtz6EJM.js.map} +1 -1
- package/dist/{index-DdA39aMv.d.ts → index-2AKIR8up.d.ts} +4 -4
- package/dist/{index-DdA39aMv.d.ts.map → index-2AKIR8up.d.ts.map} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/{jsx-runtime-BGDPK50B.js → jsx-runtime-B2XxfA3E.js} +1 -1
- package/dist/{jsx-runtime-BGDPK50B.js.map → jsx-runtime-B2XxfA3E.js.map} +1 -1
- package/dist/{jsx-runtime-CCvcEosg.d.ts → jsx-runtime-CjiJSx5m.d.ts} +2 -2
- package/dist/{jsx-runtime-CCvcEosg.d.ts.map → jsx-runtime-CjiJSx5m.d.ts.map} +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/konva.d.ts +3 -3
- package/dist/konva.js +4 -4
- package/dist/motion.d.ts +3 -1
- package/dist/motion.d.ts.map +1 -1
- package/dist/motion.js +39 -20
- package/dist/motion.js.map +1 -1
- package/dist/renderer.d.ts +1 -1
- package/dist/renderer.js +3 -3
- package/dist/{development/server-renderer-u1-c5PGd.js → server-renderer-CjTOgG1b.js} +4 -4
- package/dist/{server-renderer-BYFDmqnM.js.map → server-renderer-CjTOgG1b.js.map} +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/size.json +13 -13
- package/dist/{src-B2W_TA_X.js → src-BQlLP70K.js} +2 -2
- package/dist/{src-B2W_TA_X.js.map → src-BQlLP70K.js.map} +1 -1
- package/dist/three-DGOOlFXk.js +527 -0
- package/dist/three-DGOOlFXk.js.map +1 -0
- package/dist/three.d.ts +24 -3
- package/dist/three.d.ts.map +1 -1
- package/dist/three.js +1 -509
- package/dist/{vite-WUiz1ju6.js → vite-BKxEE-ZO.js} +1 -1
- package/dist/{vite-WUiz1ju6.js.map → vite-BKxEE-ZO.js.map} +1 -1
- package/dist/vite.js +1 -1
- package/package.json +43 -23
- package/src/BrandMark.module.css +25 -0
- package/src/BrandMark.tsx +106 -0
- package/src/BrandMarkScene.module.css +10 -0
- package/src/BrandMarkScene.tsx +116 -0
- package/src/brand-css.d.ts +2 -0
- package/src/brand-model.ts +177 -0
- package/src/brand.ts +3 -0
- package/src/dom.ts +8 -1
- package/src/hot.ts +3 -2
- package/src/lasertag.d.ts +1 -0
- package/src/motion-layout.ts +55 -26
- package/src/motion.ts +3 -0
- package/src/three.ts +69 -22
- package/dist/development/dom-BRFv7FP_.js.map +0 -1
- package/dist/development/three.js.map +0 -1
- package/dist/dom--HZvmgqd.js.map +0 -1
- package/dist/three.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hot.js","names":[],"sources":["../../src/hot.ts"],"sourcesContent":["import { IMPLICIT } from \"atom.io/internal\"\n\nimport type { Component, Root, RootOptions } from \"./core.ts\"\nimport { onCleanup, owner } from \"./core.ts\"\n\ninterface Handle {\n\tdispose(): void\n\tflush(): void\n}\ntype Factory = (options: RootOptions, before: Node | null) => Handle\ninterface View {\n\tmodules: Set<string>\n\toptions: RootOptions\n\trefreshing: boolean\n\trefresh(): void\n\treport(error: unknown): void\n}\n\nfunction createHotRuntime() {\n\tconst components = new Map<string, { current: Component; proxy: Component }>()\n\tconst roots = new WeakMap<Root, View>()\n\tconst views = new Set<View>()\n\tlet mounting: View | undefined\n\tfunction track(root: Root): void {\n\t\tif (mounting) {\n\t\t\troots.set(root, mounting)\n\t\t\tmounting.options.idPrefix ??= root._prefix\n\t\t}\n\t}\n\tfunction onDispose(cleanup: () => void): void {\n\t\tconst view = roots.get(owner!._root)\n\t\tonCleanup(() => {\n\t\t\tif (!view?.refreshing) cleanup()\n\t\t})\n\t}\n\tfunction register<T extends Component>(\n\t\tid: string,\n\t\tname: string,\n\t\timplementation: T,\n\t): T {\n\t\tconst key = JSON.stringify([id, name])\n\t\tlet record = components.get(key)\n\t\tif (record) record.current = implementation\n\t\telse {\n\t\t\tconst created = {\n\t\t\t\tcurrent: implementation as Component,\n\t\t\t\tproxy: null! as Component,\n\t\t\t}\n\t\t\tcreated.proxy = Object.assign(\n\t\t\t\t(
|
|
1
|
+
{"version":3,"file":"hot.js","names":[],"sources":["../../src/hot.ts"],"sourcesContent":["import { IMPLICIT } from \"atom.io/internal\"\n\nimport type { Component, Root, RootOptions } from \"./core.ts\"\nimport { onCleanup, owner } from \"./core.ts\"\n\ninterface Handle {\n\tdispose(): void\n\tflush(): void\n}\ntype Factory = (options: RootOptions, before: Node | null) => Handle\ninterface View {\n\tmodules: Set<string>\n\toptions: RootOptions\n\trefreshing: boolean\n\trefresh(): void\n\treport(error: unknown): void\n}\n\nfunction createHotRuntime() {\n\tconst components = new Map<string, { current: Component; proxy: Component }>()\n\tconst roots = new WeakMap<Root, View>()\n\tconst views = new Set<View>()\n\tlet mounting: View | undefined\n\tfunction track(root: Root): void {\n\t\tif (mounting) {\n\t\t\troots.set(root, mounting)\n\t\t\tmounting.options.idPrefix ??= root._prefix\n\t\t}\n\t}\n\tfunction onDispose(cleanup: () => void): void {\n\t\tconst view = roots.get(owner!._root)\n\t\tonCleanup(() => {\n\t\t\tif (!view?.refreshing) cleanup()\n\t\t})\n\t}\n\tfunction register<T extends Component>(\n\t\tid: string,\n\t\tname: string,\n\t\timplementation: T,\n\t): T {\n\t\tconst key = JSON.stringify([id, name])\n\t\tlet record = components.get(key)\n\t\tif (record) record.current = implementation\n\t\telse {\n\t\t\tconst created = {\n\t\t\t\tcurrent: implementation as Component,\n\t\t\t\tproxy: null! as Component,\n\t\t\t}\n\t\t\tcreated.proxy = Object.assign(\n\t\t\t\t(...args: Parameters<Component>) => {\n\t\t\t\t\tif (owner) {\n\t\t\t\t\t\tconst root = owner._root\n\t\t\t\t\t\tconst view = roots.get(root) ?? mounting\n\t\t\t\t\t\tif (view) {\n\t\t\t\t\t\t\troots.set(root, view)\n\t\t\t\t\t\t\tview.options.idPrefix ??= root._prefix\n\t\t\t\t\t\t\tview.modules.add(id)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Compiled JSX mount helpers can take options after their first argument.\n\t\t\t\t\treturn created.current(...args)\n\t\t\t\t},\n\t\t\t\t{ spa: true },\n\t\t\t)\n\t\t\trecord = created\n\t\t\tcomponents.set(key, record)\n\t\t}\n\t\treturn record.proxy as T\n\t}\n\tfunction manage(\n\t\tfactory: Factory,\n\t\toptions: RootOptions,\n\t\thost?: Element,\n\t): Handle {\n\t\tconst settings = { ...options, store: options.store ?? IMPLICIT.STORE }\n\t\tconst anchor = host?.ownerDocument.createComment(`spa-hot`)\n\t\tlet current: Handle\n\t\tlet errorNode: HTMLElement | undefined\n\t\tlet disposed = false\n\t\tconst placeAnchor = () => {\n\t\t\tif (!anchor || anchor.parentNode) return\n\t\t\tlet inside = false\n\t\t\tfor (const node of [...host!.childNodes]) {\n\t\t\t\tif (node.nodeType === 8 && node.nodeValue === `w:${settings.idPrefix}`)\n\t\t\t\t\tinside = true\n\t\t\t\tif (inside && node.nodeType === 8 && node.nodeValue === `/w`) {\n\t\t\t\t\thost!.insertBefore(anchor, node.nextSibling)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\thost!.append(anchor)\n\t\t}\n\t\tconst boot = () => {\n\t\t\tconst previous = mounting\n\t\t\tmounting = view\n\t\t\ttry {\n\t\t\t\tcurrent = factory(settings, anchor?.parentNode ? anchor : null)\n\t\t\t} finally {\n\t\t\t\tmounting = previous\n\t\t\t}\n\t\t}\n\t\tconst view: View = {\n\t\t\tmodules: new Set(),\n\t\t\toptions: settings,\n\t\t\trefreshing: false,\n\t\t\trefresh() {\n\t\t\t\tview.refreshing = true\n\t\t\t\ttry {\n\t\t\t\t\tplaceAnchor()\n\t\t\t\t\tcurrent.dispose()\n\t\t\t\t\terrorNode?.remove()\n\t\t\t\t\tboot()\n\t\t\t\t} finally {\n\t\t\t\t\tview.refreshing = false\n\t\t\t\t}\n\t\t\t},\n\t\t\treport(error) {\n\t\t\t\tconst target =\n\t\t\t\t\thost ?? (typeof document === `undefined` ? undefined : document.body)\n\t\t\t\tif (target) {\n\t\t\t\t\terrorNode = target.ownerDocument.createElement(`pre`)\n\t\t\t\t\terrorNode.setAttribute(`data-spa-hot-error`, ``)\n\t\t\t\t\terrorNode.textContent = `SPA hot refresh failed: ${String(error)}`\n\t\t\t\t\ttarget.insertBefore(errorNode, anchor?.parentNode ? anchor : null)\n\t\t\t\t}\n\t\t\t\toptions.onError?.(error)\n\t\t\t},\n\t\t}\n\t\tviews.add(view)\n\t\ttry {\n\t\t\tboot()\n\t\t} catch (error) {\n\t\t\tviews.delete(view)\n\t\t\tthrow error\n\t\t}\n\t\tif (view.modules.size) placeAnchor()\n\t\treturn {\n\t\t\tflush() {\n\t\t\t\tcurrent.flush()\n\t\t\t},\n\t\t\tdispose() {\n\t\t\t\tif (disposed) return\n\t\t\t\tdisposed = true\n\t\t\t\tviews.delete(view)\n\t\t\t\terrorNode?.remove()\n\t\t\t\tanchor?.remove()\n\t\t\t\tcurrent.dispose()\n\t\t\t},\n\t\t}\n\t}\n\tfunction refreshViews(id: string): void {\n\t\tfor (const view of [...views]) {\n\t\t\tif (!views.has(view) || !view.modules.has(id)) continue\n\t\t\ttry {\n\t\t\t\tview.refresh()\n\t\t\t} catch (error) {\n\t\t\t\tview.report(error)\n\t\t\t}\n\t\t}\n\t}\n\treturn { register, root: manage, refresh: refreshViews, track, onDispose }\n}\n\nconst runtime = import.meta.env.DEV ? createHotRuntime() : undefined\n\n/** Development protocol used by the Vite transform. */\nexport function registerComponent<T extends Component>(\n\tid: string,\n\tname: string,\n\timplementation: T,\n): T {\n\treturn runtime ? runtime.register(id, name, implementation) : implementation\n}\nexport function refresh(id: string): void {\n\truntime?.refresh(id)\n}\nexport function trackRoot(root: Root): void {\n\truntime?.track(root)\n}\n/** Release root lifetime resources, retaining them through development remounts. */\nexport function onRootDispose(cleanup: () => void): void {\n\tif (runtime) runtime.onDispose(cleanup)\n\telse onCleanup(cleanup)\n}\nexport function hotRoot(\n\tfactory: Factory,\n\toptions: RootOptions,\n\thost?: Element,\n): Handle {\n\treturn runtime ? runtime.root(factory, options, host) : factory(options, null)\n}\n"],"mappings":";;;AAkBA,SAAS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;EACvC,KAAK,MAAM,QAAQ,CAAC,GAAG,KAAK,GAAG;GAC9B,IAAI,CAAC,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,QAAQ,IAAI,EAAE,GAAG;GAC/C,IAAI;IACH,KAAK,QAAQ;GACd,SAAS,OAAO;IACf,KAAK,OAAO,KAAK;GAClB;EACD;CACD;CACA,OAAO;EAAE;EAAU,MAAM;EAAQ,SAAS;EAAc;EAAO;CAAU;AAC1E;AAEA,MAAM,UAAgC,iBAAiB;;AAGvD,SAAgB,kBACf,IACA,MACA,gBACI;CACJ,OAAO,UAAU,QAAQ,SAAS,IAAI,MAAM,cAAc,IAAI;AAC/D;AACA,SAAgB,QAAQ,IAAkB;CACzC,SAAS,QAAQ,EAAE;AACpB;AACA,SAAgB,UAAU,MAAkB;CAC3C,SAAS,MAAM,IAAI;AACpB;;AAEA,SAAgB,cAAc,SAA2B;CACxD,IAAI,SAAS,QAAQ,UAAU,OAAO;MACjC,UAAU,OAAO;AACvB;AACA,SAAgB,QACf,SACA,SACA,MACS;CACT,OAAO,UAAU,QAAQ,KAAK,SAAS,SAAS,IAAI,IAAI,QAAQ,SAAS,IAAI;AAC9E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as scopeCapabilities, c as isPresent } from "./core-
|
|
1
|
+
import { _ as scopeCapabilities, c as isPresent } from "./core-D1FWUMMC.js";
|
|
2
2
|
import { packCanonical } from "atom.io/foundations/canonical";
|
|
3
3
|
// src/capabilities.ts
|
|
4
4
|
function capabilityNamespace(key) {
|
|
@@ -97,7 +97,7 @@ function trackKeys(value) {
|
|
|
97
97
|
return hasKey(value) ? () => value : value;
|
|
98
98
|
}
|
|
99
99
|
function identifyChildren(output, duplicate = `spa: duplicate key`) {
|
|
100
|
-
const values = [output].flat(
|
|
100
|
+
const values = [output].flat(1e400);
|
|
101
101
|
const seen = /* @__PURE__ */ new Set();
|
|
102
102
|
return values.map((value, index) => {
|
|
103
103
|
const key = childProps(value)?.[`key`];
|
|
@@ -118,4 +118,4 @@ function identifyChildren(output, duplicate = `spa: duplicate key`) {
|
|
|
118
118
|
}
|
|
119
119
|
export { validateCapabilities as a, capabilityProps as i, trackKeys as n, capabilityNamespace as r, identifyChildren as t };
|
|
120
120
|
|
|
121
|
-
//# sourceMappingURL=identity-
|
|
121
|
+
//# sourceMappingURL=identity-DWHH6jbd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-
|
|
1
|
+
{"version":3,"file":"identity-DWHH6jbd.js","names":[],"sources":["../../src/capabilities.ts","../../src/identity.ts"],"sourcesContent":["import type { Cleanup, Root, Scope } from \"./core.ts\"\nimport { isPresent, scopeCapabilities } from \"./core.ts\"\nimport type { ExitHandle, PresenceCoordinator } from \"./presence.ts\"\n\n/** Native renderers expose property access without importing capability engines. */\nexport interface CapabilityTarget {\n\tkind: string\n\tnode: unknown\n\tsuspend?(): Cleanup\n\tread?(key: string): unknown\n\twrite?(key: string, value: unknown): void\n\tlisten?(event: string, listener: () => void): Cleanup\n}\nexport interface CapabilityBinding {\n\texit?(props: Record<string, unknown>): ExitHandle | undefined\n\tresume?(): void\n\t/** Inline CSS before native style replacement, for restoring capability-owned values. */\n\tupdate(props: Record<string, unknown>, previousStyle?: string): void\n\tdispose(): void\n}\nexport interface Capability {\n\tnamespace: string\n\t/** Prepare a synchronous update batch and return its commit callback. */\n\tbeforeUpdate?(root: Root): Cleanup\n\tpresence?(root: Root): PresenceCoordinator\n\tscheduleFrame?(callback: (time: number) => void): Cleanup\n\t/** SPA supplies ownership for integrations that measure after mount or report async errors. */\n\tattach(target: CapabilityTarget, scope?: Scope): CapabilityBinding\n}\ntype EventHandler = (this: unknown, ...args: unknown[]) => unknown\n\nexport function capabilityNamespace(key: string): string | undefined {\n\tconst colon = key.indexOf(`:`)\n\tif (colon < 0) return undefined\n\tconst namespace = key.slice(0, colon)\n\treturn /^(xml|xmlns|xlink)$/.test(namespace) ? undefined : namespace\n}\nfunction requireCapability(\n\tcapabilities: Map<string, Capability>,\n\tnamespace: string,\n) {\n\tconst capability = capabilities.get(namespace)\n\tif (!capability)\n\t\tthrow new Error(\n\t\t\t`spa: capability \"${namespace}\" is not registered for this root`,\n\t\t)\n\treturn capability\n}\nexport function validateCapabilities(\n\tscope: Scope,\n\tprops: Record<string, unknown>,\n): void {\n\tconst capabilities = scopeCapabilities(scope)\n\tfor (const key of Object.keys(props)) {\n\t\tconst namespace = capabilityNamespace(key)\n\t\tif (namespace) requireCapability(capabilities, namespace)\n\t}\n}\n\n/** Separate framework properties from native attributes and own their bindings. */\nexport function capabilityProps(\n\tscope: Scope,\n\ttarget: CapabilityTarget,\n\tread?: () => Record<string, any>,\n\tapplyNative?: (props: Record<string, any>) => string | undefined,\n): (props: Record<string, any>) => Record<string, any> {\n\tconst root = scope._root\n\tconst bindings = new Map<Capability, CapabilityBinding>()\n\tlet handlers: WeakMap<EventHandler, EventHandler> | undefined\n\tconst event = (handler: EventHandler) => {\n\t\tconst cache = (handlers ??= new WeakMap())\n\t\tlet wrapped = cache.get(handler)\n\t\tif (!wrapped) {\n\t\t\twrapped = function (this: unknown, ...args: unknown[]) {\n\t\t\t\t// Presence may activate after this listener mounts.\n\t\t\t\tif (!root._presence || isPresent(scope)) return handler.apply(this, args)\n\t\t\t}\n\t\t\tcache.set(handler, wrapped)\n\t\t}\n\t\treturn wrapped\n\t}\n\n\tif (root._presence) root._presence.target(scope, target)\n\telse (scope._targets ??= new Set()).add(target)\n\tconst cleanup: Cleanup = () => {\n\t\tconst errors: unknown[] = []\n\t\tfor (const binding of [...bindings.values()].reverse()) {\n\t\t\ttry {\n\t\t\t\tbinding.dispose()\n\t\t\t} catch (error) {\n\t\t\t\terrors.push(error)\n\t\t\t}\n\t\t}\n\t\tbindings.clear()\n\t\tif (errors.length) throw new AggregateError(errors)\n\t}\n\tscope._cleanups.add(cleanup)\n\treturn (props) => {\n\t\tconst capabilities = scopeCapabilities(scope)\n\t\tconst native: Record<string, any> = {}\n\t\tconst groups = new Map<Capability, Record<string, unknown>>()\n\t\tfor (const key of Object.keys(props)) {\n\t\t\tconst namespace = capabilityNamespace(key)\n\t\t\tif (!namespace) {\n\t\t\t\tconst value = props[key]\n\t\t\t\tnative[key] =\n\t\t\t\t\tkey.startsWith(`on`) && typeof value === `function`\n\t\t\t\t\t\t? event(value)\n\t\t\t\t\t\t: value\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst capability = requireCapability(capabilities, namespace)\n\t\t\tconst group = groups.get(capability) ?? {}\n\t\t\tgroup[key.slice(namespace.length + 1)] = props[key]\n\t\t\tgroups.set(capability, group)\n\t\t}\n\t\tconst previousStyle = applyNative?.(native)\n\t\tfor (const [capability, values] of groups) {\n\t\t\tlet binding = bindings.get(capability)\n\t\t\tif (!binding) {\n\t\t\t\tbinding = capability.attach(target, scope)\n\t\t\t\tbindings.set(capability, binding)\n\t\t\t\troot._presence?.bind(\n\t\t\t\t\tscope,\n\t\t\t\t\tbinding,\n\t\t\t\t\tread ?? (() => props),\n\t\t\t\t\tcapability.namespace,\n\t\t\t\t)\n\t\t\t}\n\t\t\tif (previousStyle !== undefined) binding.update(values, previousStyle)\n\t\t\telse binding.update(values)\n\t\t}\n\t\tfor (const [capability, binding] of bindings)\n\t\t\tif (!groups.has(capability)) {\n\t\t\t\tbindings.delete(capability)\n\t\t\t\troot._presence?.unbind(binding)\n\t\t\t\tbinding.dispose()\n\t\t\t}\n\t\treturn native\n\t}\n}\n","import type { Canonical } from \"atom.io/foundations/canonical\"\nimport { packCanonical } from \"atom.io/foundations/canonical\"\n\nimport type { Children, SpaElement } from \"./core.ts\"\n\ntype Props = SpaElement[`props`]\ntype Key = Canonical | undefined\ntype Identity = string | number\n\nfunction childProps(value: Children): Props | undefined {\n\treturn (value as SpaElement | null)?.props\n}\n\nfunction hasKey(value: Children): boolean {\n\tif (Array.isArray(value)) return value.some(hasKey)\n\tconst props = childProps(value)\n\treturn props !== undefined && Object.hasOwn(props, `key`)\n}\n\n/** Direct output opts into key tracking when it first mounts. */\nexport function trackKeys(value: Children): Children {\n\treturn hasKey(value) ? () => value : value\n}\n\nexport function identifyChildren(\n\toutput: Children,\n\tduplicate = `spa: duplicate key`,\n): { value: Children; key: Key; id: Identity }[] {\n\tconst values = ([output] as unknown[]).flat(Infinity) as Children[]\n\tconst seen = new Set<string>()\n\treturn values.map((value, index) => {\n\t\tconst key: Key = childProps(value)?.[`key`]\n\t\tif (key === undefined) return { value, key, id: index }\n\t\tconst id = packCanonical(key)\n\t\tif (seen.has(id)) throw new Error(duplicate)\n\t\tseen.add(id)\n\t\treturn { value, key, id }\n\t})\n}\n"],"mappings":";;;AA+BA,SAAgB,oBAAoB,KAAiC;CACpE,MAAM,QAAQ,IAAI,QAAQ,GAAG;CAC7B,IAAI,QAAQ,GAAG,OAAO,KAAA;CACtB,MAAM,YAAY,IAAI,MAAM,GAAG,KAAK;CACpC,OAAO,sBAAsB,KAAK,SAAS,IAAI,KAAA,IAAY;AAC5D;AACA,SAAS,kBACR,cACA,WACC;CACD,MAAM,aAAa,aAAa,IAAI,SAAS;CAC7C,IAAI,CAAC,YACJ,MAAM,IAAI,MACT,oBAAoB,UAAU,kCAC/B;CACD,OAAO;AACR;AACA,SAAgB,qBACf,OACA,OACO;CACP,MAAM,eAAe,kBAAkB,KAAK;CAC5C,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EACrC,MAAM,YAAY,oBAAoB,GAAG;EACzC,IAAI,WAAW,kBAAkB,cAAc,SAAS;CACzD;AACD;;AAGA,SAAgB,gBACf,OACA,QACA,MACA,aACsD;CACtD,MAAM,OAAO,MAAM;CACnB,MAAM,2BAAW,IAAI,IAAmC;CACxD,IAAI;CACJ,MAAM,SAAS,YAA0B;EACxC,MAAM,QAAS,6BAAa,IAAI,QAAQ;EACxC,IAAI,UAAU,MAAM,IAAI,OAAO;EAC/B,IAAI,CAAC,SAAS;GACb,UAAU,SAAyB,GAAG,MAAiB;IAEtD,IAAI,CAAC,KAAK,aA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,OAAO;IAChC,KAAK,WAAW,KACf,OACA,SACA,eAAe,QACf,WAAW,SACZ;GACD;GACA,IAAI,kBAAkB,KAAA,GAAW,QAAQ,OAAO,QAAQ,aAAa;QAChE,QAAQ,OAAO,MAAM;EAC3B;EACA,KAAK,MAAM,CAAC,YAAY,YAAY,UACnC,IAAI,CAAC,OAAO,IAAI,UAAU,GAAG;GAC5B,SAAS,OAAO,UAAU;GAC1B,KAAK,WAAW,OAAO,OAAO;GAC9B,QAAQ,QAAQ;EACjB;EACD,OAAO;CACR;AACD;;ACnIA,SAAS,WAAW,OAAoC;CACvD,OAAQ,OAA6B;AACtC;AAEA,SAAS,OAAO,OAA0B;CACzC,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,KAAK,MAAM;CAClD,MAAM,QAAQ,WAAW,KAAK;CAC9B,OAAO,UAAU,KAAA,KAAa,OAAO,OAAO,OAAO,KAAK;AACzD;;AAGA,SAAgB,UAAU,OAA2B;CACpD,OAAO,OAAO,KAAK,UAAU,QAAQ;AACtC;AAEA,SAAgB,iBACf,QACA,YAAY,sBACoC;CAChD,MAAM,SAAU,CAAC,MAAM,CAAC,CAAe,KAAK,KAAQ;CACpD,MAAM,uBAAO,IAAI,IAAY;CAC7B,OAAO,OAAO,KAAK,OAAO,UAAU;EACnC,MAAM,MAAW,WAAW,KAAK,CAAC,GAAG;EACrC,IAAI,QAAQ,KAAA,GAAW,OAAO;GAAE;GAAO;GAAK,IAAI;EAAM;EACtD,MAAM,KAAK,cAAc,GAAG;EAC5B,IAAI,KAAK,IAAI,EAAE,GAAG,MAAM,IAAI,MAAM,SAAS;EAC3C,KAAK,IAAI,EAAE;EACX,OAAO;GAAE;GAAO;GAAK;EAAG;CACzB,CAAC;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as useSetter, E as useTransaction, S as useRef, T as useTimeline, b as useGetter, d as onCommit, f as onMount, t as RootBoundary, u as onCleanup, w as useStore, x as useId, y as useDisposal } from "./core-
|
|
2
|
-
import { n as render, t as hydrate } from "./dom-
|
|
3
|
-
import { t as Fragment } from "./jsx-runtime-
|
|
4
|
-
import { t as useLoadable } from "./src-
|
|
1
|
+
import { C as useSetter, E as useTransaction, S as useRef, T as useTimeline, b as useGetter, d as onCommit, f as onMount, t as RootBoundary, u as onCleanup, w as useStore, x as useId, y as useDisposal } from "./core-D1FWUMMC.js";
|
|
2
|
+
import { n as render, t as hydrate } from "./dom-C1cVf5Vm.js";
|
|
3
|
+
import { t as Fragment } from "./jsx-runtime-B2XxfA3E.js";
|
|
4
|
+
import { t as useLoadable } from "./src-By4JY4qf.js";
|
|
5
5
|
export { Fragment, RootBoundary as Root, hydrate, onCleanup, onCommit, onMount, render, useDisposal, useGetter, useId, useLoadable, useRef, useSetter, useStore, useTimeline, useTransaction };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime-
|
|
1
|
+
{"version":3,"file":"jsx-runtime-B2XxfA3E.js","names":[],"sources":["../../src/props.ts","../../src/jsx-runtime.ts"],"sourcesContent":["import type { Canonical } from \"atom.io/foundations/canonical\"\n\nimport type { SpaElement } from \"./core.ts\"\n\ntype Props = SpaElement[`props`]\ntype FixedKey = { value: Canonical | undefined; present: boolean }\n\nfunction liveProps(values: () => Props[], fixedKey?: FixedKey): Props {\n\tconst source = (name: PropertyKey) =>\n\t\tvalues()\n\t\t\t.reverse()\n\t\t\t.find((props) => Object.hasOwn(props, name))\n\tconst has = (_: Props, name: PropertyKey): boolean =>\n\t\tfixedKey && name === `key` ? fixedKey.present : source(name) !== undefined\n\treturn new Proxy(\n\t\t{},\n\t\t{\n\t\t\thas,\n\t\t\tget(_, name) {\n\t\t\t\tif (fixedKey && name === `key`) return fixedKey.value\n\t\t\t\tconst props = source(name)\n\t\t\t\treturn props && Reflect.get(props, name)\n\t\t\t},\n\t\t\townKeys() {\n\t\t\t\tconst keys = new Set(values().flatMap(Object.keys))\n\t\t\t\tif (fixedKey?.present) keys.add(`key`)\n\t\t\t\telse if (fixedKey) keys.delete(`key`)\n\t\t\t\treturn [...keys]\n\t\t\t},\n\t\t\tgetOwnPropertyDescriptor(_, name) {\n\t\t\t\tif (has(_, name)) return { enumerable: true, configurable: true }\n\t\t\t},\n\t\t},\n\t)\n}\n\n/** Preserve lazy props and spread precedence, including keys added by later updates. */\nexport function merge(...sources: (Props | (() => Props))[]): Props {\n\treturn liveProps(() =>\n\t\tsources.map(\n\t\t\t(source) => (typeof source === `function` ? source() : source) ?? {},\n\t\t),\n\t)\n}\n\n/** Expose the first key while leaving data props live, including through spreads. */\nexport function instanceProps(\n\tread: () => Props,\n\tkey: Canonical | undefined,\n): Props {\n\treturn liveProps(() => [read()], {\n\t\tvalue: key,\n\t\tpresent: key !== undefined || Object.hasOwn(read(), `key`),\n\t})\n}\n","import type { Canonical } from \"atom.io/foundations/canonical\"\n\nimport type { Children, Component, SpaElement } from \"./core.ts\"\nimport type { HTMLAttributes, NativeElements } from \"./jsx-types.d.ts\"\nimport { merge } from \"./props.ts\"\n\nexport type {\n\tAriaAttributes,\n\tDOMAttributes,\n\tEventAttributes,\n\tEventHandler,\n\tHTMLAttributes,\n\tRef,\n\tSVGAttributes,\n\tTargetedEvent,\n} from \"./jsx-types.d.ts\"\nexport { merge } from \"./props.ts\"\n\n/** Optional integrations augment attributes without changing element identity. */\n// oxlint-disable-next-line typescript/no-empty-interface -- Optional integrations augment this declaration.\nexport interface CapabilityAttributes<Kind extends string = string> {}\n\nexport const Fragment = (props: { children?: Children }): Children =>\n\tprops.children\nexport function jsx(\n\ttype: SpaElement[`type`],\n\tprops: SpaElement[`props`] | null,\n\tkey?: Canonical,\n): SpaElement {\n\treturn {\n\t\ttype,\n\t\tprops: key === undefined ? (props ?? {}) : merge(props ?? {}, { key }),\n\t}\n}\nexport const jsxs = jsx\nexport const jsxDEV = jsx\n\nexport namespace JSX {\n\texport type Element = SpaElement\n\texport type ElementType = keyof IntrinsicElements | Component\n\texport interface ElementChildrenAttribute {\n\t\tchildren: {}\n\t}\n\texport interface IntrinsicAttributes {\n\t\tkey?: Canonical | undefined\n\t}\n\t/** Augment this interface to declare attributes for registered custom elements. */\n\texport interface IntrinsicElements extends NativeElements {\n\t\t[tag: `${string}-${string}`]: HTMLAttributes<HTMLElement>\n\t}\n}\n"],"mappings":";AAOA,SAAS,UAAU,QAAuB,UAA4B;CACrE,MAAM,UAAU,SACf,OAAO,CAAC,CACN,QAAQ,CAAC,CACT,MAAM,UAAU,OAAO,OAAO,OAAO,IAAI,CAAC;CAC7C,MAAM,OAAO,GAAU,SACtB,YAAY,SAAS,QAAQ,SAAS,UAAU,OAAO,IAAI,MAAM,KAAA;CAClE,OAAO,IAAI,MACV,CAAC,GACD;EACC;EACA,IAAI,GAAG,MAAM;GACZ,IAAI,YAAY,SAAS,OAAO,OAAO,SAAS;GAChD,MAAM,QAAQ,OAAO,IAAI;GACzB,OAAO,SAAS,QAAQ,IAAI,OAAO,IAAI;EACxC;EACA,UAAU;GACT,MAAM,OAAO,IAAI,IAAI,OAAO,CAAC,CAAC,QAAQ,OAAO,IAAI,CAAC;GAClD,IAAI,UAAU,SAAS,KAAK,IAAI,KAAK;QAChC,IAAI,UAAU,KAAK,OAAO,KAAK;GACpC,OAAO,CAAC,GAAG,IAAI;EAChB;EACA,yBAAyB,GAAG,MAAM;GACjC,IAAI,IAAI,GAAG,IAAI,GAAG,OAAO;IAAE,YAAY;IAAM,cAAc;GAAK;EACjE;CACD,CACD;AACD;;AAGA,SAAgB,MAAM,GAAG,SAA2C;CACnE,OAAO,gBACN,QAAQ,KACN,YAAY,OAAO,WAAW,aAAa,OAAO,IAAI,WAAW,CAAC,CACpE,CACD;AACD;;AAGA,SAAgB,cACf,MACA,KACQ;CACR,OAAO,gBAAgB,CAAC,KAAK,CAAC,GAAG;EAChC,OAAO;EACP,SAAS,QAAQ,KAAA,KAAa,OAAO,OAAO,KAAK,GAAG,KAAK;CAC1D,CAAC;AACF;;AChCA,MAAa,YAAY,UACxB,MAAM;AACP,SAAgB,IACf,MACA,OACA,KACa;CACb,OAAO;EACN;EACA,OAAO,QAAQ,KAAA,IAAa,SAAS,CAAC,IAAK,MAAM,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC;CACtE;AACD;AACA,MAAa,OAAO;AACpB,MAAa,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Fragment, n as jsx, r as jsxDEV, i as jsxs, o as merge } from "./jsx-runtime-
|
|
1
|
+
export { t as Fragment, n as jsx, r as jsxDEV, i as jsxs, o as merge } from "./jsx-runtime-B2XxfA3E.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as capabilityProps } from "./identity-DwB8MTM1.js";
|
|
2
|
-
import { f as onMount, p as owner, u as onCleanup } from "./core-DrUd8x25.js";
|
|
3
|
-
import { n as jsx } from "./jsx-runtime-BGDPK50B.js";
|
|
4
|
-
import { bindScene, createSceneRenderer, sceneComponent } from "./renderer.js";
|
|
5
1
|
import Konva from "konva";
|
|
2
|
+
import { i as capabilityProps } from "./identity-DWHH6jbd.js";
|
|
3
|
+
import { f as onMount, p as owner, u as onCleanup } from "./core-D1FWUMMC.js";
|
|
4
|
+
import { n as jsx } from "./jsx-runtime-B2XxfA3E.js";
|
|
5
|
+
import { bindScene, createSceneRenderer, sceneComponent } from "./renderer.js";
|
|
6
6
|
// src/konva.ts
|
|
7
7
|
const constructors = {
|
|
8
8
|
Layer: Konva.Layer,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as within, c as isPresent, f as onMount, h as reportScopeError, i as dispose, o as fail, s as invalidate, v as untrack } from "./core-DrUd8x25.js";
|
|
2
1
|
import { acquireProjectionNode, animate, cancelFrame, frame, handOffElementState, hover, keyframes, motionValue, press, readStyleValue, styleEffect, visualElementStore } from "motion";
|
|
2
|
+
import { D as within, c as isPresent, f as onMount, h as reportScopeError, i as dispose, o as fail, s as invalidate, v as untrack } from "./core-D1FWUMMC.js";
|
|
3
3
|
// src/motion-layout.ts
|
|
4
4
|
let serial = 0;
|
|
5
5
|
function createLayoutController(root, options) {
|
|
@@ -21,7 +21,7 @@ function createLayoutController(root, options) {
|
|
|
21
21
|
const detach = entry.release;
|
|
22
22
|
entry.release = void 0;
|
|
23
23
|
entry.node = void 0;
|
|
24
|
-
entry.
|
|
24
|
+
entry.beginStyles = entry.measureStyles = entry.endStyles = entry.captureStyles = void 0;
|
|
25
25
|
detach?.();
|
|
26
26
|
};
|
|
27
27
|
const configure = (entry) => {
|
|
@@ -42,6 +42,7 @@ function createLayoutController(root, options) {
|
|
|
42
42
|
}
|
|
43
43
|
entry.node.setOptions({
|
|
44
44
|
layoutScroll: entry.props.scroll ?? false,
|
|
45
|
+
layoutRoot: entry.props.root ?? false,
|
|
45
46
|
animationType: typeof entry.props.animate === `string` ? entry.props.animate : `both`,
|
|
46
47
|
animate: entry.props.animate !== false && !reduced(),
|
|
47
48
|
transition: reduced() ? { duration: 0 } : transition
|
|
@@ -91,25 +92,26 @@ function createLayoutController(root, options) {
|
|
|
91
92
|
let visibility = ``;
|
|
92
93
|
let pointerEvents = ``;
|
|
93
94
|
let transform = ``;
|
|
95
|
+
let rendered = ``;
|
|
94
96
|
const transformTemplate = (_, projected) => `${projected === `none` ? `` : projected} ${transform}`.trim();
|
|
95
97
|
entry.captureStyles = () => {
|
|
96
98
|
style.cssText = element.style.cssText;
|
|
97
99
|
};
|
|
98
|
-
entry.
|
|
99
|
-
|
|
100
|
+
entry.beginStyles = () => {
|
|
101
|
+
rendered = element.style.cssText;
|
|
100
102
|
for (const name of styleNames) restore(name);
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
};
|
|
104
|
+
entry.measureStyles = () => {
|
|
105
|
+
const authored = getComputedStyle(element);
|
|
106
|
+
opacity = authored.opacity || `1`;
|
|
107
|
+
visibility = authored.visibility;
|
|
108
|
+
pointerEvents = authored.pointerEvents;
|
|
109
|
+
transform = authored.transform;
|
|
110
|
+
if (!visual.values.has(`opacity`)) node.latestValues[`opacity`] = Number(opacity);
|
|
111
|
+
const origin = authored.transformOrigin.split(` `);
|
|
112
|
+
const width = element.offsetWidth, height = element.offsetHeight;
|
|
113
|
+
entry.size = `${width}:${height}`;
|
|
114
|
+
for (const [key, value] of [[`originX`, parseFloat(origin[0]) / (width || 1)], [`originY`, parseFloat(origin[1]) / (height || 1)]]) if (!visual.values.has(key) && Number.isFinite(value)) node.latestValues[key] = value;
|
|
113
115
|
const template = transform && transform !== `none` && !Object.keys(visual.latestValues).some((key) => /^(x|y|scale|rotate|skew)/.test(key)) ? transformTemplate : originalProps.transformTemplate;
|
|
114
116
|
if (visual.getProps().transformTemplate !== template) {
|
|
115
117
|
const next = { ...visual.getProps() };
|
|
@@ -118,6 +120,9 @@ function createLayoutController(root, options) {
|
|
|
118
120
|
visual.update(next, null);
|
|
119
121
|
}
|
|
120
122
|
};
|
|
123
|
+
entry.endStyles = () => {
|
|
124
|
+
element.style.cssText = rendered;
|
|
125
|
+
};
|
|
121
126
|
const applyProjectionStyles = node.applyProjectionStyles;
|
|
122
127
|
node.applyProjectionStyles = (targetStyle, styleProp) => {
|
|
123
128
|
applyProjectionStyles.call(node, targetStyle, {
|
|
@@ -155,14 +160,27 @@ function createLayoutController(root, options) {
|
|
|
155
160
|
};
|
|
156
161
|
observer?.observe(element);
|
|
157
162
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
163
|
+
};
|
|
164
|
+
const prepareAll = () => {
|
|
165
|
+
const active = ordered();
|
|
166
|
+
for (const entry of active) prepare(entry);
|
|
167
|
+
const begun = [];
|
|
168
|
+
try {
|
|
169
|
+
for (const entry of active) {
|
|
170
|
+
begun.push(entry);
|
|
171
|
+
entry.beginStyles();
|
|
172
|
+
}
|
|
173
|
+
for (const entry of active) entry.measureStyles();
|
|
174
|
+
} finally {
|
|
175
|
+
for (const entry of begun) entry.endStyles();
|
|
176
|
+
}
|
|
177
|
+
for (const entry of active) configure(entry);
|
|
178
|
+
return active;
|
|
161
179
|
};
|
|
162
180
|
const commit = () => {
|
|
163
181
|
try {
|
|
164
182
|
if (dead) return;
|
|
165
|
-
|
|
183
|
+
prepareAll();
|
|
166
184
|
const roots = new Set([...entries].flatMap((entry) => entry.node ? [entry.node.root ?? entry.node] : []));
|
|
167
185
|
for (const projection of roots) projection.didUpdate();
|
|
168
186
|
for (const entry of entries) if (entry.dead) {
|
|
@@ -615,6 +633,7 @@ const layoutKeys = {
|
|
|
615
633
|
layoutId: `id`,
|
|
616
634
|
layoutGroup: `group`,
|
|
617
635
|
layoutScroll: `scroll`,
|
|
636
|
+
layoutRoot: `root`,
|
|
618
637
|
layoutTransition: `transition`
|
|
619
638
|
};
|
|
620
639
|
function equal(a, b) {
|