@plasmicpkgs/plasmic-sanity-io 1.0.213 → 1.0.215
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.d.mts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +9 -3
- package/dist/index.mjs +10 -8
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import registerComponent from '@plasmicapp/host/registerComponent';
|
|
2
|
-
import registerGlobalContext from '@plasmicapp/host/registerGlobalContext';
|
|
3
|
-
import { GlobalContextMeta, ComponentMeta } from '@plasmicapp/host';
|
|
1
|
+
import registerComponent, { CodeComponentMeta } from '@plasmicapp/host/registerComponent';
|
|
2
|
+
import registerGlobalContext, { GlobalContextMeta } from '@plasmicapp/host/registerGlobalContext';
|
|
4
3
|
import React, { ReactNode } from 'react';
|
|
5
4
|
|
|
6
5
|
declare function ensure<T>(x: T | null | undefined): T;
|
|
@@ -30,7 +29,7 @@ interface SanityFetcherProps {
|
|
|
30
29
|
queryOptions?: [];
|
|
31
30
|
}) => void;
|
|
32
31
|
}
|
|
33
|
-
declare const sanityFetcherMeta:
|
|
32
|
+
declare const sanityFetcherMeta: CodeComponentMeta<SanityFetcherProps>;
|
|
34
33
|
declare function SanityFetcher({ groq, docType, filterField, filterValue, filterParameter, limit, noAutoRepeat, children, className, noLayout, setControlContextData, }: SanityFetcherProps): React.JSX.Element;
|
|
35
34
|
interface SanityFieldProps {
|
|
36
35
|
className?: string;
|
|
@@ -41,7 +40,7 @@ interface SanityFieldProps {
|
|
|
41
40
|
isImage: boolean;
|
|
42
41
|
}) => void;
|
|
43
42
|
}
|
|
44
|
-
declare const sanityFieldMeta:
|
|
43
|
+
declare const sanityFieldMeta: CodeComponentMeta<SanityFieldProps>;
|
|
45
44
|
declare function SanityField({ className, path, field, setControlContextData, }: SanityFieldProps): React.JSX.Element;
|
|
46
45
|
|
|
47
46
|
declare function registerAll(loader?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import registerComponent from '@plasmicapp/host/registerComponent';
|
|
2
|
-
import registerGlobalContext from '@plasmicapp/host/registerGlobalContext';
|
|
3
|
-
import { GlobalContextMeta, ComponentMeta } from '@plasmicapp/host';
|
|
1
|
+
import registerComponent, { CodeComponentMeta } from '@plasmicapp/host/registerComponent';
|
|
2
|
+
import registerGlobalContext, { GlobalContextMeta } from '@plasmicapp/host/registerGlobalContext';
|
|
4
3
|
import React, { ReactNode } from 'react';
|
|
5
4
|
|
|
6
5
|
declare function ensure<T>(x: T | null | undefined): T;
|
|
@@ -30,7 +29,7 @@ interface SanityFetcherProps {
|
|
|
30
29
|
queryOptions?: [];
|
|
31
30
|
}) => void;
|
|
32
31
|
}
|
|
33
|
-
declare const sanityFetcherMeta:
|
|
32
|
+
declare const sanityFetcherMeta: CodeComponentMeta<SanityFetcherProps>;
|
|
34
33
|
declare function SanityFetcher({ groq, docType, filterField, filterValue, filterParameter, limit, noAutoRepeat, children, className, noLayout, setControlContextData, }: SanityFetcherProps): React.JSX.Element;
|
|
35
34
|
interface SanityFieldProps {
|
|
36
35
|
className?: string;
|
|
@@ -41,7 +40,7 @@ interface SanityFieldProps {
|
|
|
41
40
|
isImage: boolean;
|
|
42
41
|
}) => void;
|
|
43
42
|
}
|
|
44
|
-
declare const sanityFieldMeta:
|
|
43
|
+
declare const sanityFieldMeta: CodeComponentMeta<SanityFieldProps>;
|
|
45
44
|
declare function SanityField({ className, path, field, setControlContextData, }: SanityFieldProps): React.JSX.Element;
|
|
46
45
|
|
|
47
46
|
declare function registerAll(loader?: {
|
package/dist/index.js
CHANGED
|
@@ -378,7 +378,7 @@ function SanityFetcher({
|
|
|
378
378
|
if (!unfilteredData) {
|
|
379
379
|
return /* @__PURE__ */ import_react.default.createElement("div", { className }, "Loading...");
|
|
380
380
|
}
|
|
381
|
-
|
|
381
|
+
const sanityFields = unfilteredData.map((item) => {
|
|
382
382
|
const fields = Object.keys(item).filter((field) => {
|
|
383
383
|
const value = (0, import_dlv.default)(item, field);
|
|
384
384
|
return typeof value !== "object" && value._type !== "image" && typeof value === "number" || typeof value === "string" && !value.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/);
|
|
@@ -514,9 +514,15 @@ function registerAll(loader) {
|
|
|
514
514
|
}
|
|
515
515
|
};
|
|
516
516
|
if (loader) {
|
|
517
|
-
loader.registerGlobalContext(
|
|
517
|
+
loader.registerGlobalContext(
|
|
518
|
+
SanityCredentialsProvider,
|
|
519
|
+
sanityCredentialsProviderMeta
|
|
520
|
+
);
|
|
518
521
|
} else {
|
|
519
|
-
(0, import_registerGlobalContext.default)(
|
|
522
|
+
(0, import_registerGlobalContext.default)(
|
|
523
|
+
SanityCredentialsProvider,
|
|
524
|
+
sanityCredentialsProviderMeta
|
|
525
|
+
);
|
|
520
526
|
}
|
|
521
527
|
_registerComponent(SanityFetcher, sanityFetcherMeta);
|
|
522
528
|
_registerComponent(SanityField, sanityFieldMeta);
|
package/dist/index.mjs
CHANGED
|
@@ -3,11 +3,7 @@ import registerComponent from "@plasmicapp/host/registerComponent";
|
|
|
3
3
|
import registerGlobalContext from "@plasmicapp/host/registerGlobalContext";
|
|
4
4
|
|
|
5
5
|
// src/sanity.tsx
|
|
6
|
-
import {
|
|
7
|
-
DataProvider,
|
|
8
|
-
repeatedElement,
|
|
9
|
-
useSelector
|
|
10
|
-
} from "@plasmicapp/host";
|
|
6
|
+
import { DataProvider, repeatedElement, useSelector } from "@plasmicapp/host";
|
|
11
7
|
import { usePlasmicQueryData } from "@plasmicapp/query";
|
|
12
8
|
import { createClient } from "@sanity/client";
|
|
13
9
|
import imageUrlBuilder from "@sanity/image-url";
|
|
@@ -341,7 +337,7 @@ function SanityFetcher({
|
|
|
341
337
|
if (!unfilteredData) {
|
|
342
338
|
return /* @__PURE__ */ React.createElement("div", { className }, "Loading...");
|
|
343
339
|
}
|
|
344
|
-
|
|
340
|
+
const sanityFields = unfilteredData.map((item) => {
|
|
345
341
|
const fields = Object.keys(item).filter((field) => {
|
|
346
342
|
const value = get(item, field);
|
|
347
343
|
return typeof value !== "object" && value._type !== "image" && typeof value === "number" || typeof value === "string" && !value.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/);
|
|
@@ -477,9 +473,15 @@ function registerAll(loader) {
|
|
|
477
473
|
}
|
|
478
474
|
};
|
|
479
475
|
if (loader) {
|
|
480
|
-
loader.registerGlobalContext(
|
|
476
|
+
loader.registerGlobalContext(
|
|
477
|
+
SanityCredentialsProvider,
|
|
478
|
+
sanityCredentialsProviderMeta
|
|
479
|
+
);
|
|
481
480
|
} else {
|
|
482
|
-
registerGlobalContext(
|
|
481
|
+
registerGlobalContext(
|
|
482
|
+
SanityCredentialsProvider,
|
|
483
|
+
sanityCredentialsProviderMeta
|
|
484
|
+
);
|
|
483
485
|
}
|
|
484
486
|
_registerComponent(SanityFetcher, sanityFetcherMeta);
|
|
485
487
|
_registerComponent(SanityField, sanityFieldMeta);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/plasmic-sanity-io",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.215",
|
|
4
4
|
"description": "Plasmic Sanity.io components.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"analyze": "size-limit --why"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@plasmicapp/host": "1.0.
|
|
30
|
-
"@plasmicapp/query": "0.1.
|
|
29
|
+
"@plasmicapp/host": "1.0.234",
|
|
30
|
+
"@plasmicapp/query": "0.1.82",
|
|
31
31
|
"@types/dlv": "^1.1.2",
|
|
32
32
|
"@types/node": "^17.0.14",
|
|
33
33
|
"@types/react": "^18.2.33",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"react": ">=16.8.0",
|
|
46
46
|
"react-dom": ">=16.8.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "bbba4b6636e69a3441c6dbe4cefb860ed30e826f"
|
|
49
49
|
}
|