drupal-canvas 0.4.0 → 0.4.1
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.
|
@@ -37,11 +37,11 @@ function sortMenu(linkset) {
|
|
|
37
37
|
}
|
|
38
38
|
const getPageData = () => {
|
|
39
39
|
const pageData = {
|
|
40
|
-
pageTitle:
|
|
41
|
-
breadcrumbs:
|
|
42
|
-
mainEntity:
|
|
40
|
+
pageTitle: globalThis?.drupalSettings?.canvasData?.v0?.pageTitle || "",
|
|
41
|
+
breadcrumbs: globalThis?.drupalSettings?.canvasData?.v0?.breadcrumbs || [],
|
|
42
|
+
mainEntity: globalThis?.drupalSettings?.canvasData?.v0?.mainEntity || null
|
|
43
43
|
};
|
|
44
|
-
window
|
|
44
|
+
window?.parent.postMessage({
|
|
45
45
|
type: "_canvas_useswr_data_fetch",
|
|
46
46
|
id: "getPageData()",
|
|
47
47
|
data: pageData
|
|
@@ -50,13 +50,13 @@ const getPageData = () => {
|
|
|
50
50
|
};
|
|
51
51
|
const getSiteData = () => {
|
|
52
52
|
const siteData = {
|
|
53
|
-
branding:
|
|
53
|
+
branding: globalThis?.drupalSettings?.canvasData?.v0?.branding || {
|
|
54
54
|
homeUrl: "",
|
|
55
55
|
siteName: "",
|
|
56
56
|
siteSlogan: ""
|
|
57
57
|
},
|
|
58
|
-
baseUrl:
|
|
59
|
-
themeAssets:
|
|
58
|
+
baseUrl: globalThis?.drupalSettings?.canvasData?.v0?.baseUrl || "/",
|
|
59
|
+
themeAssets: globalThis?.drupalSettings?.canvasData?.v0?.themeAssets || {
|
|
60
60
|
logo: { url: "" },
|
|
61
61
|
favicon: {
|
|
62
62
|
url: "",
|
|
@@ -64,7 +64,7 @@ const getSiteData = () => {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
window
|
|
67
|
+
window?.parent.postMessage({
|
|
68
68
|
type: "_canvas_useswr_data_fetch",
|
|
69
69
|
id: "getSiteData()",
|
|
70
70
|
data: siteData
|
package/dist/drupal-utils.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as getSiteData, r as sortMenu, t as getPageData } from "./drupal-utils-
|
|
1
|
+
import { n as getSiteData, r as sortMenu, t as getPageData } from "./drupal-utils-BxSGMAw9.js";
|
|
2
2
|
import { t as FormattedText } from "./FormattedText-C1aZH-9n.js";
|
|
3
3
|
import { t as CanvasJsonApiClient } from "./jsonapi-client-Wpf6rG0C.js";
|
|
4
4
|
import { n as sortMenu$1, t as getNodePath } from "./jsonapi-utils-BA2DcHP4.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drupal-canvas",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Utilities and base components for building Drupal Canvas Code Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"tsdown": "^0.17.0-beta.5",
|
|
68
68
|
"typescript": "^5.9.3",
|
|
69
|
-
"vitest": "^
|
|
69
|
+
"vitest": "^4.1.8"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "NODE_ENV=production tsdown",
|