@plasmicpkgs/plasmic-content-stack 0.0.189 → 0.0.191
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 -7
- package/dist/index.mjs +10 -12
- package/package.json +3 -3
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 ContentStackFetcherProps {
|
|
|
30
29
|
queryOptions?: [];
|
|
31
30
|
}) => void;
|
|
32
31
|
}
|
|
33
|
-
declare const ContentStackFetcherMeta:
|
|
32
|
+
declare const ContentStackFetcherMeta: CodeComponentMeta<ContentStackFetcherProps>;
|
|
34
33
|
declare function ContentStackFetcher({ contentType, filterField, filterValue, queryOperator, limit, noAutoRepeat, children, className, noLayout, setControlContextData, }: ContentStackFetcherProps): React.JSX.Element;
|
|
35
34
|
interface ContentStackFieldProps {
|
|
36
35
|
className?: string;
|
|
@@ -39,7 +38,7 @@ interface ContentStackFieldProps {
|
|
|
39
38
|
data: Record<string, any>;
|
|
40
39
|
}) => void;
|
|
41
40
|
}
|
|
42
|
-
declare const ContentStackFieldMeta:
|
|
41
|
+
declare const ContentStackFieldMeta: CodeComponentMeta<ContentStackFieldProps>;
|
|
43
42
|
declare function ContentStackField({ objectPath, setControlContextData, ...rest }: ContentStackFieldProps): React.JSX.Element;
|
|
44
43
|
|
|
45
44
|
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 ContentStackFetcherProps {
|
|
|
30
29
|
queryOptions?: [];
|
|
31
30
|
}) => void;
|
|
32
31
|
}
|
|
33
|
-
declare const ContentStackFetcherMeta:
|
|
32
|
+
declare const ContentStackFetcherMeta: CodeComponentMeta<ContentStackFetcherProps>;
|
|
34
33
|
declare function ContentStackFetcher({ contentType, filterField, filterValue, queryOperator, limit, noAutoRepeat, children, className, noLayout, setControlContextData, }: ContentStackFetcherProps): React.JSX.Element;
|
|
35
34
|
interface ContentStackFieldProps {
|
|
36
35
|
className?: string;
|
|
@@ -39,7 +38,7 @@ interface ContentStackFieldProps {
|
|
|
39
38
|
data: Record<string, any>;
|
|
40
39
|
}) => void;
|
|
41
40
|
}
|
|
42
|
-
declare const ContentStackFieldMeta:
|
|
41
|
+
declare const ContentStackFieldMeta: CodeComponentMeta<ContentStackFieldProps>;
|
|
43
42
|
declare function ContentStackField({ objectPath, setControlContextData, ...rest }: ContentStackFieldProps): React.JSX.Element;
|
|
44
43
|
|
|
45
44
|
declare function registerAll(loader?: {
|
package/dist/index.js
CHANGED
|
@@ -173,7 +173,7 @@ var ContentStackFetcherMeta = {
|
|
|
173
173
|
var _a;
|
|
174
174
|
return (_a = ctx == null ? void 0 : ctx.filterFields) != null ? _a : [];
|
|
175
175
|
},
|
|
176
|
-
hidden: (props
|
|
176
|
+
hidden: (props) => !props.contentType
|
|
177
177
|
},
|
|
178
178
|
queryOperator: {
|
|
179
179
|
type: "choice",
|
|
@@ -183,7 +183,7 @@ var ContentStackFetcherMeta = {
|
|
|
183
183
|
var _a;
|
|
184
184
|
return (_a = ctx == null ? void 0 : ctx.queryOptions) != null ? _a : [];
|
|
185
185
|
},
|
|
186
|
-
hidden: (props
|
|
186
|
+
hidden: (props) => !props.filterField
|
|
187
187
|
},
|
|
188
188
|
filterValue: {
|
|
189
189
|
type: "string",
|
|
@@ -389,14 +389,16 @@ function ContentStackFetcher({
|
|
|
389
389
|
);
|
|
390
390
|
let renderedData;
|
|
391
391
|
if (filteredData) {
|
|
392
|
-
const filtered = Object.values(filteredData).flatMap(
|
|
392
|
+
const filtered = Object.values(filteredData).flatMap(
|
|
393
|
+
(model) => model
|
|
394
|
+
).length;
|
|
393
395
|
if (filtered === 0) {
|
|
394
396
|
return /* @__PURE__ */ import_react.default.createElement("div", null, "No published entry found ");
|
|
395
397
|
}
|
|
396
|
-
const
|
|
398
|
+
const filteredEntries = Object.values(filteredData).flatMap(
|
|
397
399
|
(model) => Array.isArray(model) ? model : [model]
|
|
398
400
|
);
|
|
399
|
-
renderedData =
|
|
401
|
+
renderedData = filteredEntries == null ? void 0 : filteredEntries.map((item, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
400
402
|
import_host.DataProvider,
|
|
401
403
|
{
|
|
402
404
|
key: item._id,
|
|
@@ -407,10 +409,10 @@ function ContentStackFetcher({
|
|
|
407
409
|
/* @__PURE__ */ import_react.default.createElement(import_host.DataProvider, { name: makeDataProviderName(contentType), data: item }, (0, import_host.repeatedElement)(index, children))
|
|
408
410
|
));
|
|
409
411
|
} else {
|
|
410
|
-
const
|
|
412
|
+
const filteredEntries = Object.values(entriesData).flatMap(
|
|
411
413
|
(model) => Array.isArray(model) ? model : [model]
|
|
412
414
|
);
|
|
413
|
-
renderedData =
|
|
415
|
+
renderedData = filteredEntries == null ? void 0 : filteredEntries.map((item, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
414
416
|
import_host.DataProvider,
|
|
415
417
|
{
|
|
416
418
|
key: item._id,
|
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/contentstack.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 { pascalCase } from "change-case";
|
|
13
9
|
import get from "dlv";
|
|
@@ -136,7 +132,7 @@ var ContentStackFetcherMeta = {
|
|
|
136
132
|
var _a;
|
|
137
133
|
return (_a = ctx == null ? void 0 : ctx.filterFields) != null ? _a : [];
|
|
138
134
|
},
|
|
139
|
-
hidden: (props
|
|
135
|
+
hidden: (props) => !props.contentType
|
|
140
136
|
},
|
|
141
137
|
queryOperator: {
|
|
142
138
|
type: "choice",
|
|
@@ -146,7 +142,7 @@ var ContentStackFetcherMeta = {
|
|
|
146
142
|
var _a;
|
|
147
143
|
return (_a = ctx == null ? void 0 : ctx.queryOptions) != null ? _a : [];
|
|
148
144
|
},
|
|
149
|
-
hidden: (props
|
|
145
|
+
hidden: (props) => !props.filterField
|
|
150
146
|
},
|
|
151
147
|
filterValue: {
|
|
152
148
|
type: "string",
|
|
@@ -352,14 +348,16 @@ function ContentStackFetcher({
|
|
|
352
348
|
);
|
|
353
349
|
let renderedData;
|
|
354
350
|
if (filteredData) {
|
|
355
|
-
const filtered = Object.values(filteredData).flatMap(
|
|
351
|
+
const filtered = Object.values(filteredData).flatMap(
|
|
352
|
+
(model) => model
|
|
353
|
+
).length;
|
|
356
354
|
if (filtered === 0) {
|
|
357
355
|
return /* @__PURE__ */ React.createElement("div", null, "No published entry found ");
|
|
358
356
|
}
|
|
359
|
-
const
|
|
357
|
+
const filteredEntries = Object.values(filteredData).flatMap(
|
|
360
358
|
(model) => Array.isArray(model) ? model : [model]
|
|
361
359
|
);
|
|
362
|
-
renderedData =
|
|
360
|
+
renderedData = filteredEntries == null ? void 0 : filteredEntries.map((item, index) => /* @__PURE__ */ React.createElement(
|
|
363
361
|
DataProvider,
|
|
364
362
|
{
|
|
365
363
|
key: item._id,
|
|
@@ -370,10 +368,10 @@ function ContentStackFetcher({
|
|
|
370
368
|
/* @__PURE__ */ React.createElement(DataProvider, { name: makeDataProviderName(contentType), data: item }, repeatedElement(index, children))
|
|
371
369
|
));
|
|
372
370
|
} else {
|
|
373
|
-
const
|
|
371
|
+
const filteredEntries = Object.values(entriesData).flatMap(
|
|
374
372
|
(model) => Array.isArray(model) ? model : [model]
|
|
375
373
|
);
|
|
376
|
-
renderedData =
|
|
374
|
+
renderedData = filteredEntries == null ? void 0 : filteredEntries.map((item, index) => /* @__PURE__ */ React.createElement(
|
|
377
375
|
DataProvider,
|
|
378
376
|
{
|
|
379
377
|
key: item._id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/plasmic-content-stack",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.191",
|
|
4
4
|
"description": "Plasmic ContentStack components.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
],
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@plasmicapp/host": "1.0.
|
|
35
|
+
"@plasmicapp/host": "1.0.235",
|
|
36
36
|
"@plasmicapp/query": "0.1.82",
|
|
37
37
|
"@types/dlv": "^1.1.2",
|
|
38
38
|
"@types/react": "^18.0.27",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"contentstack": "^3.15.1",
|
|
50
50
|
"dlv": "^1.1.3"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "380a91b2e7eac342c9b2ddafdacd84b4a812b795"
|
|
53
53
|
}
|