@tjakoen/grain 0.1.25 → 0.1.26
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/package.json +1 -1
- package/scripts/tabs.js +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tjakoen/grain",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "GRAIN — an AI-interaction design system where every surface is operable by both a human and an AI through one shared vocabulary.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
package/scripts/tabs.js
CHANGED
|
@@ -123,5 +123,9 @@
|
|
|
123
123
|
// refresh: re-resolve labels (e.g. after an island fills the data-tab-source tree lazily)
|
|
124
124
|
window.grain.tabs = { open: () => [...list], close: closeTab, closeAll, refresh: render };
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
// Loaded as a classic script right after the strip, it renders before the first paint, which a
|
|
127
|
+
// view transition captures; that keeps the stored tabs from popping in a frame late. Loaded any
|
|
128
|
+
// later (defer, module, end of body), the strip is parsed and this simply runs.
|
|
129
|
+
if (document.readyState !== "loading" || document.querySelector("[data-open-tabs]")) init();
|
|
130
|
+
else document.addEventListener("DOMContentLoaded", init);
|
|
127
131
|
})();
|