@widgetic/creator 0.4.6 → 0.4.8

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.
@@ -0,0 +1,13 @@
1
+ /** Header the API reads when a call should use the site's builder instead of the API env URL. */
2
+ export const WIDGET_BUILDER_URL_HEADER = 'X-Widgetic-Builder-Url';
3
+
4
+ /**
5
+ * Request init that names the builder. An empty URL sends nothing, and the API keeps its own URL.
6
+ * @param {string | null | undefined} builderUrl
7
+ * @returns {RequestInit | undefined}
8
+ */
9
+ export function widgetBuilderRequestInit(builderUrl) {
10
+ const url = typeof builderUrl === 'string' ? builderUrl.trim() : '';
11
+ if (!url) return undefined;
12
+ return { headers: { [WIDGET_BUILDER_URL_HEADER]: url } };
13
+ }
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@widgetic/creator",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
+ "license": "SEE LICENSE IN LICENSE",
4
5
  "type": "module",
5
6
  "peerDependencies": {
6
7
  "@sveltejs/kit": "^2.20.0",