@teambit/ui 0.0.771 → 0.0.772
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/dist/create-root.js
CHANGED
|
@@ -70,9 +70,18 @@ export function render(...props){
|
|
|
70
70
|
.then((harmony) => {
|
|
71
71
|
return harmony
|
|
72
72
|
.run()
|
|
73
|
-
.then(() => {
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
.then(() => harmony.get('${rootAspect}'))
|
|
74
|
+
.then((rootExtension) => {
|
|
75
|
+
const ssrSetup = !isBrowser && rootExtension.setupSsr;
|
|
76
|
+
const setup = rootExtension.setup;
|
|
77
|
+
const setupFunc = (ssrSetup || setup || function noop(){}).bind(rootExtension);
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
Promise.resolve(setupFunc())
|
|
81
|
+
.then(() => rootExtension)
|
|
82
|
+
);
|
|
83
|
+
})
|
|
84
|
+
.then((rootExtension) => {
|
|
76
85
|
if (isBrowser) {
|
|
77
86
|
return rootExtension.render(${rootId}, ...props);
|
|
78
87
|
} else {
|
package/dist/create-root.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createRoot","aspectDefs","rootExtensionName","rootAspect","UIAspect","id","runtime","config","rootId","identifiers","getIdentifiers","idSetters","getIdSetters","stringifiedConfig","toWindowsCompatiblePath","JSON","stringify","replace","createImports","join","defs","filter","def","runtimePath","getImportStatements","pathProp","suffix","map","aspectDef","getIdentifier","getId","undefined","val","component","local","getCoreIdentifier","aspectPath","getRegularAspectIdentifier","camelCase","parse","base","path","name","split"],"sources":["create-root.ts"],"sourcesContent":["import { AspectDefinition } from '@teambit/aspect-loader';\nimport { toWindowsCompatiblePath } from '@teambit/toolbox.path.to-windows-compatible-path';\nimport { camelCase } from 'lodash';\nimport { parse } from 'path';\n\nimport { UIAspect } from './ui.aspect';\n\nexport async function createRoot(\n aspectDefs: AspectDefinition[],\n rootExtensionName?: string,\n rootAspect = UIAspect.id,\n runtime = 'ui',\n config = {}\n) {\n const rootId = rootExtensionName ? `'${rootExtensionName}'` : '';\n const identifiers = getIdentifiers(aspectDefs, 'Aspect');\n\n const idSetters = getIdSetters(aspectDefs, 'Aspect');\n config['teambit.harmony/bit'] = rootExtensionName;\n // Escaping \"'\" in case for example in the config you have something like:\n // description: \"team's scope\"\n const stringifiedConfig = toWindowsCompatiblePath(JSON.stringify(config)).replace(/'/g, \"\\\\'\");\n\n return `\n${createImports(aspectDefs)}\n\nconst isBrowser = typeof window !== \"undefined\";\nconst config = JSON.parse('${stringifiedConfig}');\n${idSetters.join('\\n')}\nexport function render(...props){\n return Harmony.load([${identifiers.join(', ')}], '${runtime}', config)\n .then((harmony) => {\n return harmony\n .run()\n .then(() => {\n const rootExtension =
|
|
1
|
+
{"version":3,"names":["createRoot","aspectDefs","rootExtensionName","rootAspect","UIAspect","id","runtime","config","rootId","identifiers","getIdentifiers","idSetters","getIdSetters","stringifiedConfig","toWindowsCompatiblePath","JSON","stringify","replace","createImports","join","defs","filter","def","runtimePath","getImportStatements","pathProp","suffix","map","aspectDef","getIdentifier","getId","undefined","val","component","local","getCoreIdentifier","aspectPath","getRegularAspectIdentifier","camelCase","parse","base","path","name","split"],"sources":["create-root.ts"],"sourcesContent":["import { AspectDefinition } from '@teambit/aspect-loader';\nimport { toWindowsCompatiblePath } from '@teambit/toolbox.path.to-windows-compatible-path';\nimport { camelCase } from 'lodash';\nimport { parse } from 'path';\n\nimport { UIAspect } from './ui.aspect';\n\nexport async function createRoot(\n aspectDefs: AspectDefinition[],\n rootExtensionName?: string,\n rootAspect = UIAspect.id,\n runtime = 'ui',\n config = {}\n) {\n const rootId = rootExtensionName ? `'${rootExtensionName}'` : '';\n const identifiers = getIdentifiers(aspectDefs, 'Aspect');\n\n const idSetters = getIdSetters(aspectDefs, 'Aspect');\n config['teambit.harmony/bit'] = rootExtensionName;\n // Escaping \"'\" in case for example in the config you have something like:\n // description: \"team's scope\"\n const stringifiedConfig = toWindowsCompatiblePath(JSON.stringify(config)).replace(/'/g, \"\\\\'\");\n\n return `\n${createImports(aspectDefs)}\n\nconst isBrowser = typeof window !== \"undefined\";\nconst config = JSON.parse('${stringifiedConfig}');\n${idSetters.join('\\n')}\nexport function render(...props){\n return Harmony.load([${identifiers.join(', ')}], '${runtime}', config)\n .then((harmony) => {\n return harmony\n .run()\n .then(() => harmony.get('${rootAspect}'))\n .then((rootExtension) => {\n const ssrSetup = !isBrowser && rootExtension.setupSsr;\n const setup = rootExtension.setup;\n const setupFunc = (ssrSetup || setup || function noop(){}).bind(rootExtension);\n\n return (\n Promise.resolve(setupFunc())\n .then(() => rootExtension)\n );\n })\n .then((rootExtension) => {\n if (isBrowser) {\n return rootExtension.render(${rootId}, ...props);\n } else {\n return rootExtension.renderSsr(${rootId}, ...props);\n }\n })\n .catch((err) => {\n throw err;\n });\n });\n}\n\nif (isBrowser) render();\n`;\n}\n\nfunction createImports(aspectDefs: AspectDefinition[]) {\n const defs = aspectDefs.filter((def) => def.runtimePath);\n\n return `import { Harmony } from '@teambit/harmony';\n${getImportStatements(aspectDefs, 'aspectPath', 'Aspect')}\n${getImportStatements(defs, 'runtimePath', 'Runtime')}`;\n}\n\nfunction getImportStatements(aspectDefs: AspectDefinition[], pathProp: string, suffix: string): string {\n return aspectDefs\n .map(\n (aspectDef) =>\n `import ${getIdentifier(aspectDef, suffix)} from '${toWindowsCompatiblePath(aspectDef[pathProp])}';`\n )\n .join('\\n');\n}\n\nfunction getIdentifiers(aspectDefs: AspectDefinition[], suffix: string): string[] {\n return aspectDefs.map((aspectDef) => `${getIdentifier(aspectDef, suffix)}`);\n}\n\nfunction getIdSetters(defs: AspectDefinition[], suffix: string) {\n return defs\n .map((def) => {\n if (!def.getId) return undefined;\n return `${getIdentifier(def, suffix)}.id = '${def.getId}';`;\n })\n .filter((val) => !!val);\n}\n\nfunction getIdentifier(aspectDef: AspectDefinition, suffix: string): string {\n if (!aspectDef.component && !aspectDef.local) {\n return getCoreIdentifier(aspectDef.aspectPath, suffix);\n }\n return getRegularAspectIdentifier(aspectDef, suffix);\n}\n\nfunction getRegularAspectIdentifier(aspectDef: AspectDefinition, suffix: string): string {\n return camelCase(`${parse(aspectDef.aspectPath).base.replace(/\\./, '__').replace('@', '__')}${suffix}`);\n}\n\nfunction getCoreIdentifier(path: string, suffix: string): string {\n return camelCase(`${parse(path).name.split('.')[0]}${suffix}`);\n}\n"],"mappings":";;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,eAAeA,UAAf,CACLC,UADK,EAELC,iBAFK,EAGLC,UAAU,GAAGC,cAAA,CAASC,EAHjB,EAILC,OAAO,GAAG,IAJL,EAKLC,MAAM,GAAG,EALJ,EAML;EACA,MAAMC,MAAM,GAAGN,iBAAiB,GAAI,IAAGA,iBAAkB,GAAzB,GAA8B,EAA9D;EACA,MAAMO,WAAW,GAAGC,cAAc,CAACT,UAAD,EAAa,QAAb,CAAlC;EAEA,MAAMU,SAAS,GAAGC,YAAY,CAACX,UAAD,EAAa,QAAb,CAA9B;EACAM,MAAM,CAAC,qBAAD,CAAN,GAAgCL,iBAAhC,CALA,CAMA;EACA;;EACA,MAAMW,iBAAiB,GAAG,IAAAC,sCAAA,EAAwBC,IAAI,CAACC,SAAL,CAAeT,MAAf,CAAxB,EAAgDU,OAAhD,CAAwD,IAAxD,EAA8D,KAA9D,CAA1B;EAEA,OAAQ;AACV,EAAEC,aAAa,CAACjB,UAAD,CAAa;AAC5B;AACA;AACA,6BAA6BY,iBAAkB;AAC/C,EAAEF,SAAS,CAACQ,IAAV,CAAe,IAAf,CAAqB;AACvB;AACA,yBAAyBV,WAAW,CAACU,IAAZ,CAAiB,IAAjB,CAAuB,OAAMb,OAAQ;AAC9D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MALI,CAKIW,GAAD,IAAS,CAAC,CAACA,GALd,CAAP;AAMD;;AAED,SAASH,aAAT,CAAuBD,SAAvB,EAAoDF,MAApD,EAA4E;EAC1E,IAAI,CAACE,SAAS,CAACK,SAAX,IAAwB,CAACL,SAAS,CAACM,KAAvC,EAA8C;IAC5C,OAAOC,iBAAiB,CAACP,SAAS,CAACQ,UAAX,EAAuBV,MAAvB,CAAxB;EACD;;EACD,OAAOW,0BAA0B,CAACT,SAAD,EAAYF,MAAZ,CAAjC;AACD;;AAED,SAASW,0BAAT,CAAoCT,SAApC,EAAiEF,MAAjE,EAAyF;EACvF,OAAO,IAAAY,mBAAA,EAAW,GAAE,IAAAC,aAAA,EAAMX,SAAS,CAACQ,UAAhB,EAA4BI,IAA5B,CAAiCvB,OAAjC,CAAyC,IAAzC,EAA+C,IAA/C,EAAqDA,OAArD,CAA6D,GAA7D,EAAkE,IAAlE,CAAwE,GAAES,MAAO,EAA9F,CAAP;AACD;;AAED,SAASS,iBAAT,CAA2BM,IAA3B,EAAyCf,MAAzC,EAAiE;EAC/D,OAAO,IAAAY,mBAAA,EAAW,GAAE,IAAAC,aAAA,EAAME,IAAN,EAAYC,IAAZ,CAAiBC,KAAjB,CAAuB,GAAvB,EAA4B,CAA5B,CAA+B,GAAEjB,MAAO,EAArD,CAAP;AACD"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.772",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/ui-foundation/ui",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.ui-foundation",
|
|
8
8
|
"name": "ui",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.772"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -51,29 +51,29 @@
|
|
|
51
51
|
"@teambit/base-ui.loaders.loader-ribbon": "1.0.0",
|
|
52
52
|
"@teambit/base-ui.theme.fonts.roboto": "1.0.0",
|
|
53
53
|
"@teambit/base-ui.theme.theme-provider": "1.0.1",
|
|
54
|
-
"@teambit/aspect-loader": "0.0.
|
|
54
|
+
"@teambit/aspect-loader": "0.0.772",
|
|
55
55
|
"@teambit/toolbox.path.to-windows-compatible-path": "0.0.483",
|
|
56
56
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.487",
|
|
57
57
|
"@teambit/bit-error": "0.0.394",
|
|
58
|
-
"@teambit/cli": "0.0.
|
|
59
|
-
"@teambit/logger": "0.0.
|
|
58
|
+
"@teambit/cli": "0.0.511",
|
|
59
|
+
"@teambit/logger": "0.0.604",
|
|
60
60
|
"@teambit/ui-foundation.cli.ui-server-console": "0.0.490",
|
|
61
|
-
"@teambit/bundler": "0.0.
|
|
62
|
-
"@teambit/component": "0.0.
|
|
63
|
-
"@teambit/express": "0.0.
|
|
64
|
-
"@teambit/graphql": "0.0.
|
|
61
|
+
"@teambit/bundler": "0.0.772",
|
|
62
|
+
"@teambit/component": "0.0.772",
|
|
63
|
+
"@teambit/express": "0.0.609",
|
|
64
|
+
"@teambit/graphql": "0.0.772",
|
|
65
65
|
"@teambit/toolbox.network.get-port": "0.0.113",
|
|
66
|
-
"@teambit/aspect": "0.0.
|
|
67
|
-
"@teambit/cache": "0.0.
|
|
68
|
-
"@teambit/pubsub": "0.0.
|
|
69
|
-
"@teambit/react-router": "0.0.
|
|
66
|
+
"@teambit/aspect": "0.0.772",
|
|
67
|
+
"@teambit/cache": "0.0.604",
|
|
68
|
+
"@teambit/pubsub": "0.0.772",
|
|
69
|
+
"@teambit/react-router": "0.0.772",
|
|
70
70
|
"@teambit/ui-foundation.ui.rendering.html": "0.0.69",
|
|
71
71
|
"@teambit/design.theme.icons-font": "2.0.5",
|
|
72
72
|
"@teambit/design.ui.tooltip": "0.0.352",
|
|
73
73
|
"@teambit/ui-foundation.ui.global-loader": "0.0.486",
|
|
74
74
|
"@teambit/webpack.modules.generate-style-loaders": "0.0.103",
|
|
75
75
|
"@teambit/webpack.modules.style-regexps": "0.0.132",
|
|
76
|
-
"@teambit/webpack": "0.0.
|
|
76
|
+
"@teambit/webpack": "0.0.772"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@types/lodash": "4.14.165",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"peerDependencies": {
|
|
96
96
|
"@apollo/client": "^3.0.0",
|
|
97
97
|
"react-router-dom": "^6.0.0",
|
|
98
|
-
"@teambit/legacy": "1.0.
|
|
98
|
+
"@teambit/legacy": "1.0.292",
|
|
99
99
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
100
100
|
"react": "^16.8.0 || ^17.0.0"
|
|
101
101
|
},
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"react": "-"
|
|
141
141
|
},
|
|
142
142
|
"peerDependencies": {
|
|
143
|
-
"@teambit/legacy": "1.0.
|
|
143
|
+
"@teambit/legacy": "1.0.292",
|
|
144
144
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
145
145
|
"react": "^16.8.0 || ^17.0.0"
|
|
146
146
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@0.0.772/dist/ui.composition.js'
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@0.0.772/dist/ui.docs.mdx'
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0]
|
|
Binary file
|