@teambit/compositions 0.0.659 → 0.0.662
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/{__preview-1645932113477.js → __preview-1646104918375.js} +1 -1
- package/dist/ui/composition-preview.d.ts +4 -24
- package/dist/ui/composition-preview.js +31 -17
- package/dist/ui/composition-preview.js.map +1 -1
- package/package-tar/teambit-compositions-0.0.662.tgz +0 -0
- package/package.json +11 -11
- package/ui/composition-preview.tsx +9 -42
- package/package-tar/teambit-compositions-0.0.659.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compositions_compositions@0.0.
|
|
1
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compositions_compositions@0.0.662/dist/compositions.docs.mdx')]
|
|
@@ -1,31 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ComponentPreviewProps } from '@teambit/preview.ui.component-preview';
|
|
3
3
|
import { Composition } from '../composition';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* HTML class
|
|
7
|
-
*/
|
|
8
|
-
className?: string;
|
|
9
|
-
/**
|
|
10
|
-
* component to render.
|
|
11
|
-
*/
|
|
12
|
-
component: ComponentModel;
|
|
4
|
+
interface ComponentCompositionProps extends ComponentPreviewProps {
|
|
13
5
|
/**
|
|
14
6
|
* composition to use for component rendering.
|
|
15
7
|
*/
|
|
16
8
|
composition?: Composition;
|
|
17
|
-
/**
|
|
18
|
-
* Additional query params to append at the end of the *hash*. Changing this property will not reload the composition.
|
|
19
|
-
*/
|
|
20
|
-
queryParams?: string | string[];
|
|
21
|
-
/**
|
|
22
|
-
* skip hot reload
|
|
23
|
-
*/
|
|
24
|
-
hotReload?: boolean;
|
|
25
|
-
};
|
|
26
|
-
export declare function ComponentComposition({ component, composition, hotReload, className, queryParams, }: ComponentCompositionProps): JSX.Element;
|
|
27
|
-
export declare namespace ComponentComposition {
|
|
28
|
-
var defaultProps: {
|
|
29
|
-
skipHotReload: boolean;
|
|
30
|
-
};
|
|
31
9
|
}
|
|
10
|
+
export declare function ComponentComposition({ composition, queryParams, ...rest }: ComponentCompositionProps): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.ComponentComposition = ComponentComposition;
|
|
7
9
|
|
|
10
|
+
function _extends2() {
|
|
11
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
+
|
|
13
|
+
_extends2 = function () {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function _objectWithoutProperties2() {
|
|
21
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
22
|
+
|
|
23
|
+
_objectWithoutProperties2 = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
29
|
+
|
|
8
30
|
function _react() {
|
|
9
31
|
const data = _interopRequireWildcard(require("react"));
|
|
10
32
|
|
|
@@ -29,29 +51,21 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
29
51
|
|
|
30
52
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
53
|
|
|
32
|
-
function ComponentComposition({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}) {
|
|
54
|
+
function ComponentComposition(_ref) {
|
|
55
|
+
let {
|
|
56
|
+
composition,
|
|
57
|
+
queryParams = []
|
|
58
|
+
} = _ref,
|
|
59
|
+
rest = (0, _objectWithoutProperties2().default)(_ref, ["composition", "queryParams"]);
|
|
39
60
|
const compositionParams = (0, _react().useMemo)(() => (composition ? [composition.identifier] : []).concat(queryParams), [composition === null || composition === void 0 ? void 0 : composition.identifier, queryParams]);
|
|
40
|
-
return /*#__PURE__*/_react().default.createElement(_previewUi().ComponentPreview, {
|
|
41
|
-
className: className,
|
|
42
|
-
component: component,
|
|
61
|
+
return /*#__PURE__*/_react().default.createElement(_previewUi().ComponentPreview, (0, _extends2().default)({}, rest, {
|
|
43
62
|
style: {
|
|
44
63
|
width: '100%',
|
|
45
64
|
height: '100%'
|
|
46
65
|
},
|
|
47
66
|
previewName: "compositions",
|
|
48
|
-
queryParams: compositionParams
|
|
49
|
-
|
|
50
|
-
});
|
|
67
|
+
queryParams: compositionParams
|
|
68
|
+
}));
|
|
51
69
|
}
|
|
52
70
|
|
|
53
|
-
ComponentComposition.defaultProps = {
|
|
54
|
-
skipHotReload: true
|
|
55
|
-
};
|
|
56
|
-
|
|
57
71
|
//# sourceMappingURL=composition-preview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["composition-preview.tsx"],"names":["ComponentComposition","
|
|
1
|
+
{"version":3,"sources":["composition-preview.tsx"],"names":["ComponentComposition","composition","queryParams","rest","compositionParams","identifier","concat","width","height"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAWO,SAASA,oBAAT,OAAqG;AAAA,MAAvE;AAAEC,IAAAA,WAAF;AAAeC,IAAAA,WAAW,GAAG;AAA7B,GAAuE;AAAA,MAAnCC,IAAmC;AAC1G,QAAMC,iBAAiB,GAAG,sBACxB,MAAM,CAACH,WAAW,GAAG,CAACA,WAAW,CAACI,UAAb,CAAH,GAA8B,EAA1C,EAA8CC,MAA9C,CAAqDJ,WAArD,CADkB,EAExB,CAACD,WAAD,aAACA,WAAD,uBAACA,WAAW,CAAEI,UAAd,EAA0BH,WAA1B,CAFwB,CAA1B;AAKA,sBACE,+BAAC,6BAAD,+BACMC,IADN;AAEE,IAAA,KAAK,EAAE;AAAEI,MAAAA,KAAK,EAAE,MAAT;AAAiBC,MAAAA,MAAM,EAAE;AAAzB,KAFT;AAGE,IAAA,WAAW,EAAC,cAHd;AAIE,IAAA,WAAW,EAAEJ;AAJf,KADF;AAQD","sourcesContent":["import React, { useMemo } from 'react';\nimport { ComponentPreview, ComponentPreviewProps } from '@teambit/preview.ui.component-preview';\n\nimport { Composition } from '../composition';\n\ninterface ComponentCompositionProps extends ComponentPreviewProps {\n /**\n * composition to use for component rendering.\n */\n composition?: Composition;\n}\n\nexport function ComponentComposition({ composition, queryParams = [], ...rest }: ComponentCompositionProps) {\n const compositionParams = useMemo(\n () => (composition ? [composition.identifier] : []).concat(queryParams),\n [composition?.identifier, queryParams]\n );\n\n return (\n <ComponentPreview\n {...rest}\n style={{ width: '100%', height: '100%' }}\n previewName=\"compositions\"\n queryParams={compositionParams}\n />\n );\n}\n"]}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/compositions",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.662",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/compositions/compositions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.compositions",
|
|
8
8
|
"name": "compositions",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.662"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.2.11",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"@teambit/documenter.ui.heading": "4.1.1",
|
|
24
24
|
"@teambit/documenter.ui.property-table": "4.1.3",
|
|
25
25
|
"@teambit/evangelist.elements.icon": "1.0.2",
|
|
26
|
-
"@teambit/component": "0.0.
|
|
26
|
+
"@teambit/component": "0.0.662",
|
|
27
27
|
"@teambit/compositions.model.composition-id": "0.0.486",
|
|
28
|
-
"@teambit/graphql": "0.0.
|
|
28
|
+
"@teambit/graphql": "0.0.662",
|
|
29
29
|
"@teambit/cli": "0.0.449",
|
|
30
|
-
"@teambit/dev-files": "0.0.
|
|
31
|
-
"@teambit/preview": "0.0.
|
|
32
|
-
"@teambit/schema": "0.0.
|
|
33
|
-
"@teambit/workspace": "0.0.
|
|
30
|
+
"@teambit/dev-files": "0.0.662",
|
|
31
|
+
"@teambit/preview": "0.0.662",
|
|
32
|
+
"@teambit/schema": "0.0.662",
|
|
33
|
+
"@teambit/workspace": "0.0.662",
|
|
34
34
|
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.487",
|
|
35
|
-
"@teambit/envs": "0.0.
|
|
35
|
+
"@teambit/envs": "0.0.662",
|
|
36
36
|
"@teambit/compositions.ui.compositions-menu-bar": "0.0.163",
|
|
37
37
|
"@teambit/compositions.ui.hooks.use-composition": "0.0.163",
|
|
38
38
|
"@teambit/design.ui.alert-card": "0.0.14",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"@teambit/docs.ui.queries.get-docs": "0.0.487",
|
|
44
44
|
"@teambit/mdx.ui.mdx-layout": "0.0.494",
|
|
45
45
|
"@teambit/panels": "0.0.450",
|
|
46
|
-
"@teambit/preview.ui.component-preview": "0.0.
|
|
46
|
+
"@teambit/preview.ui.component-preview": "0.0.491",
|
|
47
47
|
"@teambit/ui-foundation.ui.buttons.collapser": "0.0.193",
|
|
48
48
|
"@teambit/ui-foundation.ui.hooks.use-is-mobile": "0.0.179",
|
|
49
|
-
"@teambit/ui": "0.0.
|
|
49
|
+
"@teambit/ui": "0.0.662",
|
|
50
50
|
"@teambit/compositions.model.composition-type": "0.0.487",
|
|
51
51
|
"@teambit/compositions.ui.composition-card": "0.0.493"
|
|
52
52
|
},
|
|
@@ -1,60 +1,27 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { ComponentPreview } from '@teambit/preview.ui.component-preview';
|
|
2
|
+
import { ComponentPreview, ComponentPreviewProps } from '@teambit/preview.ui.component-preview';
|
|
4
3
|
|
|
5
4
|
import { Composition } from '../composition';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* HTML class
|
|
10
|
-
*/
|
|
11
|
-
className?: string;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* component to render.
|
|
15
|
-
*/
|
|
16
|
-
component: ComponentModel;
|
|
17
|
-
|
|
6
|
+
interface ComponentCompositionProps extends ComponentPreviewProps {
|
|
18
7
|
/**
|
|
19
8
|
* composition to use for component rendering.
|
|
20
9
|
*/
|
|
21
10
|
composition?: Composition;
|
|
11
|
+
}
|
|
22
12
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* skip hot reload
|
|
30
|
-
*/
|
|
31
|
-
hotReload?: boolean;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export function ComponentComposition({
|
|
35
|
-
component,
|
|
36
|
-
composition,
|
|
37
|
-
hotReload,
|
|
38
|
-
className,
|
|
39
|
-
queryParams = [],
|
|
40
|
-
}: ComponentCompositionProps) {
|
|
41
|
-
const compositionParams = useMemo(() => (composition ? [composition.identifier] : []).concat(queryParams), [
|
|
42
|
-
composition?.identifier,
|
|
43
|
-
queryParams,
|
|
44
|
-
]);
|
|
13
|
+
export function ComponentComposition({ composition, queryParams = [], ...rest }: ComponentCompositionProps) {
|
|
14
|
+
const compositionParams = useMemo(
|
|
15
|
+
() => (composition ? [composition.identifier] : []).concat(queryParams),
|
|
16
|
+
[composition?.identifier, queryParams]
|
|
17
|
+
);
|
|
45
18
|
|
|
46
19
|
return (
|
|
47
20
|
<ComponentPreview
|
|
48
|
-
|
|
49
|
-
component={component}
|
|
21
|
+
{...rest}
|
|
50
22
|
style={{ width: '100%', height: '100%' }}
|
|
51
23
|
previewName="compositions"
|
|
52
24
|
queryParams={compositionParams}
|
|
53
|
-
hotReload={hotReload}
|
|
54
25
|
/>
|
|
55
26
|
);
|
|
56
27
|
}
|
|
57
|
-
|
|
58
|
-
ComponentComposition.defaultProps = {
|
|
59
|
-
skipHotReload: true,
|
|
60
|
-
};
|
|
Binary file
|