Compare commits
No commits in common. "7ae105208e1299911a693391cd0e557d8320e752" and "1d0c0013fd03aa5af827a717a15255c12d38b947" have entirely different histories.
7ae105208e
...
1d0c0013fd
|
|
@ -340,15 +340,8 @@ export class FolkRApp extends FolkShape {
|
||||||
override createRenderRoot() {
|
override createRenderRoot() {
|
||||||
const root = super.createRenderRoot();
|
const root = super.createRenderRoot();
|
||||||
|
|
||||||
// Prefer JS-set properties (from newShape props); fall back to HTML attributes
|
this.#moduleId = this.getAttribute("module-id") || "";
|
||||||
if (!this.#moduleId) this.#moduleId = this.getAttribute("module-id") || "";
|
this.#spaceSlug = this.getAttribute("space-slug") || "";
|
||||||
if (!this.#spaceSlug) this.#spaceSlug = this.getAttribute("space-slug") || "";
|
|
||||||
|
|
||||||
// Auto-derive spaceSlug from current URL if not explicitly provided (/{space}/canvas → space)
|
|
||||||
if (!this.#spaceSlug) {
|
|
||||||
const pathParts = window.location.pathname.split("/").filter(Boolean);
|
|
||||||
if (pathParts.length >= 1) this.#spaceSlug = pathParts[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
const meta = MODULE_META[this.#moduleId];
|
const meta = MODULE_META[this.#moduleId];
|
||||||
const headerColor = meta?.color || "#475569";
|
const headerColor = meta?.color || "#475569";
|
||||||
|
|
@ -537,11 +530,7 @@ export class FolkRApp extends FolkShape {
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Auto-derive space from URL if still missing
|
// Create iframe
|
||||||
if (!this.#spaceSlug) {
|
|
||||||
const pathParts = window.location.pathname.split("/").filter(Boolean);
|
|
||||||
if (pathParts.length >= 1) this.#spaceSlug = pathParts[0];
|
|
||||||
}
|
|
||||||
const space = this.#spaceSlug || "demo";
|
const space = this.#spaceSlug || "demo";
|
||||||
const iframeUrl = `/${space}/${this.#moduleId}`;
|
const iframeUrl = `/${space}/${this.#moduleId}`;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1395,7 +1395,7 @@
|
||||||
case "folk-rapp":
|
case "folk-rapp":
|
||||||
shape = document.createElement("folk-rapp");
|
shape = document.createElement("folk-rapp");
|
||||||
if (data.moduleId) shape.moduleId = data.moduleId;
|
if (data.moduleId) shape.moduleId = data.moduleId;
|
||||||
shape.spaceSlug = data.spaceSlug || communitySlug;
|
if (data.spaceSlug) shape.spaceSlug = data.spaceSlug;
|
||||||
break;
|
break;
|
||||||
case "folk-feed":
|
case "folk-feed":
|
||||||
shape = document.createElement("folk-feed");
|
shape = document.createElement("folk-feed");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue