astroidjs 0.4.1 → 0.5.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.
- package/dist/map/scaffold.js +7 -1
- package/package.json +2 -2
- package/src/components/Section.astro +13 -11
package/dist/map/scaffold.js
CHANGED
|
@@ -194,7 +194,13 @@ export function generateMapEmbedComponent(config) {
|
|
|
194
194
|
" for (const entry of entries) {",
|
|
195
195
|
" if (!entry.isIntersecting) continue;",
|
|
196
196
|
" obs.unobserve(entry.target);",
|
|
197
|
-
" init
|
|
197
|
+
" // `init` is async and nothing awaits it, so without this catch a",
|
|
198
|
+
" // failed chunk fetch — a page load racing a deploy is enough — is a",
|
|
199
|
+
" // silent unhandled rejection: the container just stays an empty",
|
|
200
|
+
" // tinted box with nothing in the console to explain it.",
|
|
201
|
+
" init(entry.target as HTMLElement).catch((err) => {",
|
|
202
|
+
' console.error("[astroid:map] map failed to load", err);',
|
|
203
|
+
" });",
|
|
198
204
|
" }",
|
|
199
205
|
" },",
|
|
200
206
|
' { rootMargin: "200px" },',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astroidjs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Astroid — an opinionated meta-framework over Louise Toolkit and Astro for building editable, multi-editor sites on Cloudflare Workers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"louise-toolkit": "0.
|
|
63
|
+
"louise-toolkit": "0.21.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/node": "^24.13.3",
|
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
// the page's `sections` column, not props a template hand-wrote, so what renders
|
|
9
9
|
// is exactly what the on-canvas editor edits in place.
|
|
10
10
|
//
|
|
11
|
-
// Two marker responsibilities
|
|
12
|
-
// • the BOUNDARY (`data-louise-
|
|
11
|
+
// Two marker responsibilities:
|
|
12
|
+
// • the BOUNDARY (`data-louise-node="<path>"`, ADR 0010) is stamped here,
|
|
13
13
|
// because only the dispatcher knows an item's position;
|
|
14
14
|
// • the FIELDS (`data-louise-sfield`) are stamped by `<Editable base={base}
|
|
15
15
|
// field="…">` inside each component, because only the component knows which
|
|
16
|
-
// of its text nodes are editable.
|
|
16
|
+
// of its text nodes are editable. (ADR 0010 Phase A2 folds these into the node
|
|
17
|
+
// marker once the field registry can say which fields want chrome.)
|
|
17
18
|
//
|
|
18
19
|
// Blocks recurse through this same component with a deeper `base`. That's the
|
|
19
20
|
// whole trick: a component never learns its own depth, so a type that renders as
|
|
@@ -79,15 +80,16 @@ const type = String(item._type);
|
|
|
79
80
|
// (`<i>.blocks.<j>`), which is what the client's depth-agnostic path parser walks.
|
|
80
81
|
const blocks = Array.isArray(item.blocks) ? item.blocks : [];
|
|
81
82
|
|
|
82
|
-
// The boundary marker the on-canvas chrome draws its ring on.
|
|
83
|
-
//
|
|
84
|
-
//
|
|
83
|
+
// The boundary marker the on-canvas chrome draws its ring on. It is the item's
|
|
84
|
+
// path, verbatim — pre-0010 this line string-sniffed `base` for ".blocks." to pick
|
|
85
|
+
// between two attribute names, which was the three-attribute editing model leaking
|
|
86
|
+
// into an otherwise uniform recursive render (ADR 0010, Context). The editor
|
|
87
|
+
// resolves what a path CAN do from the catalog; the render just says where it is.
|
|
88
|
+
//
|
|
89
|
+
// `class="contents"` keeps this wrapper out of layout entirely — the ring is drawn
|
|
90
|
+
// as a box-shadow on the element itself, so an extra block box here would offset
|
|
85
91
|
// every section's spacing for the sake of an attribute.
|
|
86
|
-
const boundary = editing
|
|
87
|
-
? base.includes(".blocks.")
|
|
88
|
-
? { "data-louise-block": base }
|
|
89
|
-
: { "data-louise-section": base }
|
|
90
|
-
: {};
|
|
92
|
+
const boundary = editing ? { "data-louise-node": base } : {};
|
|
91
93
|
|
|
92
94
|
const shared = { item, base, edit: editing, mediaMeta };
|
|
93
95
|
|