@mints-cloud/cxf-codegen 1.0.3 → 1.0.4

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,228 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cleanString = cleanString;
4
+ exports.pickFirstString = pickFirstString;
5
+ exports.parseObject = parseObject;
6
+ exports.parseObjectArray = parseObjectArray;
7
+ exports.parseStringList = parseStringList;
8
+ exports.toOriginUrl = toOriginUrl;
9
+ exports.resolveUrlBase = resolveUrlBase;
10
+ exports.getCurrentOrigin = getCurrentOrigin;
11
+ exports.buildOrganizationId = buildOrganizationId;
12
+ exports.toAbsoluteUrl = toAbsoluteUrl;
13
+ exports.safeJsonForInlineScript = safeJsonForInlineScript;
14
+ exports.toDomId = toDomId;
15
+ exports.removeDuplicateJsonLdScripts = removeDuplicateJsonLdScripts;
16
+ exports.tryParseLooseJson = tryParseLooseJson;
17
+ function cleanString(value) {
18
+ if (typeof value !== "string")
19
+ return undefined;
20
+ const trimmed = value.trim();
21
+ return trimmed.length > 0 ? trimmed : undefined;
22
+ }
23
+ function pickFirstString(...values) {
24
+ for (const value of values) {
25
+ const cleaned = cleanString(value);
26
+ if (cleaned)
27
+ return cleaned;
28
+ }
29
+ return undefined;
30
+ }
31
+ function parseObject(value, options) {
32
+ if (value == null)
33
+ return undefined;
34
+ if (typeof value === "object" && !Array.isArray(value)) {
35
+ return value;
36
+ }
37
+ if (typeof value !== "string")
38
+ return undefined;
39
+ const maybeJson = value.trim();
40
+ if (!maybeJson)
41
+ return undefined;
42
+ const parseJson = options?.parseJson ?? JSON.parse;
43
+ try {
44
+ const parsed = parseJson(maybeJson);
45
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
46
+ return parsed;
47
+ }
48
+ }
49
+ catch {
50
+ return undefined;
51
+ }
52
+ return undefined;
53
+ }
54
+ function parseObjectArray(value, options) {
55
+ if (Array.isArray(value))
56
+ return value;
57
+ if (typeof value !== "string")
58
+ return [];
59
+ const maybeJson = value.trim();
60
+ if (!maybeJson)
61
+ return [];
62
+ const parseJson = options?.parseJson ?? JSON.parse;
63
+ try {
64
+ const parsed = parseJson(maybeJson);
65
+ if (Array.isArray(parsed)) {
66
+ return parsed.filter((item) => item && typeof item === "object");
67
+ }
68
+ }
69
+ catch {
70
+ return [];
71
+ }
72
+ return [];
73
+ }
74
+ function parseStringList(value) {
75
+ if (Array.isArray(value)) {
76
+ return value
77
+ .map((item) => cleanString(item))
78
+ .filter((item) => Boolean(item));
79
+ }
80
+ const raw = cleanString(value);
81
+ if (!raw)
82
+ return [];
83
+ try {
84
+ const parsed = JSON.parse(raw);
85
+ if (Array.isArray(parsed)) {
86
+ return parsed
87
+ .map((item) => cleanString(item))
88
+ .filter((item) => Boolean(item));
89
+ }
90
+ }
91
+ catch {
92
+ // Fall back to comma-separated values.
93
+ }
94
+ return raw
95
+ .split(",")
96
+ .map((item) => item.trim())
97
+ .filter(Boolean);
98
+ }
99
+ function toOriginUrl(url) {
100
+ const cleaned = cleanString(url);
101
+ if (!cleaned)
102
+ return undefined;
103
+ const withProtocol = cleaned.startsWith("//") ? `https:${cleaned}` : cleaned;
104
+ try {
105
+ return new URL(withProtocol).origin;
106
+ }
107
+ catch {
108
+ return undefined;
109
+ }
110
+ }
111
+ function resolveUrlBase(...candidates) {
112
+ for (const candidate of candidates) {
113
+ const origin = toOriginUrl(candidate);
114
+ if (origin)
115
+ return origin;
116
+ }
117
+ return undefined;
118
+ }
119
+ function getCurrentOrigin() {
120
+ if (typeof window === "undefined")
121
+ return undefined;
122
+ return toOriginUrl(window.location.origin);
123
+ }
124
+ function buildOrganizationId(baseUrl) {
125
+ const origin = toOriginUrl(baseUrl);
126
+ if (!origin)
127
+ return undefined;
128
+ return `${origin}/#organization`;
129
+ }
130
+ function toAbsoluteUrl(pathOrUrl, baseUrl) {
131
+ const value = cleanString(pathOrUrl);
132
+ if (!value)
133
+ return undefined;
134
+ if (/^https?:\/\//i.test(value))
135
+ return value;
136
+ if (value.startsWith("//"))
137
+ return `https:${value}`;
138
+ const normalizedBase = resolveUrlBase(baseUrl);
139
+ const relativePath = value.startsWith("/") ? value : `/${value}`;
140
+ if (!normalizedBase)
141
+ return relativePath;
142
+ try {
143
+ return new URL(relativePath, `${normalizedBase}/`).href;
144
+ }
145
+ catch {
146
+ return relativePath;
147
+ }
148
+ }
149
+ function safeJsonForInlineScript(value) {
150
+ return JSON.stringify(value).replace(/</g, "\\u003c");
151
+ }
152
+ function toDomId(value) {
153
+ return value.replace(/[^a-zA-Z0-9\-_:.]/g, "-");
154
+ }
155
+ function removeDuplicateJsonLdScripts(scriptId, scriptKey, json) {
156
+ if (typeof document === "undefined")
157
+ return;
158
+ const canonical = document.getElementById(scriptId);
159
+ const allJsonLdScripts = Array.from(document.querySelectorAll("script[type='application/ld+json']"));
160
+ allJsonLdScripts.forEach((script) => {
161
+ if (script === canonical)
162
+ return;
163
+ const sameId = script.id === scriptId;
164
+ const sameKey = script.getAttribute("data-jsonld-key") === scriptKey;
165
+ const samePayloadOutsideHead = script.parentElement !== document.head && (script.textContent ?? "") === json;
166
+ if (sameId || sameKey || samePayloadOutsideHead) {
167
+ script.remove();
168
+ }
169
+ });
170
+ }
171
+ function isEscaped(input, index) {
172
+ let slashCount = 0;
173
+ for (let i = index - 1; i >= 0 && input[i] === "\\"; i -= 1) {
174
+ slashCount += 1;
175
+ }
176
+ return slashCount % 2 === 1;
177
+ }
178
+ function repairJsonInnerQuotes(input) {
179
+ let repaired = "";
180
+ let inString = false;
181
+ for (let i = 0; i < input.length; i += 1) {
182
+ const ch = input[i];
183
+ if (ch !== "\"") {
184
+ repaired += ch;
185
+ continue;
186
+ }
187
+ if (isEscaped(input, i)) {
188
+ repaired += ch;
189
+ continue;
190
+ }
191
+ if (!inString) {
192
+ inString = true;
193
+ repaired += ch;
194
+ continue;
195
+ }
196
+ let nextNonSpace = i + 1;
197
+ while (nextNonSpace < input.length && /\s/.test(input[nextNonSpace])) {
198
+ nextNonSpace += 1;
199
+ }
200
+ const next = input[nextNonSpace];
201
+ const closesString = nextNonSpace >= input.length ||
202
+ next === "," ||
203
+ next === "}" ||
204
+ next === "]" ||
205
+ next === ":";
206
+ if (closesString) {
207
+ inString = false;
208
+ repaired += ch;
209
+ }
210
+ else {
211
+ // Heuristic: treat inner raw quotes (commonly from HTML attributes) as escaped.
212
+ repaired += "\\\"";
213
+ }
214
+ }
215
+ return repaired;
216
+ }
217
+ function tryParseLooseJson(value) {
218
+ try {
219
+ return JSON.parse(value);
220
+ }
221
+ catch {
222
+ const repaired = repairJsonInnerQuotes(value);
223
+ if (repaired !== value) {
224
+ return JSON.parse(repaired);
225
+ }
226
+ throw new Error("Invalid JSON");
227
+ }
228
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../src/pages/api/assets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAI5D,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,eAAe,iBA0B/E;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../src/pages/api/assets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAoB5D,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,eAAe,iBAwC/E;AAED,eAAe,gBAAgB,CAAC"}
@@ -3,6 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.assetsApiHandler = assetsApiHandler;
4
4
  const cxf_auth_1 = require("../../lib/cxf-auth");
5
5
  const api_route_helpers_1 = require("../../lib/api-route-helpers");
6
+ const assets_query_params_1 = require("../../lib/assets-query-params");
7
+ const CONDITIONAL_REQUEST_HEADERS = ["if-none-match", "if-modified-since"];
8
+ const CACHE_RESPONSE_HEADERS = ["cache-control", "etag", "last-modified", "expires", "vary"];
9
+ function getHeaderValue(header) {
10
+ if (Array.isArray(header))
11
+ return header.join(", ");
12
+ return header;
13
+ }
14
+ function forwardResponseHeaders(res, response) {
15
+ for (const headerName of CACHE_RESPONSE_HEADERS) {
16
+ const value = response.headers.get(headerName);
17
+ if (value)
18
+ res.setHeader(headerName, value);
19
+ }
20
+ }
6
21
  async function assetsApiHandler(req, res) {
7
22
  if (req.method !== "GET") {
8
23
  res.setHeader("Allow", "GET");
@@ -11,15 +26,26 @@ async function assetsApiHandler(req, res) {
11
26
  try {
12
27
  const baseUrl = (0, cxf_auth_1.getCxfBaseUrl)();
13
28
  const normalizedPath = (0, api_route_helpers_1.normalizePath)(req.query.path);
14
- const targetUrl = `${baseUrl}/assets/${normalizedPath}${(0, api_route_helpers_1.buildQueryString)(req.query)}`;
29
+ const paramsFromCookie = (0, assets_query_params_1.extractAssetQueryParamsFromCookie)(req.headers.cookie || null);
30
+ const mergedQuery = {
31
+ ...paramsFromCookie,
32
+ ...req.query,
33
+ };
34
+ const targetUrl = `${baseUrl}/assets/${normalizedPath}${(0, api_route_helpers_1.buildQueryString)(mergedQuery)}`;
35
+ const extraHeaders = CONDITIONAL_REQUEST_HEADERS.reduce((acc, headerName) => {
36
+ acc[headerName] = getHeaderValue(req.headers[headerName]);
37
+ return acc;
38
+ }, {});
15
39
  const { response, newTokens } = await (0, cxf_auth_1.makeAuthenticatedRequest)(targetUrl, {
16
40
  method: "GET",
17
41
  cookieHeader: req.headers.cookie || null,
18
42
  retryOnAuthError: false,
43
+ extraHeaders,
19
44
  });
20
45
  const setCookieHeaders = (0, cxf_auth_1.extractSetCookieHeaders)(response);
21
46
  const tokens = (0, cxf_auth_1.extractTokensFromSetCookie)(setCookieHeaders);
22
47
  const finalTokens = tokens.accessToken || tokens.refreshToken ? tokens : newTokens;
48
+ forwardResponseHeaders(res, response);
23
49
  (0, api_route_helpers_1.setAuthCookies)(res, finalTokens);
24
50
  return (0, api_route_helpers_1.sendResponse)(res, response);
25
51
  }
@@ -1,9 +1,11 @@
1
1
  import type { AppProps } from "next/app";
2
2
  import * as React from "react";
3
+ import { type AssetQueryParams } from "../lib/assets-query-params";
3
4
  type CxfAppProps = AppProps & {
4
5
  tokenClass?: string;
5
6
  appRootId?: string;
7
+ assetsQueryParams?: AssetQueryParams;
6
8
  };
7
- export declare function CxfApp({ Component, pageProps, tokenClass, appRootId }: CxfAppProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<React.AwaitedReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
9
+ export declare function CxfApp({ Component, pageProps, tokenClass, appRootId, assetsQueryParams, }: CxfAppProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<React.AwaitedReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
8
10
  export default CxfApp;
9
11
  //# sourceMappingURL=app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/pages/app.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,WAAW,GAAG,QAAQ,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAYF,wBAAgB,MAAM,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAyB,EAAE,EAAE,WAAW,iKAkLlG;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/pages/app.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,gBAAgB,EAA2B,MAAM,4BAA4B,CAAC;AAE5F,KAAK,WAAW,GAAG,QAAQ,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;CACtC,CAAC;AAYF,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAyB,EACzB,iBAAiB,GAClB,EAAE,WAAW,iKAoLb;AAED,eAAe,MAAM,CAAC"}
package/dist/pages/app.js CHANGED
@@ -43,15 +43,17 @@ const query_1 = require("@plasmicapp/react-web/lib/query");
43
43
  const head_1 = __importDefault(require("next/head"));
44
44
  const link_1 = __importDefault(require("next/link"));
45
45
  const React = __importStar(require("react"));
46
+ const assets_query_params_1 = require("../lib/assets-query-params");
46
47
  function isNonEmptyObject(value) {
47
48
  return !!value && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length > 0;
48
49
  }
49
- function CxfApp({ Component, pageProps, tokenClass, appRootId = "plasmic-app" }) {
50
+ function CxfApp({ Component, pageProps, tokenClass, appRootId = "plasmic-app", assetsQueryParams, }) {
50
51
  const storeRef = React.useRef({
51
52
  endpointData: {},
52
53
  queryCache: {},
53
54
  meta: {},
54
55
  });
56
+ (0, assets_query_params_1.useSyncAssetQueryParams)(assetsQueryParams);
55
57
  // Merge page props from hard loads / direct SSR navigation.
56
58
  const incoming = pageProps;
57
59
  if (isNonEmptyObject(incoming.endpointData)) {
@@ -1 +1 @@
1
- {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAGA,wBAAgB,sBAAsB,SA4GrC"}
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,SA6RrC"}
package/dist/register.js CHANGED
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.registerCodeComponents = registerCodeComponents;
4
4
  const host_1 = require("@plasmicapp/host");
5
5
  const ApiCall_1 = require("./components/ApiCall");
6
+ const MetadataOverrides_1 = require("./components/MetadataOverrides");
7
+ const JsonLdSchemas_1 = require("./components/JsonLdSchemas");
6
8
  function registerCodeComponents() {
7
9
  (0, host_1.registerComponent)(ApiCall_1.ApiCall, {
8
10
  name: "ApiCall",
@@ -17,14 +19,13 @@ function registerCodeComponents() {
17
19
  type: "choice",
18
20
  displayName: "API",
19
21
  options: ["endpoint", "contact", "dev", "user"],
20
- defaultValue: "contact",
22
+ defaultValue: "endpoint",
21
23
  description: "Select which API to use. Path should exclude leading version segments.",
22
24
  },
23
25
  path: {
24
26
  type: "string",
25
27
  displayName: "Path",
26
28
  description: "Short path. Example: 'me' or 'blog-posts'.",
27
- defaultValue: "me",
28
29
  },
29
30
  method: {
30
31
  type: "choice",
@@ -49,7 +50,7 @@ function registerCodeComponents() {
49
50
  type: "boolean",
50
51
  displayName: "Auto Fetch",
51
52
  description: "Automatically fetch on mount (default: true for GET, false for others).",
52
- advanced: true,
53
+ defaultValue: true,
53
54
  },
54
55
  canvasAutoFetchCooldownMs: {
55
56
  type: "number",
@@ -111,6 +112,171 @@ function registerCodeComponents() {
111
112
  },
112
113
  ],
113
114
  });
115
+ (0, host_1.registerComponent)(MetadataOverrides_1.MetadataOverrides, {
116
+ name: "MetadataOverrides",
117
+ displayName: "Metadata Overrides",
118
+ importName: "MetadataOverrides",
119
+ importPath: "@mints-cloud/cxf-codegen/components/MetadataOverrides",
120
+ section: "SEO",
121
+ description: "Merges Site Settings defaults with Page Meta overrides, writes head metadata, and emits Organization JSON-LD.",
122
+ props: {
123
+ siteSettings: {
124
+ type: "object",
125
+ displayName: "Site Settings",
126
+ description: "Site-level defaults. Asset paths can be relative and are converted to absolute URLs.",
127
+ defaultValue: {
128
+ identity_and_branding: {
129
+ site_name: "Site Name",
130
+ primary_color: "#FFFFFF",
131
+ },
132
+ domains_and_locales: {
133
+ primary_domain: "https://www.example.com",
134
+ additional_domains: [],
135
+ },
136
+ seo_defaults: {
137
+ seo_title_template: "%pageTitle% | %siteName%",
138
+ canonical_base: "https://www.example.com",
139
+ robots_indexing: "noindex",
140
+ robots_follow: "nofollow",
141
+ default_seo_title: "Site Name",
142
+ default_meta_description: "Default site description",
143
+ },
144
+ },
145
+ },
146
+ pageMeta: {
147
+ type: "object",
148
+ displayName: "Page Meta",
149
+ description: "Page-specific overrides for title, description, keywords, robots, canonical and social metadata.",
150
+ defaultValue: {
151
+ default: {
152
+ page_title: "Home",
153
+ permalink: "/",
154
+ },
155
+ seo_per_page: {
156
+ keywords: ["example keyword", "another keyword"],
157
+ },
158
+ social_and_sharing: {},
159
+ },
160
+ },
161
+ },
162
+ });
163
+ (0, host_1.registerComponent)(JsonLdSchemas_1.FaqJsonLd, {
164
+ name: "FaqJsonLd",
165
+ displayName: "FAQ JSON-LD",
166
+ importName: "FaqJsonLd",
167
+ importPath: "@mints-cloud/cxf-codegen/components/JsonLdSchemas",
168
+ section: "SEO",
169
+ description: "Outputs schema.org FAQPage JSON-LD from question/answer entries.",
170
+ props: {
171
+ items: {
172
+ type: "object",
173
+ displayName: "FAQ Items",
174
+ description: "Array with shape: [{ question, answer }]. answer supports HTML; raw inner quotes are auto-handled.",
175
+ defaultValue: [
176
+ {
177
+ question: "What documents do I need for a loan?",
178
+ answer: "A valid ID and your collateral item.",
179
+ },
180
+ ],
181
+ },
182
+ metadataSource: {
183
+ type: "object",
184
+ displayName: "Metadata Source",
185
+ description: "Object with { siteSettings, pageMeta } from MetadataOverrides. Provides URL and language.",
186
+ defaultValue: { siteSettings: {}, pageMeta: {} },
187
+ advanced: true,
188
+ },
189
+ schemaId: {
190
+ type: "string",
191
+ displayName: "Schema ID",
192
+ advanced: true,
193
+ },
194
+ scriptKey: {
195
+ type: "string",
196
+ displayName: "Script Key",
197
+ description: "Use when rendering multiple FAQ schemas on the same page.",
198
+ advanced: true,
199
+ },
200
+ },
201
+ });
202
+ (0, host_1.registerComponent)(JsonLdSchemas_1.BlogPostingJsonLd, {
203
+ name: "BlogPostingJsonLd",
204
+ displayName: "Blog Posting JSON-LD",
205
+ importName: "BlogPostingJsonLd",
206
+ importPath: "@mints-cloud/cxf-codegen/components/JsonLdSchemas",
207
+ section: "SEO",
208
+ description: "Outputs schema.org BlogPosting JSON-LD from CMS blog payload. Uses seo_per_page.keywords and references publisher from MetadataOverrides Organization JSON-LD.",
209
+ props: {
210
+ metadataSource: {
211
+ type: "object",
212
+ displayName: "Metadata Source",
213
+ description: "Object with { siteSettings, pageMeta } from MetadataOverrides. Provides URL and language.",
214
+ defaultValue: { siteSettings: {}, pageMeta: {} },
215
+ advanced: true,
216
+ },
217
+ blog: {
218
+ type: "object",
219
+ displayName: "Blog",
220
+ description: "Supports CMS shape with version.default/page_meta/seo_per_page/social_and_sharing.",
221
+ defaultValue: {
222
+ id: "blog-id",
223
+ version: {
224
+ created_at: "2026-02-15T10:00:00Z",
225
+ updated_at: "2026-02-15T10:00:00Z",
226
+ title: "Article title",
227
+ slug: "article-slug",
228
+ seo_per_page: {
229
+ page_meta_title: "Article SEO title",
230
+ page_meta_description: "Article SEO description",
231
+ keywords: ["pawn loans", "finance", "tips"],
232
+ },
233
+ default: {
234
+ cover_image: {
235
+ public_path: "/assets/cover-image",
236
+ },
237
+ blurb: "<p>Article summary</p>",
238
+ body: "<p>Article body</p>",
239
+ },
240
+ },
241
+ },
242
+ },
243
+ author: {
244
+ type: "object",
245
+ displayName: "Author",
246
+ description: "Primary author (name/url/type) and optional authors array [{ name, url, type }].",
247
+ },
248
+ scriptKey: {
249
+ type: "string",
250
+ displayName: "Script Key",
251
+ advanced: true,
252
+ },
253
+ },
254
+ });
255
+ (0, host_1.registerComponent)(JsonLdSchemas_1.CustomJsonLd, {
256
+ name: "CustomJsonLd",
257
+ displayName: "Custom JSON-LD",
258
+ importName: "CustomJsonLd",
259
+ importPath: "@mints-cloud/cxf-codegen/components/JsonLdSchemas",
260
+ section: "SEO",
261
+ description: "Outputs any custom JSON-LD payload when you need a schema type not covered by presets.",
262
+ props: {
263
+ schema: {
264
+ type: "object",
265
+ displayName: "Schema Object",
266
+ defaultValue: {
267
+ "@context": "https://schema.org",
268
+ "@type": "WebSite",
269
+ name: "Site Name",
270
+ url: "/",
271
+ },
272
+ },
273
+ scriptKey: {
274
+ type: "string",
275
+ displayName: "Script Key",
276
+ advanced: true,
277
+ },
278
+ },
279
+ });
114
280
  }
115
281
  // Auto-register when imported
116
282
  registerCodeComponents();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mints-cloud/cxf-codegen",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Plasmic CXF codegen library for Next.js applications",
5
5
  "author": "Ruben Gomez",
6
6
  "license": "MIT",
@@ -31,6 +31,14 @@
31
31
  "types": "./dist/components/ApiCall.d.ts",
32
32
  "default": "./dist/components/ApiCall.js"
33
33
  },
34
+ "./components/MetadataOverrides": {
35
+ "types": "./dist/components/MetadataOverrides.d.ts",
36
+ "default": "./dist/components/MetadataOverrides.js"
37
+ },
38
+ "./components/JsonLdSchemas": {
39
+ "types": "./dist/components/JsonLdSchemas.d.ts",
40
+ "default": "./dist/components/JsonLdSchemas.js"
41
+ },
34
42
  "./lib/api-call-hooks": {
35
43
  "types": "./dist/lib/api-call-hooks.d.ts",
36
44
  "default": "./dist/lib/api-call-hooks.js"
@@ -39,6 +47,10 @@
39
47
  "types": "./dist/lib/api-route-helpers.d.ts",
40
48
  "default": "./dist/lib/api-route-helpers.js"
41
49
  },
50
+ "./lib/assets-query-params": {
51
+ "types": "./dist/lib/assets-query-params.d.ts",
52
+ "default": "./dist/lib/assets-query-params.js"
53
+ },
42
54
  "./lib/cxf-auth": {
43
55
  "types": "./dist/lib/cxf-auth.d.ts",
44
56
  "default": "./dist/lib/cxf-auth.js"