@mints-cloud/cxf-codegen 1.0.3 → 1.0.5

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/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.5",
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"