@teambit/docs 1.0.371 → 1.0.373
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/static/css/teambit.docs/{docs-preview.5e709723.css → docs-preview.fc066228.css} +6 -6
- package/artifacts/preview/teambit_docs_docs-preview.js +6 -6
- package/artifacts/schema.json +54 -54
- package/dist/docs.preview.runtime.d.ts +2 -2
- package/dist/docs.preview.runtime.js +2 -1
- package/dist/docs.preview.runtime.js.map +1 -1
- package/dist/{preview-1722880610382.js → preview-1723000713766.js} +2 -2
- package/docs.preview.runtime.tsx +3 -2
- package/package.json +17 -17
package/artifacts/schema.json
CHANGED
@@ -1747,7 +1747,7 @@
|
|
1747
1747
|
"line": 24,
|
1748
1748
|
"character": 3
|
1749
1749
|
},
|
1750
|
-
"signature": "(property) DocsPreview.render: (componentId: ComponentID, envId: string, modules: PreviewModule, [
|
1750
|
+
"signature": "(property) DocsPreview.render: (componentId: ComponentID, envId: string, modules: PreviewModule, [compositionsFromParams]: [any], context: RenderingContext) => void",
|
1751
1751
|
"name": "render",
|
1752
1752
|
"type": {
|
1753
1753
|
"__schema": "InferenceTypeSchema",
|
@@ -1756,16 +1756,16 @@
|
|
1756
1756
|
"line": 24,
|
1757
1757
|
"character": 3
|
1758
1758
|
},
|
1759
|
-
"type": "(componentId: ComponentID, envId: string, modules: PreviewModule, [
|
1759
|
+
"type": "(componentId: ComponentID, envId: string, modules: PreviewModule, [compositionsFromParams]: [any], context: RenderingContext) => void"
|
1760
1760
|
},
|
1761
1761
|
"isOptional": true,
|
1762
|
-
"defaultValue": "(\n componentId: ComponentID,\n envId: string,\n modules: PreviewModule,\n [
|
1762
|
+
"defaultValue": "(\n componentId: ComponentID,\n envId: string,\n modules: PreviewModule,\n [compositionsFromParams]: [any],\n context: RenderingContext\n ) => {\n const docsModule = this.selectPreviewModel(componentId.fullName, modules);\n const compositions = compositionsFromParams || [];\n\n const mainModule = modules.modulesMap[envId] || modules.modulesMap.default;\n let defaultExports = mainModule.default;\n // Sometime when using ESM (package.json with type:\"module\") the default export is nested under \"default\"\n if (typeof defaultExports !== 'function' && defaultExports.default) {\n defaultExports = defaultExports.default;\n }\n // @ts-ignore Gilad - to fix.\n const isObject = !!defaultExports.apiObject;\n\n /**\n * for backwards compatibility - can be removed end of 2022\n */\n if (!isObject) {\n const docsPropsArray = [\n NoopProvider as React.ComponentType,\n componentId.toString(),\n docsModule as Docs,\n compositions,\n context,\n ];\n // @ts-ignore Gilad - to fix. it happens because defaultExports might be a func or an object (handled above)\n defaultExports(...docsPropsArray);\n return;\n }\n\n const docsProps: DocsRootProps = {\n Provider: NoopProvider as React.ComponentType,\n componentId: componentId.toString(),\n docs: docsModule as Docs,\n compositions,\n context,\n };\n // @ts-ignore Gilad - to fix. it happens because defaultExports might be a func or an object (handled above)\n defaultExports(docsProps);\n }"
|
1763
1763
|
},
|
1764
1764
|
{
|
1765
1765
|
"__schema": "FunctionLikeSchema",
|
1766
1766
|
"location": {
|
1767
1767
|
"filePath": "docs.preview.runtime.tsx",
|
1768
|
-
"line":
|
1768
|
+
"line": 70,
|
1769
1769
|
"character": 3
|
1770
1770
|
},
|
1771
1771
|
"signature": "(method) DocsPreview.selectPreviewModel(componentId: string, modules: PreviewModule): ModuleFile<any> | undefined",
|
@@ -1775,7 +1775,7 @@
|
|
1775
1775
|
"__schema": "ParameterSchema",
|
1776
1776
|
"location": {
|
1777
1777
|
"filePath": "docs.preview.runtime.tsx",
|
1778
|
-
"line":
|
1778
|
+
"line": 70,
|
1779
1779
|
"character": 22
|
1780
1780
|
},
|
1781
1781
|
"name": "componentId",
|
@@ -1783,7 +1783,7 @@
|
|
1783
1783
|
"__schema": "KeywordTypeSchema",
|
1784
1784
|
"location": {
|
1785
1785
|
"filePath": "docs.preview.runtime.tsx",
|
1786
|
-
"line":
|
1786
|
+
"line": 70,
|
1787
1787
|
"character": 35
|
1788
1788
|
},
|
1789
1789
|
"name": "string"
|
@@ -1795,7 +1795,7 @@
|
|
1795
1795
|
"__schema": "ParameterSchema",
|
1796
1796
|
"location": {
|
1797
1797
|
"filePath": "docs.preview.runtime.tsx",
|
1798
|
-
"line":
|
1798
|
+
"line": 70,
|
1799
1799
|
"character": 43
|
1800
1800
|
},
|
1801
1801
|
"name": "modules",
|
@@ -1803,7 +1803,7 @@
|
|
1803
1803
|
"__schema": "TypeRefSchema",
|
1804
1804
|
"location": {
|
1805
1805
|
"filePath": "docs.preview.runtime.tsx",
|
1806
|
-
"line":
|
1806
|
+
"line": 70,
|
1807
1807
|
"character": 52
|
1808
1808
|
},
|
1809
1809
|
"name": "PreviewModule"
|
@@ -1816,7 +1816,7 @@
|
|
1816
1816
|
"__schema": "InferenceTypeSchema",
|
1817
1817
|
"location": {
|
1818
1818
|
"filePath": "docs.preview.runtime.tsx",
|
1819
|
-
"line":
|
1819
|
+
"line": 70,
|
1820
1820
|
"character": 3
|
1821
1821
|
},
|
1822
1822
|
"type": "ModuleFile<any> | undefined"
|
@@ -1827,7 +1827,7 @@
|
|
1827
1827
|
"__schema": "VariableLikeSchema",
|
1828
1828
|
"location": {
|
1829
1829
|
"filePath": "docs.preview.runtime.tsx",
|
1830
|
-
"line":
|
1830
|
+
"line": 78,
|
1831
1831
|
"character": 3
|
1832
1832
|
},
|
1833
1833
|
"signature": "(property) DocsPreview.runtime: RuntimeDefinition",
|
@@ -1836,7 +1836,7 @@
|
|
1836
1836
|
"__schema": "InferenceTypeSchema",
|
1837
1837
|
"location": {
|
1838
1838
|
"filePath": "docs.preview.runtime.tsx",
|
1839
|
-
"line":
|
1839
|
+
"line": 78,
|
1840
1840
|
"character": 3
|
1841
1841
|
},
|
1842
1842
|
"type": "RuntimeDefinition"
|
@@ -1848,7 +1848,7 @@
|
|
1848
1848
|
"__schema": "VariableLikeSchema",
|
1849
1849
|
"location": {
|
1850
1850
|
"filePath": "docs.preview.runtime.tsx",
|
1851
|
-
"line":
|
1851
|
+
"line": 79,
|
1852
1852
|
"character": 3
|
1853
1853
|
},
|
1854
1854
|
"signature": "(property) DocsPreview.dependencies: Aspect[]",
|
@@ -1857,7 +1857,7 @@
|
|
1857
1857
|
"__schema": "InferenceTypeSchema",
|
1858
1858
|
"location": {
|
1859
1859
|
"filePath": "docs.preview.runtime.tsx",
|
1860
|
-
"line":
|
1860
|
+
"line": 79,
|
1861
1861
|
"character": 3
|
1862
1862
|
},
|
1863
1863
|
"type": "Aspect[]"
|
@@ -1869,7 +1869,7 @@
|
|
1869
1869
|
"__schema": "FunctionLikeSchema",
|
1870
1870
|
"location": {
|
1871
1871
|
"filePath": "docs.preview.runtime.tsx",
|
1872
|
-
"line":
|
1872
|
+
"line": 81,
|
1873
1873
|
"character": 3
|
1874
1874
|
},
|
1875
1875
|
"signature": "(method) DocsPreview.provider([preview]: [PreviewPreview]): Promise<DocsPreview>",
|
@@ -1879,7 +1879,7 @@
|
|
1879
1879
|
"__schema": "ParameterSchema",
|
1880
1880
|
"location": {
|
1881
1881
|
"filePath": "docs.preview.runtime.tsx",
|
1882
|
-
"line":
|
1882
|
+
"line": 81,
|
1883
1883
|
"character": 25
|
1884
1884
|
},
|
1885
1885
|
"name": "[ preview ]",
|
@@ -1887,7 +1887,7 @@
|
|
1887
1887
|
"__schema": "TupleTypeSchema",
|
1888
1888
|
"location": {
|
1889
1889
|
"filePath": "docs.preview.runtime.tsx",
|
1890
|
-
"line":
|
1890
|
+
"line": 81,
|
1891
1891
|
"character": 36
|
1892
1892
|
},
|
1893
1893
|
"elements": [
|
@@ -1895,7 +1895,7 @@
|
|
1895
1895
|
"__schema": "TypeRefSchema",
|
1896
1896
|
"location": {
|
1897
1897
|
"filePath": "docs.preview.runtime.tsx",
|
1898
|
-
"line":
|
1898
|
+
"line": 81,
|
1899
1899
|
"character": 37
|
1900
1900
|
},
|
1901
1901
|
"name": "PreviewPreview"
|
@@ -1910,7 +1910,7 @@
|
|
1910
1910
|
"__schema": "InferenceTypeSchema",
|
1911
1911
|
"location": {
|
1912
1912
|
"filePath": "docs.preview.runtime.tsx",
|
1913
|
-
"line":
|
1913
|
+
"line": 81,
|
1914
1914
|
"character": 3
|
1915
1915
|
},
|
1916
1916
|
"type": "Promise<DocsPreview>"
|
@@ -1940,7 +1940,7 @@
|
|
1940
1940
|
"line": 8,
|
1941
1941
|
"character": 1
|
1942
1942
|
},
|
1943
|
-
"signature": "type DocsRootProps = {\n Provider: React.ComponentType | undefined;\n componentId: string;\n docs: Docs | undefined;\n compositions
|
1943
|
+
"signature": "type DocsRootProps = {\n Provider: React.ComponentType | undefined;\n componentId: string;\n docs: Docs | undefined;\n compositions?: any;\n context: RenderingContext;\n}",
|
1944
1944
|
"name": "DocsRootProps",
|
1945
1945
|
"type": {
|
1946
1946
|
"__schema": "TypeLiteralSchema",
|
@@ -2055,18 +2055,18 @@
|
|
2055
2055
|
"line": 12,
|
2056
2056
|
"character": 3
|
2057
2057
|
},
|
2058
|
-
"signature": "(property) compositions
|
2058
|
+
"signature": "(property) compositions?: any",
|
2059
2059
|
"name": "compositions",
|
2060
2060
|
"type": {
|
2061
2061
|
"__schema": "KeywordTypeSchema",
|
2062
2062
|
"location": {
|
2063
2063
|
"filePath": "docs.preview.runtime.tsx",
|
2064
2064
|
"line": 12,
|
2065
|
-
"character":
|
2065
|
+
"character": 18
|
2066
2066
|
},
|
2067
2067
|
"name": "any"
|
2068
2068
|
},
|
2069
|
-
"isOptional":
|
2069
|
+
"isOptional": true
|
2070
2070
|
},
|
2071
2071
|
{
|
2072
2072
|
"__schema": "VariableLikeSchema",
|
@@ -4997,7 +4997,7 @@
|
|
4997
4997
|
"line": 8,
|
4998
4998
|
"character": 1
|
4999
4999
|
},
|
5000
|
-
"signature": "type DocsRootProps = {\n Provider: React.ComponentType | undefined;\n componentId: string;\n docs: Docs | undefined;\n compositions
|
5000
|
+
"signature": "type DocsRootProps = {\n Provider: React.ComponentType | undefined;\n componentId: string;\n docs: Docs | undefined;\n compositions?: any;\n context: RenderingContext;\n}",
|
5001
5001
|
"name": "DocsRootProps",
|
5002
5002
|
"type": {
|
5003
5003
|
"__schema": "TypeLiteralSchema",
|
@@ -5112,18 +5112,18 @@
|
|
5112
5112
|
"line": 12,
|
5113
5113
|
"character": 3
|
5114
5114
|
},
|
5115
|
-
"signature": "(property) compositions
|
5115
|
+
"signature": "(property) compositions?: any",
|
5116
5116
|
"name": "compositions",
|
5117
5117
|
"type": {
|
5118
5118
|
"__schema": "KeywordTypeSchema",
|
5119
5119
|
"location": {
|
5120
5120
|
"filePath": "docs.preview.runtime.tsx",
|
5121
5121
|
"line": 12,
|
5122
|
-
"character":
|
5122
|
+
"character": 18
|
5123
5123
|
},
|
5124
5124
|
"name": "any"
|
5125
5125
|
},
|
5126
|
-
"isOptional":
|
5126
|
+
"isOptional": true
|
5127
5127
|
},
|
5128
5128
|
{
|
5129
5129
|
"__schema": "VariableLikeSchema",
|
@@ -5211,7 +5211,7 @@
|
|
5211
5211
|
"line": 24,
|
5212
5212
|
"character": 3
|
5213
5213
|
},
|
5214
|
-
"signature": "(property) DocsPreview.render: (componentId: ComponentID, envId: string, modules: PreviewModule, [
|
5214
|
+
"signature": "(property) DocsPreview.render: (componentId: ComponentID, envId: string, modules: PreviewModule, [compositionsFromParams]: [any], context: RenderingContext) => void",
|
5215
5215
|
"name": "render",
|
5216
5216
|
"type": {
|
5217
5217
|
"__schema": "InferenceTypeSchema",
|
@@ -5220,16 +5220,16 @@
|
|
5220
5220
|
"line": 24,
|
5221
5221
|
"character": 3
|
5222
5222
|
},
|
5223
|
-
"type": "(componentId: ComponentID, envId: string, modules: PreviewModule, [
|
5223
|
+
"type": "(componentId: ComponentID, envId: string, modules: PreviewModule, [compositionsFromParams]: [any], context: RenderingContext) => void"
|
5224
5224
|
},
|
5225
5225
|
"isOptional": true,
|
5226
|
-
"defaultValue": "(\n componentId: ComponentID,\n envId: string,\n modules: PreviewModule,\n [
|
5226
|
+
"defaultValue": "(\n componentId: ComponentID,\n envId: string,\n modules: PreviewModule,\n [compositionsFromParams]: [any],\n context: RenderingContext\n ) => {\n const docsModule = this.selectPreviewModel(componentId.fullName, modules);\n const compositions = compositionsFromParams || [];\n\n const mainModule = modules.modulesMap[envId] || modules.modulesMap.default;\n let defaultExports = mainModule.default;\n // Sometime when using ESM (package.json with type:\"module\") the default export is nested under \"default\"\n if (typeof defaultExports !== 'function' && defaultExports.default) {\n defaultExports = defaultExports.default;\n }\n // @ts-ignore Gilad - to fix.\n const isObject = !!defaultExports.apiObject;\n\n /**\n * for backwards compatibility - can be removed end of 2022\n */\n if (!isObject) {\n const docsPropsArray = [\n NoopProvider as React.ComponentType,\n componentId.toString(),\n docsModule as Docs,\n compositions,\n context,\n ];\n // @ts-ignore Gilad - to fix. it happens because defaultExports might be a func or an object (handled above)\n defaultExports(...docsPropsArray);\n return;\n }\n\n const docsProps: DocsRootProps = {\n Provider: NoopProvider as React.ComponentType,\n componentId: componentId.toString(),\n docs: docsModule as Docs,\n compositions,\n context,\n };\n // @ts-ignore Gilad - to fix. it happens because defaultExports might be a func or an object (handled above)\n defaultExports(docsProps);\n }"
|
5227
5227
|
},
|
5228
5228
|
{
|
5229
5229
|
"__schema": "FunctionLikeSchema",
|
5230
5230
|
"location": {
|
5231
5231
|
"filePath": "docs.preview.runtime.tsx",
|
5232
|
-
"line":
|
5232
|
+
"line": 70,
|
5233
5233
|
"character": 3
|
5234
5234
|
},
|
5235
5235
|
"signature": "(method) DocsPreview.selectPreviewModel(componentId: string, modules: PreviewModule): ModuleFile<any> | undefined",
|
@@ -5239,7 +5239,7 @@
|
|
5239
5239
|
"__schema": "ParameterSchema",
|
5240
5240
|
"location": {
|
5241
5241
|
"filePath": "docs.preview.runtime.tsx",
|
5242
|
-
"line":
|
5242
|
+
"line": 70,
|
5243
5243
|
"character": 22
|
5244
5244
|
},
|
5245
5245
|
"name": "componentId",
|
@@ -5247,7 +5247,7 @@
|
|
5247
5247
|
"__schema": "KeywordTypeSchema",
|
5248
5248
|
"location": {
|
5249
5249
|
"filePath": "docs.preview.runtime.tsx",
|
5250
|
-
"line":
|
5250
|
+
"line": 70,
|
5251
5251
|
"character": 35
|
5252
5252
|
},
|
5253
5253
|
"name": "string"
|
@@ -5259,7 +5259,7 @@
|
|
5259
5259
|
"__schema": "ParameterSchema",
|
5260
5260
|
"location": {
|
5261
5261
|
"filePath": "docs.preview.runtime.tsx",
|
5262
|
-
"line":
|
5262
|
+
"line": 70,
|
5263
5263
|
"character": 43
|
5264
5264
|
},
|
5265
5265
|
"name": "modules",
|
@@ -5267,7 +5267,7 @@
|
|
5267
5267
|
"__schema": "TypeRefSchema",
|
5268
5268
|
"location": {
|
5269
5269
|
"filePath": "docs.preview.runtime.tsx",
|
5270
|
-
"line":
|
5270
|
+
"line": 70,
|
5271
5271
|
"character": 52
|
5272
5272
|
},
|
5273
5273
|
"name": "PreviewModule"
|
@@ -5280,7 +5280,7 @@
|
|
5280
5280
|
"__schema": "InferenceTypeSchema",
|
5281
5281
|
"location": {
|
5282
5282
|
"filePath": "docs.preview.runtime.tsx",
|
5283
|
-
"line":
|
5283
|
+
"line": 70,
|
5284
5284
|
"character": 3
|
5285
5285
|
},
|
5286
5286
|
"type": "ModuleFile<any> | undefined"
|
@@ -5291,7 +5291,7 @@
|
|
5291
5291
|
"__schema": "VariableLikeSchema",
|
5292
5292
|
"location": {
|
5293
5293
|
"filePath": "docs.preview.runtime.tsx",
|
5294
|
-
"line":
|
5294
|
+
"line": 78,
|
5295
5295
|
"character": 3
|
5296
5296
|
},
|
5297
5297
|
"signature": "(property) DocsPreview.runtime: RuntimeDefinition",
|
@@ -5300,7 +5300,7 @@
|
|
5300
5300
|
"__schema": "InferenceTypeSchema",
|
5301
5301
|
"location": {
|
5302
5302
|
"filePath": "docs.preview.runtime.tsx",
|
5303
|
-
"line":
|
5303
|
+
"line": 78,
|
5304
5304
|
"character": 3
|
5305
5305
|
},
|
5306
5306
|
"type": "RuntimeDefinition"
|
@@ -5312,7 +5312,7 @@
|
|
5312
5312
|
"__schema": "VariableLikeSchema",
|
5313
5313
|
"location": {
|
5314
5314
|
"filePath": "docs.preview.runtime.tsx",
|
5315
|
-
"line":
|
5315
|
+
"line": 79,
|
5316
5316
|
"character": 3
|
5317
5317
|
},
|
5318
5318
|
"signature": "(property) DocsPreview.dependencies: Aspect[]",
|
@@ -5321,7 +5321,7 @@
|
|
5321
5321
|
"__schema": "InferenceTypeSchema",
|
5322
5322
|
"location": {
|
5323
5323
|
"filePath": "docs.preview.runtime.tsx",
|
5324
|
-
"line":
|
5324
|
+
"line": 79,
|
5325
5325
|
"character": 3
|
5326
5326
|
},
|
5327
5327
|
"type": "Aspect[]"
|
@@ -5333,7 +5333,7 @@
|
|
5333
5333
|
"__schema": "FunctionLikeSchema",
|
5334
5334
|
"location": {
|
5335
5335
|
"filePath": "docs.preview.runtime.tsx",
|
5336
|
-
"line":
|
5336
|
+
"line": 81,
|
5337
5337
|
"character": 3
|
5338
5338
|
},
|
5339
5339
|
"signature": "(method) DocsPreview.provider([preview]: [PreviewPreview]): Promise<DocsPreview>",
|
@@ -5343,7 +5343,7 @@
|
|
5343
5343
|
"__schema": "ParameterSchema",
|
5344
5344
|
"location": {
|
5345
5345
|
"filePath": "docs.preview.runtime.tsx",
|
5346
|
-
"line":
|
5346
|
+
"line": 81,
|
5347
5347
|
"character": 25
|
5348
5348
|
},
|
5349
5349
|
"name": "[ preview ]",
|
@@ -5351,7 +5351,7 @@
|
|
5351
5351
|
"__schema": "TupleTypeSchema",
|
5352
5352
|
"location": {
|
5353
5353
|
"filePath": "docs.preview.runtime.tsx",
|
5354
|
-
"line":
|
5354
|
+
"line": 81,
|
5355
5355
|
"character": 36
|
5356
5356
|
},
|
5357
5357
|
"elements": [
|
@@ -5359,7 +5359,7 @@
|
|
5359
5359
|
"__schema": "TypeRefSchema",
|
5360
5360
|
"location": {
|
5361
5361
|
"filePath": "docs.preview.runtime.tsx",
|
5362
|
-
"line":
|
5362
|
+
"line": 81,
|
5363
5363
|
"character": 37
|
5364
5364
|
},
|
5365
5365
|
"name": "PreviewPreview"
|
@@ -5374,7 +5374,7 @@
|
|
5374
5374
|
"__schema": "InferenceTypeSchema",
|
5375
5375
|
"location": {
|
5376
5376
|
"filePath": "docs.preview.runtime.tsx",
|
5377
|
-
"line":
|
5377
|
+
"line": 81,
|
5378
5378
|
"character": 3
|
5379
5379
|
},
|
5380
5380
|
"type": "Promise<DocsPreview>"
|
@@ -5394,7 +5394,7 @@
|
|
5394
5394
|
"__schema": "UnImplementedSchema",
|
5395
5395
|
"location": {
|
5396
5396
|
"filePath": "docs.preview.runtime.tsx",
|
5397
|
-
"line":
|
5397
|
+
"line": 94,
|
5398
5398
|
"character": 1
|
5399
5399
|
},
|
5400
5400
|
"name": "DocsAspect.addRuntime(DocsPreview);",
|
@@ -5404,7 +5404,7 @@
|
|
5404
5404
|
"__schema": "ReactSchema",
|
5405
5405
|
"location": {
|
5406
5406
|
"filePath": "docs.preview.runtime.tsx",
|
5407
|
-
"line":
|
5407
|
+
"line": 96,
|
5408
5408
|
"character": 1
|
5409
5409
|
},
|
5410
5410
|
"signature": "function NoopProvider({ children }: {\n children: ReactNode;\n}): React.JSX.Element",
|
@@ -5413,7 +5413,7 @@
|
|
5413
5413
|
"__schema": "ParameterSchema",
|
5414
5414
|
"location": {
|
5415
5415
|
"filePath": "docs.preview.runtime.tsx",
|
5416
|
-
"line":
|
5416
|
+
"line": 96,
|
5417
5417
|
"character": 23
|
5418
5418
|
},
|
5419
5419
|
"name": "{ children }",
|
@@ -5421,7 +5421,7 @@
|
|
5421
5421
|
"__schema": "TypeLiteralSchema",
|
5422
5422
|
"location": {
|
5423
5423
|
"filePath": "docs.preview.runtime.tsx",
|
5424
|
-
"line":
|
5424
|
+
"line": 96,
|
5425
5425
|
"character": 37
|
5426
5426
|
},
|
5427
5427
|
"members": [
|
@@ -5429,7 +5429,7 @@
|
|
5429
5429
|
"__schema": "VariableLikeSchema",
|
5430
5430
|
"location": {
|
5431
5431
|
"filePath": "docs.preview.runtime.tsx",
|
5432
|
-
"line":
|
5432
|
+
"line": 96,
|
5433
5433
|
"character": 39
|
5434
5434
|
},
|
5435
5435
|
"signature": "(property) children: React.ReactNode",
|
@@ -5438,7 +5438,7 @@
|
|
5438
5438
|
"__schema": "TypeRefSchema",
|
5439
5439
|
"location": {
|
5440
5440
|
"filePath": "docs.preview.runtime.tsx",
|
5441
|
-
"line":
|
5441
|
+
"line": 96,
|
5442
5442
|
"character": 49
|
5443
5443
|
},
|
5444
5444
|
"name": "ReactNode"
|
@@ -5453,7 +5453,7 @@
|
|
5453
5453
|
"__schema": "VariableLikeSchema",
|
5454
5454
|
"location": {
|
5455
5455
|
"filePath": "docs.preview.runtime.tsx",
|
5456
|
-
"line":
|
5456
|
+
"line": 96,
|
5457
5457
|
"character": 39
|
5458
5458
|
},
|
5459
5459
|
"signature": "(property) children: React.ReactNode",
|
@@ -5462,7 +5462,7 @@
|
|
5462
5462
|
"__schema": "TypeRefSchema",
|
5463
5463
|
"location": {
|
5464
5464
|
"filePath": "docs.preview.runtime.tsx",
|
5465
|
-
"line":
|
5465
|
+
"line": 96,
|
5466
5466
|
"character": 49
|
5467
5467
|
},
|
5468
5468
|
"name": "ReactNode"
|
@@ -5476,7 +5476,7 @@
|
|
5476
5476
|
"__schema": "TypeRefSchema",
|
5477
5477
|
"location": {
|
5478
5478
|
"filePath": "docs.preview.runtime.tsx",
|
5479
|
-
"line":
|
5479
|
+
"line": 96,
|
5480
5480
|
"character": 1
|
5481
5481
|
},
|
5482
5482
|
"name": "React.JSX.Element",
|
@@ -6667,7 +6667,7 @@
|
|
6667
6667
|
"componentId": {
|
6668
6668
|
"scope": "teambit.docs",
|
6669
6669
|
"name": "docs",
|
6670
|
-
"version": "1.0.
|
6670
|
+
"version": "1.0.373"
|
6671
6671
|
},
|
6672
6672
|
"taggedModuleExports": []
|
6673
6673
|
}
|
@@ -6,7 +6,7 @@ export type DocsRootProps = {
|
|
6
6
|
Provider: React.ComponentType | undefined;
|
7
7
|
componentId: string;
|
8
8
|
docs: Docs | undefined;
|
9
|
-
compositions
|
9
|
+
compositions?: any;
|
10
10
|
context: RenderingContext;
|
11
11
|
};
|
12
12
|
export declare class DocsPreview {
|
@@ -19,7 +19,7 @@ export declare class DocsPreview {
|
|
19
19
|
* preview extension.
|
20
20
|
*/
|
21
21
|
preview: PreviewPreview);
|
22
|
-
render: (componentId: ComponentID, envId: string, modules: PreviewModule, [
|
22
|
+
render: (componentId: ComponentID, envId: string, modules: PreviewModule, [compositionsFromParams]: [any], context: RenderingContext) => void;
|
23
23
|
selectPreviewModel(componentId: string, modules: PreviewModule): import("@teambit/preview").ModuleFile<any> | undefined;
|
24
24
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
25
25
|
static dependencies: import("@teambit/harmony").Aspect[];
|
@@ -36,8 +36,9 @@ class DocsPreview {
|
|
36
36
|
*/
|
37
37
|
preview) {
|
38
38
|
this.preview = preview;
|
39
|
-
_defineProperty(this, "render", (componentId, envId, modules, [
|
39
|
+
_defineProperty(this, "render", (componentId, envId, modules, [compositionsFromParams], context) => {
|
40
40
|
const docsModule = this.selectPreviewModel(componentId.fullName, modules);
|
41
|
+
const compositions = compositionsFromParams || [];
|
41
42
|
const mainModule = modules.modulesMap[envId] || modules.modulesMap.default;
|
42
43
|
let defaultExports = mainModule.default;
|
43
44
|
// Sometime when using ESM (package.json with type:"module") the default export is nested under "default"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","_preview","_docs","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DocsPreview","constructor","preview","componentId","envId","modules","
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_preview","_docs","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DocsPreview","constructor","preview","componentId","envId","modules","compositionsFromParams","context","docsModule","selectPreviewModel","fullName","compositions","mainModule","modulesMap","defaultExports","isObject","apiObject","docsPropsArray","NoopProvider","toString","docsProps","Provider","docs","relevant","componentMap","undefined","provider","docsPreview","registerPreview","name","render","bind","include","exports","PreviewRuntime","PreviewAspect","DocsAspect","addRuntime","children","createElement","Fragment"],"sources":["docs.preview.runtime.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { PreviewAspect, RenderingContext, PreviewPreview, PreviewRuntime, PreviewModule } from '@teambit/preview';\nimport { ComponentID } from '@teambit/component-id';\n\nimport { DocsAspect } from './docs.aspect';\nimport type { Docs } from './docs';\n\nexport type DocsRootProps = {\n Provider: React.ComponentType | undefined;\n componentId: string;\n docs: Docs | undefined;\n compositions?: any;\n context: RenderingContext;\n};\n\nexport class DocsPreview {\n constructor(\n /**\n * preview extension.\n */\n private preview: PreviewPreview\n ) {}\n\n render = (\n componentId: ComponentID,\n envId: string,\n modules: PreviewModule,\n [compositionsFromParams]: [any],\n context: RenderingContext\n ) => {\n const docsModule = this.selectPreviewModel(componentId.fullName, modules);\n const compositions = compositionsFromParams || [];\n\n const mainModule = modules.modulesMap[envId] || modules.modulesMap.default;\n let defaultExports = mainModule.default;\n // Sometime when using ESM (package.json with type:\"module\") the default export is nested under \"default\"\n if (typeof defaultExports !== 'function' && defaultExports.default) {\n defaultExports = defaultExports.default;\n }\n // @ts-ignore Gilad - to fix.\n const isObject = !!defaultExports.apiObject;\n\n /**\n * for backwards compatibility - can be removed end of 2022\n */\n if (!isObject) {\n const docsPropsArray = [\n NoopProvider as React.ComponentType,\n componentId.toString(),\n docsModule as Docs,\n compositions,\n context,\n ];\n // @ts-ignore Gilad - to fix. it happens because defaultExports might be a func or an object (handled above)\n defaultExports(...docsPropsArray);\n return;\n }\n\n const docsProps: DocsRootProps = {\n Provider: NoopProvider as React.ComponentType,\n componentId: componentId.toString(),\n docs: docsModule as Docs,\n compositions,\n context,\n };\n // @ts-ignore Gilad - to fix. it happens because defaultExports might be a func or an object (handled above)\n defaultExports(docsProps);\n };\n\n selectPreviewModel(componentId: string, modules: PreviewModule) {\n const relevant = modules.componentMap[componentId];\n if (!relevant) return undefined;\n\n // only one doc file is supported.\n return relevant[0];\n }\n\n static runtime = PreviewRuntime;\n static dependencies = [PreviewAspect];\n\n static async provider([preview]: [PreviewPreview]) {\n const docsPreview = new DocsPreview(preview);\n preview.registerPreview({\n name: 'overview',\n render: docsPreview.render.bind(docsPreview),\n selectPreviewModel: docsPreview.selectPreviewModel.bind(docsPreview),\n include: ['compositions'],\n });\n\n return docsPreview;\n }\n}\n\nDocsAspect.addRuntime(DocsPreview);\n\nfunction NoopProvider({ children }: { children: ReactNode }) {\n return <>{children}</>;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2C,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AA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OAAA,CAAA0D,aAAA,CAAAlE,MAAA,GAAAQ,OAAA,CAAA2D,QAAA,QAAGF,QAAW,CAAC;AACxB","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.373/dist/docs.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.373/dist/docs.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/docs.preview.runtime.tsx
CHANGED
@@ -9,7 +9,7 @@ export type DocsRootProps = {
|
|
9
9
|
Provider: React.ComponentType | undefined;
|
10
10
|
componentId: string;
|
11
11
|
docs: Docs | undefined;
|
12
|
-
compositions
|
12
|
+
compositions?: any;
|
13
13
|
context: RenderingContext;
|
14
14
|
};
|
15
15
|
|
@@ -25,10 +25,11 @@ export class DocsPreview {
|
|
25
25
|
componentId: ComponentID,
|
26
26
|
envId: string,
|
27
27
|
modules: PreviewModule,
|
28
|
-
[
|
28
|
+
[compositionsFromParams]: [any],
|
29
29
|
context: RenderingContext
|
30
30
|
) => {
|
31
31
|
const docsModule = this.selectPreviewModel(componentId.fullName, modules);
|
32
|
+
const compositions = compositionsFromParams || [];
|
32
33
|
|
33
34
|
const mainModule = modules.modulesMap[envId] || modules.modulesMap.default;
|
34
35
|
let defaultExports = mainModule.default;
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/docs",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.373",
|
4
4
|
"homepage": "https://bit.cloud/teambit/docs/docs",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.docs",
|
8
8
|
"name": "docs",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.373"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"graphql-tag": "2.12.1",
|
@@ -19,22 +19,22 @@
|
|
19
19
|
"@teambit/base-react.themes.theme-switcher": "1.0.2",
|
20
20
|
"@teambit/component.ui.component-meta": "0.0.358",
|
21
21
|
"@teambit/base-ui.loaders.skeleton": "1.0.1",
|
22
|
-
"@teambit/compiler": "1.0.
|
23
|
-
"@teambit/component": "1.0.
|
24
|
-
"@teambit/pkg": "1.0.
|
25
|
-
"@teambit/workspace": "1.0.
|
26
|
-
"@teambit/cli": "0.0.
|
22
|
+
"@teambit/compiler": "1.0.373",
|
23
|
+
"@teambit/component": "1.0.373",
|
24
|
+
"@teambit/pkg": "1.0.373",
|
25
|
+
"@teambit/workspace": "1.0.373",
|
26
|
+
"@teambit/cli": "0.0.950",
|
27
27
|
"@teambit/component.sources": "0.0.18",
|
28
|
-
"@teambit/dev-files": "1.0.
|
29
|
-
"@teambit/envs": "1.0.
|
30
|
-
"@teambit/graphql": "1.0.
|
31
|
-
"@teambit/logger": "0.0.
|
32
|
-
"@teambit/preview": "1.0.
|
33
|
-
"@teambit/scope": "1.0.
|
34
|
-
"@teambit/api-reference": "1.0.
|
35
|
-
"@teambit/component-compare": "1.0.
|
36
|
-
"@teambit/ui": "1.0.
|
37
|
-
"@teambit/pubsub": "1.0.
|
28
|
+
"@teambit/dev-files": "1.0.373",
|
29
|
+
"@teambit/envs": "1.0.373",
|
30
|
+
"@teambit/graphql": "1.0.373",
|
31
|
+
"@teambit/logger": "0.0.1043",
|
32
|
+
"@teambit/preview": "1.0.373",
|
33
|
+
"@teambit/scope": "1.0.373",
|
34
|
+
"@teambit/api-reference": "1.0.373",
|
35
|
+
"@teambit/component-compare": "1.0.373",
|
36
|
+
"@teambit/ui": "1.0.373",
|
37
|
+
"@teambit/pubsub": "1.0.373",
|
38
38
|
"@teambit/compositions.panels.composition-gallery": "0.0.211",
|
39
39
|
"@teambit/preview.ui.component-preview": "1.0.12"
|
40
40
|
},
|