@plasmicpkgs/plasmic-sanity-io 1.0.177 → 1.0.178

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/index.js CHANGED
@@ -222,7 +222,7 @@ var sanityFetcherMeta = {
222
222
  },
223
223
  // Hide this if there's groq (so we're just using groq), or if there's
224
224
  // no docType selected yet
225
- hidden: (props, ctx) => !!props.groq || !props.docType
225
+ hidden: (props) => !!props.groq || !props.docType
226
226
  },
227
227
  filterParameter: {
228
228
  type: "choice",
@@ -233,14 +233,14 @@ var sanityFetcherMeta = {
233
233
  return (_a = ctx == null ? void 0 : ctx.queryOptions) != null ? _a : [];
234
234
  },
235
235
  // Hide if in groq mode, or if no filter field is selected yet
236
- hidden: (props, ctx) => !!props.groq || !props.filterField
236
+ hidden: (props) => !!props.groq || !props.filterField
237
237
  },
238
238
  filterValue: {
239
239
  type: "string",
240
240
  displayName: "Filter value",
241
241
  description: "Value to filter by, should be of filter field type",
242
242
  // Hide if in groq mode, or if no filter field is selected yet
243
- hidden: (props, ctx) => !!props.groq || !props.filterField
243
+ hidden: (props) => !!props.groq || !props.filterField
244
244
  },
245
245
  limit: {
246
246
  type: "string",
@@ -426,7 +426,7 @@ function SanityFetcher({
426
426
  const imageBuilder = (0, import_image_url.default)(sanity);
427
427
  const repElements = noAutoRepeat ? children : resultData.map((item, index) => {
428
428
  Object.keys(item).forEach((field) => {
429
- if (item[field]._type === "image") {
429
+ if (item[field] != null && item[field]._type === "image") {
430
430
  item[field].imgUrl = imageBuilder.image(item[field]).ignoreImageParams().toString();
431
431
  }
432
432
  });
@@ -476,8 +476,8 @@ function SanityField({
476
476
  if (!item) {
477
477
  return /* @__PURE__ */ import_react.default.createElement("div", null, "SanityField must be used within a SanityFetcher");
478
478
  }
479
- const displayableFields = Object.keys(item).filter((field2) => {
480
- const value = (0, import_dlv.default)(item, field2);
479
+ const displayableFields = Object.keys(item).filter((f) => {
480
+ const value = (0, import_dlv.default)(item, f);
481
481
  return typeof value !== "object" || value._type === "image";
482
482
  });
483
483
  setControlContextData == null ? void 0 : setControlContextData({
package/dist/index.mjs CHANGED
@@ -185,7 +185,7 @@ var sanityFetcherMeta = {
185
185
  },
186
186
  // Hide this if there's groq (so we're just using groq), or if there's
187
187
  // no docType selected yet
188
- hidden: (props, ctx) => !!props.groq || !props.docType
188
+ hidden: (props) => !!props.groq || !props.docType
189
189
  },
190
190
  filterParameter: {
191
191
  type: "choice",
@@ -196,14 +196,14 @@ var sanityFetcherMeta = {
196
196
  return (_a = ctx == null ? void 0 : ctx.queryOptions) != null ? _a : [];
197
197
  },
198
198
  // Hide if in groq mode, or if no filter field is selected yet
199
- hidden: (props, ctx) => !!props.groq || !props.filterField
199
+ hidden: (props) => !!props.groq || !props.filterField
200
200
  },
201
201
  filterValue: {
202
202
  type: "string",
203
203
  displayName: "Filter value",
204
204
  description: "Value to filter by, should be of filter field type",
205
205
  // Hide if in groq mode, or if no filter field is selected yet
206
- hidden: (props, ctx) => !!props.groq || !props.filterField
206
+ hidden: (props) => !!props.groq || !props.filterField
207
207
  },
208
208
  limit: {
209
209
  type: "string",
@@ -389,7 +389,7 @@ function SanityFetcher({
389
389
  const imageBuilder = imageUrlBuilder(sanity);
390
390
  const repElements = noAutoRepeat ? children : resultData.map((item, index) => {
391
391
  Object.keys(item).forEach((field) => {
392
- if (item[field]._type === "image") {
392
+ if (item[field] != null && item[field]._type === "image") {
393
393
  item[field].imgUrl = imageBuilder.image(item[field]).ignoreImageParams().toString();
394
394
  }
395
395
  });
@@ -439,8 +439,8 @@ function SanityField({
439
439
  if (!item) {
440
440
  return /* @__PURE__ */ React.createElement("div", null, "SanityField must be used within a SanityFetcher");
441
441
  }
442
- const displayableFields = Object.keys(item).filter((field2) => {
443
- const value = get(item, field2);
442
+ const displayableFields = Object.keys(item).filter((f) => {
443
+ const value = get(item, f);
444
444
  return typeof value !== "object" || value._type === "image";
445
445
  });
446
446
  setControlContextData == null ? void 0 : setControlContextData({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicpkgs/plasmic-sanity-io",
3
- "version": "1.0.177",
3
+ "version": "1.0.178",
4
4
  "description": "Plasmic Sanity.io components.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -47,5 +47,5 @@
47
47
  "react": ">=16.8.0",
48
48
  "react-dom": ">=16.8.0"
49
49
  },
50
- "gitHead": "7fdda11c2d8a17f38f4af56153ff6fbaf09d4b07"
50
+ "gitHead": "a97215477367b65bdef8124179aa6e30b3c18aa2"
51
51
  }