@orion-studios/payload-studio 0.6.0-beta.41 → 0.6.0-beta.42

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.
@@ -328,6 +328,13 @@ var inspectorDefinitionByBlockType = {
328
328
  { group: "basics", inlineEditable: true, key: "kicker", label: "Kicker", type: "text" },
329
329
  { group: "basics", inlineEditable: true, key: "headline", label: "Headline", type: "text" },
330
330
  { group: "basics", inlineEditable: true, key: "subheadline", label: "Subheadline", type: "textarea" },
331
+ {
332
+ group: "basics",
333
+ key: "marqueeItemsText",
334
+ label: "Scrolling Bar Options",
335
+ tags: ["marquee", "scrolling", "bar", "categories"],
336
+ type: "textarea"
337
+ },
331
338
  {
332
339
  group: "basics",
333
340
  key: "variant",
package/dist/index.js CHANGED
@@ -4585,6 +4585,13 @@ var inspectorDefinitionByBlockType = {
4585
4585
  { group: "basics", inlineEditable: true, key: "kicker", label: "Kicker", type: "text" },
4586
4586
  { group: "basics", inlineEditable: true, key: "headline", label: "Headline", type: "text" },
4587
4587
  { group: "basics", inlineEditable: true, key: "subheadline", label: "Subheadline", type: "textarea" },
4588
+ {
4589
+ group: "basics",
4590
+ key: "marqueeItemsText",
4591
+ label: "Scrolling Bar Options",
4592
+ tags: ["marquee", "scrolling", "bar", "categories"],
4593
+ type: "textarea"
4594
+ },
4588
4595
  {
4589
4596
  group: "basics",
4590
4597
  key: "variant",
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  import "./chunk-ZTXJG4K5.mjs";
15
15
  import {
16
16
  studio_pages_exports
17
- } from "./chunk-OL53KHTB.mjs";
17
+ } from "./chunk-SXPIWE74.mjs";
18
18
  import "./chunk-OQSEJXC4.mjs";
19
19
  import "./chunk-7ZMXZRBP.mjs";
20
20
  import {
@@ -837,6 +837,13 @@ var inspectorDefinitionByBlockType = {
837
837
  { group: "basics", inlineEditable: true, key: "kicker", label: "Kicker", type: "text" },
838
838
  { group: "basics", inlineEditable: true, key: "headline", label: "Headline", type: "text" },
839
839
  { group: "basics", inlineEditable: true, key: "subheadline", label: "Subheadline", type: "textarea" },
840
+ {
841
+ group: "basics",
842
+ key: "marqueeItemsText",
843
+ label: "Scrolling Bar Options",
844
+ tags: ["marquee", "scrolling", "bar", "categories"],
845
+ type: "textarea"
846
+ },
840
847
  {
841
848
  group: "basics",
842
849
  key: "variant",
@@ -1238,6 +1245,26 @@ function BlockInspectorRenderer({
1238
1245
  children: [
1239
1246
  source.loading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "orion-builder-settings-note", children: "Loading media library..." }) : null,
1240
1247
  source.error ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "orion-builder-settings-error", children: source.error }) : null,
1248
+ selectedSourceMedia?.url ? (
1249
+ // eslint-disable-next-line @next/next/no-img-element
1250
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1251
+ "img",
1252
+ {
1253
+ alt: selectedSourceMedia.alt || source.label,
1254
+ src: selectedSourceMedia.url,
1255
+ style: {
1256
+ aspectRatio: "16 / 9",
1257
+ border: "1px solid rgba(35, 51, 82, 0.14)",
1258
+ borderRadius: 10,
1259
+ display: "block",
1260
+ marginBottom: "0.7rem",
1261
+ objectFit: effectiveMedia.fit,
1262
+ objectPosition: `${effectiveMedia.positionX}% ${effectiveMedia.positionY}%`,
1263
+ width: "100%"
1264
+ }
1265
+ }
1266
+ )
1267
+ ) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "orion-builder-settings-empty", children: "No image selected." }),
1241
1268
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "orion-builder-settings-label", children: [
1242
1269
  source.label,
1243
1270
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
@@ -3151,6 +3178,19 @@ var toMediaLibraryItem2 = (value) => {
3151
3178
  url
3152
3179
  };
3153
3180
  };
3181
+ var mediaFromImageURL = (url, fallbackLabel) => {
3182
+ if (typeof url !== "string" || url.trim().length === 0) {
3183
+ return null;
3184
+ }
3185
+ const normalizedURL = url.trim();
3186
+ const filename = normalizedURL.split("/").filter(Boolean).pop() || fallbackLabel;
3187
+ return {
3188
+ alt: fallbackLabel,
3189
+ filename,
3190
+ id: `url:${normalizedURL}`,
3191
+ url: normalizedURL
3192
+ };
3193
+ };
3154
3194
  var mediaLabel2 = (item) => item.filename || item.alt || `Media #${item.id}`;
3155
3195
  var findMediaLibraryItem2 = (library, id) => {
3156
3196
  if (id === null) {
@@ -3248,10 +3288,10 @@ function ItemMediaControl({
3248
3288
  uploadLabel,
3249
3289
  uploading
3250
3290
  }) {
3251
- const selectedMediaID = getRelationID2(item[fieldName]);
3252
- const selectedRelationMedia = toMediaLibraryItem2(item[fieldName]);
3253
- const selectedMedia = selectedRelationMedia ?? findMediaLibraryItem2(mediaLibrary, selectedMediaID);
3254
3291
  const directImageURL = normalizeText(item[imageURLFieldName]);
3292
+ const selectedRelationMedia = toMediaLibraryItem2(item[fieldName]) ?? mediaFromImageURL(directImageURL, label);
3293
+ const selectedMediaID = getRelationID2(item[fieldName]) ?? selectedRelationMedia?.id ?? null;
3294
+ const selectedMedia = selectedRelationMedia ?? findMediaLibraryItem2(mediaLibrary, selectedMediaID);
3255
3295
  const previewURL = selectedMedia?.url || directImageURL;
3256
3296
  const mediaSettings = getItemMediaSettings(item);
3257
3297
  const sourceOptions = selectedMedia && !mediaLibrary.some((libraryItem) => String(libraryItem.id) === String(selectedMedia.id)) ? [selectedMedia, ...mediaLibrary] : mediaLibrary;
@@ -3290,7 +3330,7 @@ function ItemMediaControl({
3290
3330
  onChange: (event) => onSelectItemMedia?.(itemIndex, fieldName, event.target.value),
3291
3331
  value: selectedMediaID !== null ? String(selectedMediaID) : "",
3292
3332
  children: [
3293
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "No library image" }),
3333
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "No image" }),
3294
3334
  sourceOptions.map((libraryItem) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: String(libraryItem.id), children: mediaLabel2(libraryItem) }, String(libraryItem.id)))
3295
3335
  ]
3296
3336
  }
@@ -3305,23 +3345,14 @@ function ItemMediaControl({
3305
3345
  {
3306
3346
  className: "orion-builder-settings-inline-btn",
3307
3347
  disabled: selectedMediaID === null,
3308
- onClick: () => onRemoveItemMedia?.(itemIndex, fieldName),
3348
+ onClick: () => {
3349
+ onRemoveItemMedia?.(itemIndex, fieldName);
3350
+ onUpdateItemField(itemIndex, imageURLFieldName, "");
3351
+ },
3309
3352
  type: "button",
3310
- children: "Remove Library Image"
3353
+ children: "Remove Image"
3311
3354
  }
3312
3355
  ),
3313
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "orion-builder-settings-label", children: [
3314
- "Direct Image URL",
3315
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3316
- "input",
3317
- {
3318
- className: "orion-builder-settings-input",
3319
- onChange: (event) => onUpdateItemField(itemIndex, imageURLFieldName, event.target.value),
3320
- type: "text",
3321
- value: directImageURL
3322
- }
3323
- )
3324
- ] }),
3325
3356
  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "orion-builder-settings-label", children: [
3326
3357
  uploadLabel,
3327
3358
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
@@ -3840,6 +3871,19 @@ var resolveMedia = (value) => {
3840
3871
  }
3841
3872
  return null;
3842
3873
  };
3874
+ var mediaFromImageURL2 = (url, fallbackLabel = "Current image") => {
3875
+ if (typeof url !== "string" || url.trim().length === 0) {
3876
+ return null;
3877
+ }
3878
+ const normalizedURL = url.trim();
3879
+ const filename = normalizedURL.split("/").filter(Boolean).pop() || fallbackLabel;
3880
+ return {
3881
+ alt: fallbackLabel,
3882
+ filename,
3883
+ id: `url:${normalizedURL}`,
3884
+ url: normalizedURL
3885
+ };
3886
+ };
3843
3887
  var resolveMediaWithURL = (value, imageURL, alt) => {
3844
3888
  const resolved = resolveMedia(value);
3845
3889
  if (resolved?.url) {
@@ -4596,7 +4640,7 @@ function BuilderPageEditor({
4596
4640
  const selectedBlockAdvancedSettings = isRecord6(selectedBlockSettings.advanced) ? selectedBlockSettings.advanced : {};
4597
4641
  const isArrayItemBlockSelected = selectedType === "featureGrid" || selectedType === "logoWall" || selectedType === "beforeAfter" || selectedType === "stats" || selectedType === "faq" || selectedType === "testimonials";
4598
4642
  const selectedBlockHasMediaSource = selectedType === "hero" || selectedType === "media";
4599
- const selectedBlockMediaValue = selectedType === "hero" ? selectedBlock?.media : selectedType === "media" ? selectedBlock?.image : null;
4643
+ const selectedBlockMediaValue = selectedType === "hero" ? selectedBlock?.media ?? mediaFromImageURL2(selectedBlock?.backgroundImageURL, "Hero image") : selectedType === "media" ? selectedBlock?.image ?? mediaFromImageURL2(selectedBlock?.imageURL, "Section image") : null;
4600
4644
  const selectedItemRecord = typeof selectedItemIndex === "number" && selectedItemIndex >= 0 && selectedItemIndex < selectedItems.length && isRecord6(selectedItems[selectedItemIndex]) ? selectedItems[selectedItemIndex] : null;
4601
4645
  const editCopyInPanelEnabled = Boolean(selectedBlockAdvancedSettings.editCopyInPanel);
4602
4646
  const isBlockUploadTarget = (blockIndex, kind) => selectedIndex === blockIndex && uploadingTarget?.kind === kind;
@@ -810,6 +810,13 @@ var inspectorDefinitionByBlockType = {
810
810
  { group: "basics", inlineEditable: true, key: "kicker", label: "Kicker", type: "text" },
811
811
  { group: "basics", inlineEditable: true, key: "headline", label: "Headline", type: "text" },
812
812
  { group: "basics", inlineEditable: true, key: "subheadline", label: "Subheadline", type: "textarea" },
813
+ {
814
+ group: "basics",
815
+ key: "marqueeItemsText",
816
+ label: "Scrolling Bar Options",
817
+ tags: ["marquee", "scrolling", "bar", "categories"],
818
+ type: "textarea"
819
+ },
813
820
  {
814
821
  group: "basics",
815
822
  key: "variant",
@@ -1211,6 +1218,26 @@ function BlockInspectorRenderer({
1211
1218
  children: [
1212
1219
  source.loading ? /* @__PURE__ */ jsx3("div", { className: "orion-builder-settings-note", children: "Loading media library..." }) : null,
1213
1220
  source.error ? /* @__PURE__ */ jsx3("div", { className: "orion-builder-settings-error", children: source.error }) : null,
1221
+ selectedSourceMedia?.url ? (
1222
+ // eslint-disable-next-line @next/next/no-img-element
1223
+ /* @__PURE__ */ jsx3(
1224
+ "img",
1225
+ {
1226
+ alt: selectedSourceMedia.alt || source.label,
1227
+ src: selectedSourceMedia.url,
1228
+ style: {
1229
+ aspectRatio: "16 / 9",
1230
+ border: "1px solid rgba(35, 51, 82, 0.14)",
1231
+ borderRadius: 10,
1232
+ display: "block",
1233
+ marginBottom: "0.7rem",
1234
+ objectFit: effectiveMedia.fit,
1235
+ objectPosition: `${effectiveMedia.positionX}% ${effectiveMedia.positionY}%`,
1236
+ width: "100%"
1237
+ }
1238
+ }
1239
+ )
1240
+ ) : /* @__PURE__ */ jsx3("div", { className: "orion-builder-settings-empty", children: "No image selected." }),
1214
1241
  /* @__PURE__ */ jsxs3("label", { className: "orion-builder-settings-label", children: [
1215
1242
  source.label,
1216
1243
  /* @__PURE__ */ jsxs3(
@@ -3031,6 +3058,19 @@ var toMediaLibraryItem2 = (value) => {
3031
3058
  url
3032
3059
  };
3033
3060
  };
3061
+ var mediaFromImageURL = (url, fallbackLabel) => {
3062
+ if (typeof url !== "string" || url.trim().length === 0) {
3063
+ return null;
3064
+ }
3065
+ const normalizedURL = url.trim();
3066
+ const filename = normalizedURL.split("/").filter(Boolean).pop() || fallbackLabel;
3067
+ return {
3068
+ alt: fallbackLabel,
3069
+ filename,
3070
+ id: `url:${normalizedURL}`,
3071
+ url: normalizedURL
3072
+ };
3073
+ };
3034
3074
  var mediaLabel2 = (item) => item.filename || item.alt || `Media #${item.id}`;
3035
3075
  var findMediaLibraryItem2 = (library, id) => {
3036
3076
  if (id === null) {
@@ -3128,10 +3168,10 @@ function ItemMediaControl({
3128
3168
  uploadLabel,
3129
3169
  uploading
3130
3170
  }) {
3131
- const selectedMediaID = getRelationID2(item[fieldName]);
3132
- const selectedRelationMedia = toMediaLibraryItem2(item[fieldName]);
3133
- const selectedMedia = selectedRelationMedia ?? findMediaLibraryItem2(mediaLibrary, selectedMediaID);
3134
3171
  const directImageURL = normalizeText(item[imageURLFieldName]);
3172
+ const selectedRelationMedia = toMediaLibraryItem2(item[fieldName]) ?? mediaFromImageURL(directImageURL, label);
3173
+ const selectedMediaID = getRelationID2(item[fieldName]) ?? selectedRelationMedia?.id ?? null;
3174
+ const selectedMedia = selectedRelationMedia ?? findMediaLibraryItem2(mediaLibrary, selectedMediaID);
3135
3175
  const previewURL = selectedMedia?.url || directImageURL;
3136
3176
  const mediaSettings = getItemMediaSettings(item);
3137
3177
  const sourceOptions = selectedMedia && !mediaLibrary.some((libraryItem) => String(libraryItem.id) === String(selectedMedia.id)) ? [selectedMedia, ...mediaLibrary] : mediaLibrary;
@@ -3170,7 +3210,7 @@ function ItemMediaControl({
3170
3210
  onChange: (event) => onSelectItemMedia?.(itemIndex, fieldName, event.target.value),
3171
3211
  value: selectedMediaID !== null ? String(selectedMediaID) : "",
3172
3212
  children: [
3173
- /* @__PURE__ */ jsx12("option", { value: "", children: "No library image" }),
3213
+ /* @__PURE__ */ jsx12("option", { value: "", children: "No image" }),
3174
3214
  sourceOptions.map((libraryItem) => /* @__PURE__ */ jsx12("option", { value: String(libraryItem.id), children: mediaLabel2(libraryItem) }, String(libraryItem.id)))
3175
3215
  ]
3176
3216
  }
@@ -3185,23 +3225,14 @@ function ItemMediaControl({
3185
3225
  {
3186
3226
  className: "orion-builder-settings-inline-btn",
3187
3227
  disabled: selectedMediaID === null,
3188
- onClick: () => onRemoveItemMedia?.(itemIndex, fieldName),
3228
+ onClick: () => {
3229
+ onRemoveItemMedia?.(itemIndex, fieldName);
3230
+ onUpdateItemField(itemIndex, imageURLFieldName, "");
3231
+ },
3189
3232
  type: "button",
3190
- children: "Remove Library Image"
3233
+ children: "Remove Image"
3191
3234
  }
3192
3235
  ),
3193
- /* @__PURE__ */ jsxs11("label", { className: "orion-builder-settings-label", children: [
3194
- "Direct Image URL",
3195
- /* @__PURE__ */ jsx12(
3196
- "input",
3197
- {
3198
- className: "orion-builder-settings-input",
3199
- onChange: (event) => onUpdateItemField(itemIndex, imageURLFieldName, event.target.value),
3200
- type: "text",
3201
- value: directImageURL
3202
- }
3203
- )
3204
- ] }),
3205
3236
  /* @__PURE__ */ jsxs11("label", { className: "orion-builder-settings-label", children: [
3206
3237
  uploadLabel,
3207
3238
  /* @__PURE__ */ jsx12(
@@ -3720,6 +3751,19 @@ var resolveMedia = (value) => {
3720
3751
  }
3721
3752
  return null;
3722
3753
  };
3754
+ var mediaFromImageURL2 = (url, fallbackLabel = "Current image") => {
3755
+ if (typeof url !== "string" || url.trim().length === 0) {
3756
+ return null;
3757
+ }
3758
+ const normalizedURL = url.trim();
3759
+ const filename = normalizedURL.split("/").filter(Boolean).pop() || fallbackLabel;
3760
+ return {
3761
+ alt: fallbackLabel,
3762
+ filename,
3763
+ id: `url:${normalizedURL}`,
3764
+ url: normalizedURL
3765
+ };
3766
+ };
3723
3767
  var resolveMediaWithURL = (value, imageURL, alt) => {
3724
3768
  const resolved = resolveMedia(value);
3725
3769
  if (resolved?.url) {
@@ -4476,7 +4520,7 @@ function BuilderPageEditor({
4476
4520
  const selectedBlockAdvancedSettings = isRecord6(selectedBlockSettings.advanced) ? selectedBlockSettings.advanced : {};
4477
4521
  const isArrayItemBlockSelected = selectedType === "featureGrid" || selectedType === "logoWall" || selectedType === "beforeAfter" || selectedType === "stats" || selectedType === "faq" || selectedType === "testimonials";
4478
4522
  const selectedBlockHasMediaSource = selectedType === "hero" || selectedType === "media";
4479
- const selectedBlockMediaValue = selectedType === "hero" ? selectedBlock?.media : selectedType === "media" ? selectedBlock?.image : null;
4523
+ const selectedBlockMediaValue = selectedType === "hero" ? selectedBlock?.media ?? mediaFromImageURL2(selectedBlock?.backgroundImageURL, "Hero image") : selectedType === "media" ? selectedBlock?.image ?? mediaFromImageURL2(selectedBlock?.imageURL, "Section image") : null;
4480
4524
  const selectedItemRecord = typeof selectedItemIndex === "number" && selectedItemIndex >= 0 && selectedItemIndex < selectedItems.length && isRecord6(selectedItems[selectedItemIndex]) ? selectedItems[selectedItemIndex] : null;
4481
4525
  const editCopyInPanelEnabled = Boolean(selectedBlockAdvancedSettings.editCopyInPanel);
4482
4526
  const isBlockUploadTarget = (blockIndex, kind) => selectedIndex === blockIndex && uploadingTarget?.kind === kind;
@@ -662,6 +662,13 @@ var inspectorDefinitionByBlockType = {
662
662
  { group: "basics", inlineEditable: true, key: "kicker", label: "Kicker", type: "text" },
663
663
  { group: "basics", inlineEditable: true, key: "headline", label: "Headline", type: "text" },
664
664
  { group: "basics", inlineEditable: true, key: "subheadline", label: "Subheadline", type: "textarea" },
665
+ {
666
+ group: "basics",
667
+ key: "marqueeItemsText",
668
+ label: "Scrolling Bar Options",
669
+ tags: ["marquee", "scrolling", "bar", "categories"],
670
+ type: "textarea"
671
+ },
665
672
  {
666
673
  group: "basics",
667
674
  key: "variant",
@@ -7,7 +7,7 @@ import {
7
7
  pageStudioModuleManifest,
8
8
  resolveBuilderThemeTokens,
9
9
  toEditorInitialDoc
10
- } from "../chunk-OL53KHTB.mjs";
10
+ } from "../chunk-SXPIWE74.mjs";
11
11
  import "../chunk-OQSEJXC4.mjs";
12
12
  import {
13
13
  createDefaultStudioDocument,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-studios/payload-studio",
3
- "version": "0.6.0-beta.41",
3
+ "version": "0.6.0-beta.42",
4
4
  "description": "Base CMS, builder, and custom admin toolkit for Orion Studios websites",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",