@blocklet/pages-kit 0.2.195 → 0.2.196

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.
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getComponents = void 0;
13
+ const component_1 = require("@blocklet/sdk/lib/component");
14
+ function getComponents({ mode, name } = {}) {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ return (0, component_1.call)({
17
+ name: 'pages-kit',
18
+ method: 'GET',
19
+ path: '/api/components',
20
+ params: { name, mode },
21
+ }).then((res) => res.data);
22
+ });
23
+ }
24
+ exports.getComponents = getComponents;
@@ -1,2 +1,17 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./pages-kit"), exports);
@@ -0,0 +1,20 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { call } from '@blocklet/sdk/lib/component';
11
+ export function getComponents({ mode, name } = {}) {
12
+ return __awaiter(this, void 0, void 0, function* () {
13
+ return call({
14
+ name: 'pages-kit',
15
+ method: 'GET',
16
+ path: '/api/components',
17
+ params: { name, mode },
18
+ }).then((res) => res.data);
19
+ });
20
+ }
@@ -1 +1 @@
1
- export {};
1
+ export * from './pages-kit';
@@ -0,0 +1,7 @@
1
+ import { CustomComponent, StateMode } from '../types';
2
+ export declare function getComponents({ mode, name }?: {
3
+ mode?: StateMode;
4
+ name?: string;
5
+ }): Promise<{
6
+ components: CustomComponent[];
7
+ }>;
@@ -1 +1 @@
1
- export {};
1
+ export * from './pages-kit';
@@ -1,8 +1,7 @@
1
- import { CustomComponentType } from '../types';
2
- export type Mode = 'draft' | 'staging' | 'production';
1
+ import { CustomComponent, StateMode } from '../types';
3
2
  export declare function getComponents({ mode, name }?: {
4
- mode?: Mode;
3
+ mode?: StateMode;
5
4
  name?: string;
6
5
  }): Promise<{
7
- components: CustomComponentType;
6
+ components: CustomComponent[];
8
7
  }>;
@@ -1,8 +1,8 @@
1
- import { CustomComponentType } from '../../types';
1
+ import { CustomComponent } from '../../types';
2
2
  export default function CustomComponentRenderer({ id, componentId, components, properties, }: {
3
3
  id: string;
4
4
  componentId: string;
5
- components?: CustomComponentType[];
5
+ components?: CustomComponent[];
6
6
  properties?: {
7
7
  [key: string]: {
8
8
  value: any;
@@ -1,4 +1,5 @@
1
- export type CustomComponentType = {
1
+ export type StateMode = 'draft' | 'staging' | 'production';
2
+ export type CustomComponent = {
2
3
  id: string;
3
4
  createdAt: string;
4
5
  updatedAt: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/pages-kit",
3
- "version": "0.2.195",
3
+ "version": "0.2.196",
4
4
  "description": "Pages Kit components and utils",
5
5
  "publishConfig": {
6
6
  "access": "public"