Skip to content

Commit

Permalink
Layout v2 (#579)
Browse files Browse the repository at this point in the history
* mlc-url renewed and mlc-config removed

* mlc-url restyle + mlc-loading-animation behavior change
mlc-loading-animation was removed

* fix to `mlc-loading-animation` test: display style restoration is now asynchronous
  • Loading branch information
amountainram committed Feb 9, 2023
1 parent f4b3667 commit a45f0d1
Show file tree
Hide file tree
Showing 21 changed files with 159 additions and 931 deletions.
4 changes: 4 additions & 0 deletions packages/composer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added

- refactor to `premount` API in order to better follow the promise lifecycle

## [2.0.1] - 2023-01-12

### Added
Expand Down
7 changes: 4 additions & 3 deletions packages/composer/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export async function premount(
): Promise<ResolvedConfig> {
let uris: string[] = []
let importmap: ImportMap | undefined
let done: Promise<unknown> = Promise.resolve()

if (config.sources) {
const { sources } = config
Expand All @@ -86,16 +87,16 @@ export async function premount(
uris = parseSources(sources)

if (uris.length > 0) {
await Promise.all(uris.map(
done = Promise.all(uris.map(
(uri) => (proxyWindow.importShim(uri)).catch(reporter)
))
}
}

return Promise.resolve({
return done.then(() => ({
...config,
sources: { importmap, uris },
})
}))
}

export async function render(
Expand Down
5 changes: 0 additions & 5 deletions packages/layout/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const rollupNodePolyFill = require('rollup-plugin-node-polyfills')
const {mergeConfig} = require('vite')
const {default: tsconfigPaths} = require('vite-tsconfig-paths')
const {default: dynamicImport} = require('vite-plugin-dynamic-import')
const {default: monacoEditorPlugin} = require('vite-plugin-monaco-editor')
const {replaceCodePlugin} = require('vite-plugin-replace')
const {default: postcssAntDynamicTheme} = require('@micro-lc/interfaces/postcss-ant-dynamic-theme')

Expand Down Expand Up @@ -31,10 +30,6 @@ module.exports = {
},
]
}),
monacoEditorPlugin({
customWorkers: [{ entry: require.resolve('monaco-yaml/yaml.worker'), label: 'yaml' }],
languageWorkers: ['editorWorkerService', 'json'],
}),
],
css: {
preprocessorOptions: {
Expand Down
9 changes: 9 additions & 0 deletions packages/layout/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### BREAKING CHANGES

- `mlc-config` has been **removed**
- `mlc-loading-animation` unloads only when all children fired an `onload` event

### Added

- `mlc-url` restyle and support to back button

## [1.0.1] - 2023-02-09

### Fixed
Expand Down
5 changes: 0 additions & 5 deletions packages/layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@
"@ctrl/tinycolor": "^3.5.0",
"@micro-lc/iconic": "workspace:*",
"antd": "^4.24.7",
"js-yaml": "^4.1.0",
"lit": "^2.5.0",
"monaco-editor": "^0.34.1",
"monaco-yaml": "^4.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down Expand Up @@ -87,7 +84,6 @@
"@storybook/web-components": "^6.5.15",
"@types/babel__core": "^7.1.20",
"@types/glob": "^8.0.0",
"@types/js-yaml": "^4.0.5",
"@types/json-schema": "^7.0.11",
"@types/lodash-es": "^4.17.6",
"@types/mocha": "^10.0.1",
Expand All @@ -114,7 +110,6 @@
"vite": "^4.0.4",
"vite-plugin-banner": "^0.7.0",
"vite-plugin-dynamic-import": "^1.2.4",
"vite-plugin-monaco-editor": "^1.1.0",
"vite-plugin-replace": "^0.1.1",
"vite-tsconfig-paths": "^4.0.3"
},
Expand Down
1 change: 0 additions & 1 deletion packages/layout/src/web-components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
limitations under the License.
*/
export * from './mlc-antd-theme-manager'
export * from './mlc-config'
export * from './mlc-layout'
export * from './mlc-loading-animation'
export * from './mlc-url'
Expand Down
20 changes: 0 additions & 20 deletions packages/layout/src/web-components/mlc-config/index.ts

This file was deleted.

43 changes: 0 additions & 43 deletions packages/layout/src/web-components/mlc-config/mlc-config.css

This file was deleted.

Loading

0 comments on commit a45f0d1

Please sign in to comment.