@websline/cms-view-utils 1.3.0 → 1.3.2
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
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const fetchCollections = async ({ identifier, itemUuid, limit, locale }) => {
|
|
2
|
+
const params = new URLSearchParams();
|
|
3
|
+
|
|
4
|
+
if (limit != null) {
|
|
5
|
+
params.set("limit", limit);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (itemUuid != null && itemUuid !== "") {
|
|
9
|
+
params.set("itemUuid", itemUuid);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const query = params.toString();
|
|
13
|
+
const url = `/api/cms/api/public/collections/${locale}/${identifier}${query ? `?${query}` : ""}`;
|
|
14
|
+
|
|
15
|
+
const response = await fetch(url, { method: "GET" });
|
|
16
|
+
|
|
17
|
+
return response.json();
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { fetchCollections };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { twMerge as tw } from "tailwind-merge";
|
|
3
3
|
|
|
4
|
-
let { block, children, spacingValues = {} } = $props();
|
|
4
|
+
let { block, children, class: className, spacingValues = {} } = $props();
|
|
5
5
|
|
|
6
6
|
const defaultSpacingValues = {
|
|
7
7
|
bottom: {
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
id={block?.shortId || undefined}
|
|
46
46
|
data-cms-block-wrapper
|
|
47
47
|
class={tw(
|
|
48
|
+
className,
|
|
48
49
|
spacingMap.top[spacingTop] ?? spacingMap.top.none,
|
|
49
50
|
spacingMap.bottom[spacingBottom] ?? spacingMap.bottom.none,
|
|
50
51
|
)}
|
package/src/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { isValid } from "./editor/blockValidation.js";
|
|
|
2
2
|
export { fetchSimilarRooms } from "./client/fetchSimilarRooms.js";
|
|
3
3
|
export { fetchSimilarPackages } from "./client/fetchSimilarPackages.js";
|
|
4
4
|
export { fetchFaqs } from "./client/fetchFaqs.js";
|
|
5
|
+
export { fetchCollections } from "./client/fetchCollections.js";
|
|
5
6
|
|
|
6
7
|
export { default as AddBlockPlaceholder } from "./components/AddBlockPlaceholder.svelte";
|
|
7
8
|
export { default as BlockWrapper } from "./components/BlockWrapper.svelte";
|