@teambit/compositions 1.0.1080 → 1.0.1081
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.
|
@@ -7,6 +7,7 @@ import { ComponentAspect } from '@teambit/component';
|
|
|
7
7
|
import { UIRuntime } from '@teambit/ui';
|
|
8
8
|
import { CompositionCompareSection } from '@teambit/compositions.ui.composition-compare-section';
|
|
9
9
|
import { CompositionCompare } from '@teambit/compositions.ui.composition-compare';
|
|
10
|
+
import { InlinePreviewCompare } from '@teambit/preview.ui.inline-preview-compare';
|
|
10
11
|
import type { ComponentCompareUI } from '@teambit/component-compare';
|
|
11
12
|
import { ComponentCompareAspect } from '@teambit/component-compare';
|
|
12
13
|
import type { UsePreviewProps, UseSandboxPermission } from '@teambit/preview.ui.component-preview';
|
|
@@ -103,6 +104,19 @@ export class CompositionsUI {
|
|
|
103
104
|
component.registerNavigation(section.navigationLink, section.order);
|
|
104
105
|
componentCompare.registerNavigation(compositionCompare);
|
|
105
106
|
componentCompare.registerRoutes([compositionCompare.route]);
|
|
107
|
+
// Inline preview tab for the redesigned ComponentComparePage / lane-compare. Owned by the
|
|
108
|
+
// compositions aspect (owner of the preview/composition compare integration) instead of being
|
|
109
|
+
// hardcoded in component-compare, so component-compare stays decoupled from preview UI.
|
|
110
|
+
// lazy: the preview panel mounts base+compare composition iframes, each pulling the full env
|
|
111
|
+
// preview bundle on mount (even under `display: none`) — in a large lane compare that's hundreds
|
|
112
|
+
// of MB of hidden-iframe traffic starving the visible view.
|
|
113
|
+
componentCompare.registerCompareTab({
|
|
114
|
+
id: 'inline-preview',
|
|
115
|
+
order: 2,
|
|
116
|
+
displayName: 'Preview',
|
|
117
|
+
element: <InlinePreviewCompare />,
|
|
118
|
+
lazy: true,
|
|
119
|
+
});
|
|
106
120
|
compositions.registerPreviewSandbox((manager, componentModel) => {
|
|
107
121
|
if (componentModel?.host === 'teambit.scope/scope') {
|
|
108
122
|
manager.add('allow-scripts');
|
|
@@ -46,6 +46,13 @@ function _compositionsUi2() {
|
|
|
46
46
|
};
|
|
47
47
|
return data;
|
|
48
48
|
}
|
|
49
|
+
function _previewUi() {
|
|
50
|
+
const data = require("@teambit/preview.ui.inline-preview-compare");
|
|
51
|
+
_previewUi = function () {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
return data;
|
|
55
|
+
}
|
|
49
56
|
function _componentCompare() {
|
|
50
57
|
const data = require("@teambit/component-compare");
|
|
51
58
|
_componentCompare = function () {
|
|
@@ -132,6 +139,19 @@ class CompositionsUI {
|
|
|
132
139
|
component.registerNavigation(section.navigationLink, section.order);
|
|
133
140
|
componentCompare.registerNavigation(compositionCompare);
|
|
134
141
|
componentCompare.registerRoutes([compositionCompare.route]);
|
|
142
|
+
// Inline preview tab for the redesigned ComponentComparePage / lane-compare. Owned by the
|
|
143
|
+
// compositions aspect (owner of the preview/composition compare integration) instead of being
|
|
144
|
+
// hardcoded in component-compare, so component-compare stays decoupled from preview UI.
|
|
145
|
+
// lazy: the preview panel mounts base+compare composition iframes, each pulling the full env
|
|
146
|
+
// preview bundle on mount (even under `display: none`) — in a large lane compare that's hundreds
|
|
147
|
+
// of MB of hidden-iframe traffic starving the visible view.
|
|
148
|
+
componentCompare.registerCompareTab({
|
|
149
|
+
id: 'inline-preview',
|
|
150
|
+
order: 2,
|
|
151
|
+
displayName: 'Preview',
|
|
152
|
+
element: /*#__PURE__*/_react().default.createElement(_previewUi().InlinePreviewCompare, null),
|
|
153
|
+
lazy: true
|
|
154
|
+
});
|
|
135
155
|
compositions.registerPreviewSandbox((manager, componentModel) => {
|
|
136
156
|
if (componentModel?.host === 'teambit.scope/scope') {
|
|
137
157
|
manager.add('allow-scripts');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","_harmony","_component","_ui","_compositionsUi","_compositionsUi2","_componentCompare","_composition","_compositions","_compositions2","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","_defineProperty","_toPropertyKey","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","CompositionsUI","constructor","menuBarWidgetSlot","emptyStateSlot","usePreviewSandboxSlot","usePreviewPropsSlot","createElement","CompositionCompare","emptyState","PreviewView","compositionProps","CompositionContent","fullContentHeight","forceHeight","registerEmptyState","emptyStateComponent","register","registerMenuWidget","widget","registerPreviewSandbox","useSandboxPermission","registerPreviewProps","usePreviewProps","provider","component","componentCompare","config","compositionMenuSlot","compositions","section","CompositionsSection","compositionCompare","CompositionCompareSection","registerRoute","route","registerNavigation","navigationLink","order","registerRoutes","manager","componentModel","host","add","set","exports","ComponentAspect","ComponentCompareAspect","UIRuntime","Slot","withType","_default","CompositionsAspect","addRuntime"],"sources":["compositions.ui.runtime.tsx"],"sourcesContent":["import type { ReactNode, ComponentType } from 'react';\nimport React from 'react';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport type { ComponentUI } from '@teambit/component';\nimport { ComponentAspect } from '@teambit/component';\nimport { UIRuntime } from '@teambit/ui';\nimport { CompositionCompareSection } from '@teambit/compositions.ui.composition-compare-section';\nimport { CompositionCompare } from '@teambit/compositions.ui.composition-compare';\nimport type { ComponentCompareUI } from '@teambit/component-compare';\nimport { ComponentCompareAspect } from '@teambit/component-compare';\nimport type { UsePreviewProps, UseSandboxPermission } from '@teambit/preview.ui.component-preview';\nimport { CompositionsSection } from './composition.section';\nimport { CompositionsAspect } from './compositions.aspect';\nimport type { MenuBarWidget } from './compositions';\nimport { CompositionContent } from './compositions';\n\nexport type CompositionsMenuSlot = SlotRegistry<MenuBarWidget[]>;\nexport type EmptyStateSlot = SlotRegistry<ComponentType>;\nexport type UsePreviewSandboxSlot = SlotRegistry<UseSandboxPermission>;\nexport type UsePreviewPropsSlot = SlotRegistry<UsePreviewProps>;\n\nexport class CompositionsUI {\n constructor(\n private menuBarWidgetSlot: CompositionsMenuSlot,\n private emptyStateSlot: EmptyStateSlot,\n private usePreviewSandboxSlot: UsePreviewSandboxSlot,\n private usePreviewPropsSlot: UsePreviewPropsSlot\n ) {}\n /**\n * register a new tester empty state. this allows to register a different empty state from each environment for example.\n */\n registerEmptyState(emptyStateComponent: ComponentType) {\n this.emptyStateSlot.register(emptyStateComponent);\n return this;\n }\n\n registerMenuWidget(...widget: MenuBarWidget[]) {\n this.menuBarWidgetSlot.register(widget);\n }\n\n registerPreviewSandbox(useSandboxPermission: UseSandboxPermission) {\n this.usePreviewSandboxSlot.register(useSandboxPermission);\n }\n\n /**\n * register a per-component resolver for iframe attributes on the composition preview\n * (`allow`, `referrerPolicy`, ...). The resolver runs at render time with the current\n * `ComponentModel`; results from multiple resolvers merge with later keys winning. Use\n * this to grant a specific subset of components extra Permissions Policy capabilities\n * (e.g. `fullscreen` for chart/video components) without loosening the default for all\n * components.\n */\n registerPreviewProps(usePreviewProps: UsePreviewProps) {\n this.usePreviewPropsSlot.register(usePreviewProps);\n }\n\n getCompositionsCompare = () => {\n return (\n <CompositionCompare\n emptyState={this.emptyStateSlot}\n PreviewView={(compositionProps) => {\n return <CompositionContent {...compositionProps} fullContentHeight forceHeight={'100%'} />;\n }}\n />\n );\n };\n\n static dependencies = [ComponentAspect, ComponentCompareAspect];\n static runtime = UIRuntime;\n static slots = [\n Slot.withType<ReactNode>(),\n Slot.withType<ComponentType>(),\n Slot.withType<UseSandboxPermission>(),\n Slot.withType<UsePreviewProps>(),\n ];\n\n static async provider(\n [component, componentCompare]: [ComponentUI, ComponentCompareUI],\n config: {},\n [compositionMenuSlot, emptyStateSlot, usePreviewSandboxSlot, usePreviewPropsSlot]: [\n CompositionsMenuSlot,\n EmptyStateSlot,\n UsePreviewSandboxSlot,\n UsePreviewPropsSlot,\n ]\n ) {\n const compositions = new CompositionsUI(\n compositionMenuSlot,\n emptyStateSlot,\n usePreviewSandboxSlot,\n usePreviewPropsSlot\n );\n const section = new CompositionsSection(\n compositions,\n { menuBarWidgetSlot: compositions.menuBarWidgetSlot },\n emptyStateSlot,\n usePreviewSandboxSlot,\n usePreviewPropsSlot\n );\n const compositionCompare = new CompositionCompareSection(compositions);\n component.registerRoute(section.route);\n component.registerNavigation(section.navigationLink, section.order);\n componentCompare.registerNavigation(compositionCompare);\n componentCompare.registerRoutes([compositionCompare.route]);\n compositions.registerPreviewSandbox((manager, componentModel) => {\n if (componentModel?.host === 'teambit.scope/scope') {\n manager.add('allow-scripts');\n manager.add('allow-same-origin');\n }\n });\n // Default Permissions Policy: allow clipboard writes so copy-to-clipboard buttons in\n // compositions work. Clipboard-read, camera, mic, geolocation, etc. remain denied. Other\n // aspects may layer on (e.g. `fullscreen` for chart/video components).\n compositions.registerPreviewProps((manager) => {\n manager.set('allow', 'clipboard-write');\n });\n return compositions;\n }\n}\n\nexport default CompositionsUI;\n\nCompositionsAspect.addRuntime(CompositionsUI);\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,IAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,GAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,gBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,eAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,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AACa,cAAc,CAAC,CAACP,kBAAkB,CAACG,KAAK,CAAC,CAAC;IAC3DN,YAAY,CAACT,sBAAsB,CAAC,CAACoB,OAAO,EAAEC,cAAc,KAAK;MAC/D,IAAIA,cAAc,EAAEC,IAAI,KAAK,qBAAqB,EAAE;QAClDF,OAAO,CAACG,GAAG,CAAC,eAAe,CAAC;QAC5BH,OAAO,CAACG,GAAG,CAAC,mBAAmB,CAAC;MAClC;IACF,CAAC,CAAC;IACF;IACA;IACA;IACAd,YAAY,CAACP,oBAAoB,CAAEkB,OAAO,IAAK;MAC7CA,OAAO,CAACI,GAAG,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACzC,CAAC,CAAC;IACF,OAAOf,YAAY;EACrB;AACF;AAACgB,OAAA,CAAA5C,cAAA,GAAAA,cAAA;AAAAd,eAAA,CAjGYc,cAAc,kBA8CH,CAAC6C,4BAAe,EAAEC,0CAAsB,CAAC;AAAA5D,eAAA,CA9CpDc,cAAc,aA+CR+C,eAAS;AAAA7D,eAAA,CA/Cfc,cAAc,WAgDV,CACbgD,eAAI,CAACC,QAAQ,CAAY,CAAC,EAC1BD,eAAI,CAACC,QAAQ,CAAgB,CAAC,EAC9BD,eAAI,CAACC,QAAQ,CAAuB,CAAC,EACrCD,eAAI,CAACC,QAAQ,CAAkB,CAAC,CACjC;AAAA,IAAAC,QAAA,GAAAN,OAAA,CAAAvE,OAAA,GA8CY2B,cAAc;AAE7BmD,kCAAkB,CAACC,UAAU,CAACpD,cAAc,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_harmony","_component","_ui","_compositionsUi","_compositionsUi2","_previewUi","_componentCompare","_composition","_compositions","_compositions2","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","_defineProperty","_toPropertyKey","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","CompositionsUI","constructor","menuBarWidgetSlot","emptyStateSlot","usePreviewSandboxSlot","usePreviewPropsSlot","createElement","CompositionCompare","emptyState","PreviewView","compositionProps","CompositionContent","fullContentHeight","forceHeight","registerEmptyState","emptyStateComponent","register","registerMenuWidget","widget","registerPreviewSandbox","useSandboxPermission","registerPreviewProps","usePreviewProps","provider","component","componentCompare","config","compositionMenuSlot","compositions","section","CompositionsSection","compositionCompare","CompositionCompareSection","registerRoute","route","registerNavigation","navigationLink","order","registerRoutes","registerCompareTab","id","displayName","element","InlinePreviewCompare","lazy","manager","componentModel","host","add","set","exports","ComponentAspect","ComponentCompareAspect","UIRuntime","Slot","withType","_default","CompositionsAspect","addRuntime"],"sources":["compositions.ui.runtime.tsx"],"sourcesContent":["import type { ReactNode, ComponentType } from 'react';\nimport React from 'react';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport type { ComponentUI } from '@teambit/component';\nimport { ComponentAspect } from '@teambit/component';\nimport { UIRuntime } from '@teambit/ui';\nimport { CompositionCompareSection } from '@teambit/compositions.ui.composition-compare-section';\nimport { CompositionCompare } from '@teambit/compositions.ui.composition-compare';\nimport { InlinePreviewCompare } from '@teambit/preview.ui.inline-preview-compare';\nimport type { ComponentCompareUI } from '@teambit/component-compare';\nimport { ComponentCompareAspect } from '@teambit/component-compare';\nimport type { UsePreviewProps, UseSandboxPermission } from '@teambit/preview.ui.component-preview';\nimport { CompositionsSection } from './composition.section';\nimport { CompositionsAspect } from './compositions.aspect';\nimport type { MenuBarWidget } from './compositions';\nimport { CompositionContent } from './compositions';\n\nexport type CompositionsMenuSlot = SlotRegistry<MenuBarWidget[]>;\nexport type EmptyStateSlot = SlotRegistry<ComponentType>;\nexport type UsePreviewSandboxSlot = SlotRegistry<UseSandboxPermission>;\nexport type UsePreviewPropsSlot = SlotRegistry<UsePreviewProps>;\n\nexport class CompositionsUI {\n constructor(\n private menuBarWidgetSlot: CompositionsMenuSlot,\n private emptyStateSlot: EmptyStateSlot,\n private usePreviewSandboxSlot: UsePreviewSandboxSlot,\n private usePreviewPropsSlot: UsePreviewPropsSlot\n ) {}\n /**\n * register a new tester empty state. this allows to register a different empty state from each environment for example.\n */\n registerEmptyState(emptyStateComponent: ComponentType) {\n this.emptyStateSlot.register(emptyStateComponent);\n return this;\n }\n\n registerMenuWidget(...widget: MenuBarWidget[]) {\n this.menuBarWidgetSlot.register(widget);\n }\n\n registerPreviewSandbox(useSandboxPermission: UseSandboxPermission) {\n this.usePreviewSandboxSlot.register(useSandboxPermission);\n }\n\n /**\n * register a per-component resolver for iframe attributes on the composition preview\n * (`allow`, `referrerPolicy`, ...). The resolver runs at render time with the current\n * `ComponentModel`; results from multiple resolvers merge with later keys winning. Use\n * this to grant a specific subset of components extra Permissions Policy capabilities\n * (e.g. `fullscreen` for chart/video components) without loosening the default for all\n * components.\n */\n registerPreviewProps(usePreviewProps: UsePreviewProps) {\n this.usePreviewPropsSlot.register(usePreviewProps);\n }\n\n getCompositionsCompare = () => {\n return (\n <CompositionCompare\n emptyState={this.emptyStateSlot}\n PreviewView={(compositionProps) => {\n return <CompositionContent {...compositionProps} fullContentHeight forceHeight={'100%'} />;\n }}\n />\n );\n };\n\n static dependencies = [ComponentAspect, ComponentCompareAspect];\n static runtime = UIRuntime;\n static slots = [\n Slot.withType<ReactNode>(),\n Slot.withType<ComponentType>(),\n Slot.withType<UseSandboxPermission>(),\n Slot.withType<UsePreviewProps>(),\n ];\n\n static async provider(\n [component, componentCompare]: [ComponentUI, ComponentCompareUI],\n config: {},\n [compositionMenuSlot, emptyStateSlot, usePreviewSandboxSlot, usePreviewPropsSlot]: [\n CompositionsMenuSlot,\n EmptyStateSlot,\n UsePreviewSandboxSlot,\n UsePreviewPropsSlot,\n ]\n ) {\n const compositions = new CompositionsUI(\n compositionMenuSlot,\n emptyStateSlot,\n usePreviewSandboxSlot,\n usePreviewPropsSlot\n );\n const section = new CompositionsSection(\n compositions,\n { menuBarWidgetSlot: compositions.menuBarWidgetSlot },\n emptyStateSlot,\n usePreviewSandboxSlot,\n usePreviewPropsSlot\n );\n const compositionCompare = new CompositionCompareSection(compositions);\n component.registerRoute(section.route);\n component.registerNavigation(section.navigationLink, section.order);\n componentCompare.registerNavigation(compositionCompare);\n componentCompare.registerRoutes([compositionCompare.route]);\n // Inline preview tab for the redesigned ComponentComparePage / lane-compare. Owned by the\n // compositions aspect (owner of the preview/composition compare integration) instead of being\n // hardcoded in component-compare, so component-compare stays decoupled from preview UI.\n // lazy: the preview panel mounts base+compare composition iframes, each pulling the full env\n // preview bundle on mount (even under `display: none`) — in a large lane compare that's hundreds\n // of MB of hidden-iframe traffic starving the visible view.\n componentCompare.registerCompareTab({\n id: 'inline-preview',\n order: 2,\n displayName: 'Preview',\n element: <InlinePreviewCompare />,\n lazy: true,\n });\n compositions.registerPreviewSandbox((manager, componentModel) => {\n if (componentModel?.host === 'teambit.scope/scope') {\n manager.add('allow-scripts');\n manager.add('allow-same-origin');\n }\n });\n // Default Permissions Policy: allow clipboard writes so copy-to-clipboard buttons in\n // compositions work. Clipboard-read, camera, mic, geolocation, etc. remain denied. Other\n // aspects may layer on (e.g. `fullscreen` for chart/video components).\n compositions.registerPreviewProps((manager) => {\n manager.set('allow', 'clipboard-write');\n });\n return compositions;\n }\n}\n\nexport default CompositionsUI;\n\nCompositionsAspect.addRuntime(CompositionsUI);\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA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AsB,CAAC;AAAAlE,eAAA,CA9CpDc,cAAc,aA+CRqD,eAAS;AAAAnE,eAAA,CA/Cfc,cAAc,WAgDV,CACbsD,eAAI,CAACC,QAAQ,CAAY,CAAC,EAC1BD,eAAI,CAACC,QAAQ,CAAgB,CAAC,EAC9BD,eAAI,CAACC,QAAQ,CAAuB,CAAC,EACrCD,eAAI,CAACC,QAAQ,CAAkB,CAAC,CACjC;AAAA,IAAAC,QAAA,GAAAN,OAAA,CAAA7E,OAAA,GA2DY2B,cAAc;AAE7ByD,kCAAkB,CAACC,UAAU,CAAC1D,cAAc,CAAC","ignoreList":[]}
|
|
@@ -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.1081/dist/compositions.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compositions_compositions@1.0.1081/dist/compositions.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/compositions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1081",
|
|
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.1081"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"graphql-tag": "2.12.1",
|
|
@@ -16,9 +16,6 @@
|
|
|
16
16
|
"query-string": "7.0.0",
|
|
17
17
|
"@teambit/compositions.model.composition-id": "0.0.507",
|
|
18
18
|
"@teambit/harmony": "0.4.12",
|
|
19
|
-
"@teambit/cli": "0.0.1357",
|
|
20
|
-
"@teambit/component.sources": "0.0.192",
|
|
21
|
-
"@teambit/legacy.consumer-component": "0.0.141",
|
|
22
19
|
"@teambit/toolbox.path.match-patterns": "0.0.32",
|
|
23
20
|
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.504",
|
|
24
21
|
"@teambit/base-ui.surfaces.split-pane.hover-splitter": "1.0.1",
|
|
@@ -26,45 +23,49 @@
|
|
|
26
23
|
"@teambit/compositions.ui.composition-live-controls": "0.0.6",
|
|
27
24
|
"@teambit/compositions.ui.compositions-menu-bar": "0.0.177",
|
|
28
25
|
"@teambit/compositions.ui.hooks.use-composition": "0.0.177",
|
|
26
|
+
"@teambit/design.ui.alert-card": "0.0.27",
|
|
27
|
+
"@teambit/design.ui.empty-box": "0.0.364",
|
|
29
28
|
"@teambit/design.ui.input.option-button": "1.0.13",
|
|
30
29
|
"@teambit/design.ui.separator": "0.0.367",
|
|
31
|
-
"@teambit/design.ui.
|
|
30
|
+
"@teambit/design.ui.surfaces.status-message-card": "0.0.18",
|
|
32
31
|
"@teambit/docs.ui.queries.get-docs": "0.0.511",
|
|
33
32
|
"@teambit/documenter.theme.theme-context": "4.0.7",
|
|
34
33
|
"@teambit/documenter.ui.heading": "4.1.8",
|
|
35
34
|
"@teambit/evangelist.elements.icon": "1.0.5",
|
|
36
|
-
"@teambit/panels": "0.0.1360",
|
|
37
35
|
"@teambit/preview.ui.component-preview": "1.0.36",
|
|
38
|
-
"@teambit/ui-foundation.ui.buttons.collapser": "0.0.234",
|
|
39
36
|
"@teambit/ui-foundation.ui.hooks.use-is-mobile": "0.0.200",
|
|
40
|
-
"@teambit/design.ui.alert-card": "0.0.27",
|
|
41
|
-
"@teambit/design.ui.empty-box": "0.0.364",
|
|
42
|
-
"@teambit/design.ui.surfaces.status-message-card": "0.0.18",
|
|
43
37
|
"@teambit/documenter.ui.property-table": "4.1.11",
|
|
44
38
|
"@teambit/mdx.ui.mdx-layout": "1.0.14",
|
|
45
|
-
"@teambit/compositions.ui.composition-compare-section": "0.0.107",
|
|
46
|
-
"@teambit/compositions.ui.composition-compare": "0.0.265",
|
|
47
39
|
"@teambit/api-reference.hooks.use-api": "0.0.57",
|
|
48
40
|
"@teambit/workspace.ui.use-workspace-mode": "0.0.3",
|
|
49
41
|
"@teambit/ui-foundation.ui.menu-widget-icon": "0.0.502",
|
|
50
|
-
"@teambit/design.inputs.selectors.menu-item": "1.1.0",
|
|
51
42
|
"@teambit/design.inputs.date-picker": "0.0.3",
|
|
52
43
|
"@teambit/design.inputs.dropdown": "1.3.3",
|
|
53
44
|
"@teambit/design.inputs.input-text": "1.1.5",
|
|
45
|
+
"@teambit/design.inputs.selectors.menu-item": "1.1.0",
|
|
54
46
|
"@teambit/design.inputs.text-area": "0.0.20",
|
|
55
47
|
"@teambit/design.inputs.toggle-switch": "0.0.9",
|
|
56
48
|
"@teambit/design.ui.input.color-picker": "0.0.56",
|
|
57
49
|
"@teambit/base-ui.loaders.skeleton": "1.0.2",
|
|
58
|
-
"@teambit/component": "1.0.
|
|
59
|
-
"@teambit/graphql": "1.0.
|
|
60
|
-
"@teambit/
|
|
61
|
-
"@teambit/
|
|
62
|
-
"@teambit/
|
|
63
|
-
"@teambit/
|
|
64
|
-
"@teambit/
|
|
65
|
-
"@teambit/
|
|
66
|
-
"@teambit/
|
|
67
|
-
"@teambit/
|
|
50
|
+
"@teambit/component": "1.0.1081",
|
|
51
|
+
"@teambit/graphql": "1.0.1081",
|
|
52
|
+
"@teambit/cli": "0.0.1358",
|
|
53
|
+
"@teambit/component.sources": "0.0.193",
|
|
54
|
+
"@teambit/dev-files": "1.0.1081",
|
|
55
|
+
"@teambit/envs": "1.0.1081",
|
|
56
|
+
"@teambit/legacy.consumer-component": "0.0.142",
|
|
57
|
+
"@teambit/preview": "1.0.1081",
|
|
58
|
+
"@teambit/schema": "1.0.1081",
|
|
59
|
+
"@teambit/scope": "1.0.1081",
|
|
60
|
+
"@teambit/workspace": "1.0.1081",
|
|
61
|
+
"@teambit/design.ui.tooltip": "0.0.384",
|
|
62
|
+
"@teambit/panels": "0.0.1361",
|
|
63
|
+
"@teambit/ui-foundation.ui.buttons.collapser": "0.0.235",
|
|
64
|
+
"@teambit/component-compare": "1.0.1081",
|
|
65
|
+
"@teambit/compositions.ui.composition-compare-section": "0.0.108",
|
|
66
|
+
"@teambit/compositions.ui.composition-compare": "0.0.266",
|
|
67
|
+
"@teambit/preview.ui.inline-preview-compare": "0.0.1",
|
|
68
|
+
"@teambit/ui": "1.0.1081"
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
70
71
|
"@types/lodash": "4.14.165",
|
|
@@ -73,7 +74,7 @@
|
|
|
73
74
|
"@types/mocha": "9.1.0",
|
|
74
75
|
"@teambit/compositions.aspect-docs.compositions": "0.0.180",
|
|
75
76
|
"@teambit/component-id": "1.2.4",
|
|
76
|
-
"@teambit/harmony.envs.core-aspect-env": "2.0.
|
|
77
|
+
"@teambit/harmony.envs.core-aspect-env": "2.0.3"
|
|
77
78
|
},
|
|
78
79
|
"peerDependencies": {
|
|
79
80
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|