@teambit/compositions 1.0.592 → 1.0.596
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compositions_compositions@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compositions_compositions@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compositions_compositions@1.0.596/dist/compositions.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compositions_compositions@1.0.596/dist/compositions.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -18,6 +18,13 @@ function _previewUi() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
+
function _workspaceUi() {
|
|
22
|
+
const data = require("@teambit/workspace.ui.use-workspace-mode");
|
|
23
|
+
_workspaceUi = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
21
28
|
const _excluded = ["composition", "component", "queryParams"];
|
|
22
29
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
23
30
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -31,6 +38,9 @@ function ComponentComposition(_ref) {
|
|
|
31
38
|
queryParams = []
|
|
32
39
|
} = _ref,
|
|
33
40
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
+
const {
|
|
42
|
+
isMinimal
|
|
43
|
+
} = (0, _workspaceUi().useWorkspaceMode)();
|
|
34
44
|
const includesEnvTemplate = component.preview?.includesEnvTemplate;
|
|
35
45
|
const isScaling = component.preview?.isScaling;
|
|
36
46
|
const shouldAddNameParam = component.preview?.useNameParam || isScaling && includesEnvTemplate === false;
|
|
@@ -42,7 +52,8 @@ function ComponentComposition(_ref) {
|
|
|
42
52
|
height: '100%'
|
|
43
53
|
},
|
|
44
54
|
previewName: "compositions",
|
|
45
|
-
queryParams: compositionParams
|
|
55
|
+
queryParams: compositionParams,
|
|
56
|
+
propagateError: isMinimal
|
|
46
57
|
}));
|
|
47
58
|
}
|
|
48
59
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_previewUi","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","ComponentComposition","_ref","composition","component","queryParams","rest","includesEnvTemplate","preview","isScaling","shouldAddNameParam","useNameParam","compositionParams","useMemo","identifier","concat","createElement","ComponentPreview","style","width","height","previewName"],"sources":["composition-preview.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { ComponentPreview, ComponentPreviewProps } from '@teambit/preview.ui.component-preview';\n\nimport { Composition } from '../composition';\n\nexport type ComponentCompositionProps = {\n /**\n * composition to use for component rendering.\n */\n composition?: Composition;\n} & ComponentPreviewProps;\n\nexport function ComponentComposition({ composition, component, queryParams = [], ...rest }: ComponentCompositionProps) {\n const includesEnvTemplate = component.preview?.includesEnvTemplate;\n const isScaling = component.preview?.isScaling;\n const shouldAddNameParam = component.preview?.useNameParam || (isScaling && includesEnvTemplate === false);\n\n const compositionParams = useMemo(\n () =>\n (composition ? [shouldAddNameParam ? `name=${composition.identifier}` : composition.identifier] : []).concat(\n queryParams\n ),\n [composition?.identifier, queryParams]\n );\n\n return (\n <ComponentPreview\n {...rest}\n component={component}\n style={{ width: '100%', height: '100%' }}\n previewName=\"compositions\"\n queryParams={compositionParams}\n />\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_previewUi","_workspaceUi","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","ComponentComposition","_ref","composition","component","queryParams","rest","isMinimal","useWorkspaceMode","includesEnvTemplate","preview","isScaling","shouldAddNameParam","useNameParam","compositionParams","useMemo","identifier","concat","createElement","ComponentPreview","style","width","height","previewName","propagateError"],"sources":["composition-preview.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { ComponentPreview, ComponentPreviewProps } from '@teambit/preview.ui.component-preview';\nimport { useWorkspaceMode } from '@teambit/workspace.ui.use-workspace-mode';\n\nimport { Composition } from '../composition';\n\nexport type ComponentCompositionProps = {\n /**\n * composition to use for component rendering.\n */\n composition?: Composition;\n} & ComponentPreviewProps;\n\nexport function ComponentComposition({ composition, component, queryParams = [], ...rest }: ComponentCompositionProps) {\n const { isMinimal } = useWorkspaceMode();\n const includesEnvTemplate = component.preview?.includesEnvTemplate;\n const isScaling = component.preview?.isScaling;\n const shouldAddNameParam = component.preview?.useNameParam || (isScaling && includesEnvTemplate === false);\n\n const compositionParams = useMemo(\n () =>\n (composition ? [shouldAddNameParam ? `name=${composition.identifier}` : composition.identifier] : []).concat(\n queryParams\n ),\n [composition?.identifier, queryParams]\n );\n\n return (\n <ComponentPreview\n {...rest}\n component={component}\n style={{ width: '100%', height: '100%' }}\n previewName=\"compositions\"\n queryParams={compositionParams}\n propagateError={isMinimal}\n />\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4E,MAAAK,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,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MACE,CAACZ,WAAW,GAAG,CAACS,kBAAkB,GAAG,QAAQT,WAAW,CAACa,UAAU,EAAE,GAAGb,WAAW,CAACa,UAAU,CAAC,GAAG,EAAE,EAAEC,MAAM,CAC1GZ,WACF,CAAC,EACH,CAACF,WAAW,EAAEa,UAAU,EAAEX,WAAW,CACvC,CAAC;EAED,oBACE3C,MAAA,GAAAa,OAAA,CAAA2C,aAAA,CAACpD,UAAA,GAAAqD,gBAAgB,EAAA9B,QAAA,KACXiB,IAAI;IACRF,SAAS,EAAEA,SAAU;IACrBgB,KAAK,EAAE;MAAEC,KAAK,EAAE,MAAM;MAAEC,MAAM,EAAE;IAAO,CAAE;IACzCC,WAAW,EAAC,cAAc;IAC1BlB,WAAW,EAAES,iBAAkB;IAC/BU,cAAc,EAAEjB;EAAU,EAC3B,CAAC;AAEN","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/compositions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.596",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/compositions/compositions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.compositions",
|
|
8
8
|
"name": "compositions",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.596"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"graphql-tag": "2.12.1",
|
|
@@ -34,33 +34,34 @@
|
|
|
34
34
|
"@teambit/compositions.ui.composition-compare": "0.0.258",
|
|
35
35
|
"@teambit/evangelist.elements.icon": "1.0.2",
|
|
36
36
|
"@teambit/ui-foundation.ui.menu-widget-icon": "0.0.502",
|
|
37
|
-
"@teambit/component": "1.0.
|
|
37
|
+
"@teambit/component": "1.0.596",
|
|
38
38
|
"@teambit/compositions.model.composition-id": "0.0.505",
|
|
39
|
-
"@teambit/graphql": "1.0.
|
|
40
|
-
"@teambit/cli": "0.0.
|
|
41
|
-
"@teambit/component.sources": "0.0.
|
|
42
|
-
"@teambit/dev-files": "1.0.
|
|
43
|
-
"@teambit/envs": "1.0.
|
|
44
|
-
"@teambit/legacy.consumer-component": "0.0.
|
|
45
|
-
"@teambit/preview": "1.0.
|
|
46
|
-
"@teambit/schema": "1.0.
|
|
47
|
-
"@teambit/scope": "1.0.
|
|
39
|
+
"@teambit/graphql": "1.0.596",
|
|
40
|
+
"@teambit/cli": "0.0.1173",
|
|
41
|
+
"@teambit/component.sources": "0.0.101",
|
|
42
|
+
"@teambit/dev-files": "1.0.596",
|
|
43
|
+
"@teambit/envs": "1.0.596",
|
|
44
|
+
"@teambit/legacy.consumer-component": "0.0.50",
|
|
45
|
+
"@teambit/preview": "1.0.596",
|
|
46
|
+
"@teambit/schema": "1.0.596",
|
|
47
|
+
"@teambit/scope": "1.0.596",
|
|
48
48
|
"@teambit/toolbox.path.match-patterns": "0.0.19",
|
|
49
|
-
"@teambit/workspace": "1.0.
|
|
49
|
+
"@teambit/workspace": "1.0.596",
|
|
50
50
|
"@teambit/design.ui.tooltip": "0.0.375",
|
|
51
51
|
"@teambit/docs.ui.queries.get-docs": "0.0.509",
|
|
52
|
-
"@teambit/panels": "0.0.
|
|
53
|
-
"@teambit/preview.ui.component-preview": "1.0.
|
|
52
|
+
"@teambit/panels": "0.0.1175",
|
|
53
|
+
"@teambit/preview.ui.component-preview": "1.0.23",
|
|
54
54
|
"@teambit/ui-foundation.ui.buttons.collapser": "0.0.227",
|
|
55
|
-
"@teambit/component-compare": "1.0.
|
|
56
|
-
"@teambit/ui": "1.0.
|
|
55
|
+
"@teambit/component-compare": "1.0.596",
|
|
56
|
+
"@teambit/ui": "1.0.596",
|
|
57
|
+
"@teambit/workspace.ui.use-workspace-mode": "0.0.2"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"@types/lodash": "4.14.165",
|
|
60
61
|
"@types/lodash.head": "4.0.6",
|
|
61
62
|
"@types/classnames": "2.2.11",
|
|
62
63
|
"@types/mocha": "9.1.0",
|
|
63
|
-
"@teambit/component-id": "1.2.
|
|
64
|
+
"@teambit/component-id": "1.2.4",
|
|
64
65
|
"@teambit/harmony.envs.core-aspect-env": "0.0.69",
|
|
65
66
|
"@teambit/compositions.aspect-docs.compositions": "0.0.171"
|
|
66
67
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { ComponentPreview, ComponentPreviewProps } from '@teambit/preview.ui.component-preview';
|
|
3
|
+
import { useWorkspaceMode } from '@teambit/workspace.ui.use-workspace-mode';
|
|
3
4
|
|
|
4
5
|
import { Composition } from '../composition';
|
|
5
6
|
|
|
@@ -11,6 +12,7 @@ export type ComponentCompositionProps = {
|
|
|
11
12
|
} & ComponentPreviewProps;
|
|
12
13
|
|
|
13
14
|
export function ComponentComposition({ composition, component, queryParams = [], ...rest }: ComponentCompositionProps) {
|
|
15
|
+
const { isMinimal } = useWorkspaceMode();
|
|
14
16
|
const includesEnvTemplate = component.preview?.includesEnvTemplate;
|
|
15
17
|
const isScaling = component.preview?.isScaling;
|
|
16
18
|
const shouldAddNameParam = component.preview?.useNameParam || (isScaling && includesEnvTemplate === false);
|
|
@@ -30,6 +32,7 @@ export function ComponentComposition({ composition, component, queryParams = [],
|
|
|
30
32
|
style={{ width: '100%', height: '100%' }}
|
|
31
33
|
previewName="compositions"
|
|
32
34
|
queryParams={compositionParams}
|
|
35
|
+
propagateError={isMinimal}
|
|
33
36
|
/>
|
|
34
37
|
);
|
|
35
38
|
}
|