@celljs/react 3.0.0
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/LICENSE +21 -0
- package/README.md +1 -0
- package/cell-cdn.yml +11 -0
- package/cell.yml +8 -0
- package/lib/browser/annotation/app.d.ts +3 -0
- package/lib/browser/annotation/app.d.ts.map +1 -0
- package/lib/browser/annotation/app.js +12 -0
- package/lib/browser/annotation/app.js.map +1 -0
- package/lib/browser/annotation/context.d.ts +3 -0
- package/lib/browser/annotation/context.d.ts.map +1 -0
- package/lib/browser/annotation/context.js +12 -0
- package/lib/browser/annotation/context.js.map +1 -0
- package/lib/browser/annotation/default-layout.d.ts +3 -0
- package/lib/browser/annotation/default-layout.d.ts.map +1 -0
- package/lib/browser/annotation/default-layout.js +12 -0
- package/lib/browser/annotation/default-layout.js.map +1 -0
- package/lib/browser/annotation/icon.d.ts +3 -0
- package/lib/browser/annotation/icon.d.ts.map +1 -0
- package/lib/browser/annotation/icon.js +12 -0
- package/lib/browser/annotation/icon.js.map +1 -0
- package/lib/browser/annotation/index.d.ts +9 -0
- package/lib/browser/annotation/index.d.ts.map +1 -0
- package/lib/browser/annotation/index.js +25 -0
- package/lib/browser/annotation/index.js.map +1 -0
- package/lib/browser/annotation/react-component.d.ts +4 -0
- package/lib/browser/annotation/react-component.d.ts.map +1 -0
- package/lib/browser/annotation/react-component.js +11 -0
- package/lib/browser/annotation/react-component.js.map +1 -0
- package/lib/browser/annotation/route.d.ts +3 -0
- package/lib/browser/annotation/route.d.ts.map +1 -0
- package/lib/browser/annotation/route.js +24 -0
- package/lib/browser/annotation/route.js.map +1 -0
- package/lib/browser/annotation/router.d.ts +3 -0
- package/lib/browser/annotation/router.d.ts.map +1 -0
- package/lib/browser/annotation/router.js +12 -0
- package/lib/browser/annotation/router.js.map +1 -0
- package/lib/browser/annotation/view.d.ts +3 -0
- package/lib/browser/annotation/view.d.ts.map +1 -0
- package/lib/browser/annotation/view.js +11 -0
- package/lib/browser/annotation/view.js.map +1 -0
- package/lib/browser/app/app-protocol.d.ts +2 -0
- package/lib/browser/app/app-protocol.d.ts.map +1 -0
- package/lib/browser/app/app-protocol.js +5 -0
- package/lib/browser/app/app-protocol.js.map +1 -0
- package/lib/browser/app/app.d.ts +9 -0
- package/lib/browser/app/app.d.ts.map +1 -0
- package/lib/browser/app/app.js +41 -0
- package/lib/browser/app/app.js.map +1 -0
- package/lib/browser/app/index.d.ts +3 -0
- package/lib/browser/app/index.d.ts.map +1 -0
- package/lib/browser/app/index.js +19 -0
- package/lib/browser/app/index.js.map +1 -0
- package/lib/browser/context/context-protocol.d.ts +6 -0
- package/lib/browser/context/context-protocol.d.ts.map +1 -0
- package/lib/browser/context/context-protocol.js +6 -0
- package/lib/browser/context/context-protocol.js.map +1 -0
- package/lib/browser/context/context-provider.d.ts +8 -0
- package/lib/browser/context/context-provider.d.ts.map +1 -0
- package/lib/browser/context/context-provider.js +35 -0
- package/lib/browser/context/context-provider.js.map +1 -0
- package/lib/browser/context/context.d.ts +10 -0
- package/lib/browser/context/context.d.ts.map +1 -0
- package/lib/browser/context/context.js +22 -0
- package/lib/browser/context/context.js.map +1 -0
- package/lib/browser/context/index.d.ts +4 -0
- package/lib/browser/context/index.d.ts.map +1 -0
- package/lib/browser/context/index.js +20 -0
- package/lib/browser/context/index.js.map +1 -0
- package/lib/browser/icon/icon-protocol.d.ts +7 -0
- package/lib/browser/icon/icon-protocol.d.ts.map +1 -0
- package/lib/browser/icon/icon-protocol.js +6 -0
- package/lib/browser/icon/icon-protocol.js.map +1 -0
- package/lib/browser/icon/icon.d.ts +2 -0
- package/lib/browser/icon/icon.d.ts.map +1 -0
- package/lib/browser/icon/icon.js +20 -0
- package/lib/browser/icon/icon.js.map +1 -0
- package/lib/browser/icon/index.d.ts +2 -0
- package/lib/browser/icon/index.d.ts.map +1 -0
- package/lib/browser/icon/index.js +18 -0
- package/lib/browser/icon/index.js.map +1 -0
- package/lib/browser/index.d.ts +12 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +28 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/layout/index.d.ts +3 -0
- package/lib/browser/layout/index.d.ts.map +1 -0
- package/lib/browser/layout/index.js +19 -0
- package/lib/browser/layout/index.js.map +1 -0
- package/lib/browser/layout/layout-protocol.d.ts +2 -0
- package/lib/browser/layout/layout-protocol.d.ts.map +1 -0
- package/lib/browser/layout/layout-protocol.js +5 -0
- package/lib/browser/layout/layout-protocol.js.map +1 -0
- package/lib/browser/layout/layout.d.ts +5 -0
- package/lib/browser/layout/layout.d.ts.map +1 -0
- package/lib/browser/layout/layout.js +22 -0
- package/lib/browser/layout/layout.js.map +1 -0
- package/lib/browser/locale/index.d.ts +3 -0
- package/lib/browser/locale/index.d.ts.map +1 -0
- package/lib/browser/locale/index.js +19 -0
- package/lib/browser/locale/index.js.map +1 -0
- package/lib/browser/locale/locale-context.d.ts +8 -0
- package/lib/browser/locale/locale-context.d.ts.map +1 -0
- package/lib/browser/locale/locale-context.js +38 -0
- package/lib/browser/locale/locale-context.js.map +1 -0
- package/lib/browser/locale/locale-protocol.d.ts +2 -0
- package/lib/browser/locale/locale-protocol.d.ts.map +1 -0
- package/lib/browser/locale/locale-protocol.js +5 -0
- package/lib/browser/locale/locale-protocol.js.map +1 -0
- package/lib/browser/module.d.ts +4 -0
- package/lib/browser/module.d.ts.map +1 -0
- package/lib/browser/module.js +6 -0
- package/lib/browser/module.js.map +1 -0
- package/lib/browser/resolver/index.d.ts +3 -0
- package/lib/browser/resolver/index.d.ts.map +1 -0
- package/lib/browser/resolver/index.js +19 -0
- package/lib/browser/resolver/index.js.map +1 -0
- package/lib/browser/resolver/path-resolver.d.ts +6 -0
- package/lib/browser/resolver/path-resolver.d.ts.map +1 -0
- package/lib/browser/resolver/path-resolver.js +28 -0
- package/lib/browser/resolver/path-resolver.js.map +1 -0
- package/lib/browser/resolver/resolver-protocol.d.ts +5 -0
- package/lib/browser/resolver/resolver-protocol.d.ts.map +1 -0
- package/lib/browser/resolver/resolver-protocol.js +5 -0
- package/lib/browser/resolver/resolver-protocol.js.map +1 -0
- package/lib/browser/router/index.d.ts +6 -0
- package/lib/browser/router/index.d.ts.map +1 -0
- package/lib/browser/router/index.js +22 -0
- package/lib/browser/router/index.js.map +1 -0
- package/lib/browser/router/route-metadata-converter-provider.d.ts +7 -0
- package/lib/browser/router/route-metadata-converter-provider.d.ts.map +1 -0
- package/lib/browser/router/route-metadata-converter-provider.js +35 -0
- package/lib/browser/router/route-metadata-converter-provider.js.map +1 -0
- package/lib/browser/router/route-metadata-converter.d.ts +11 -0
- package/lib/browser/router/route-metadata-converter.d.ts.map +1 -0
- package/lib/browser/router/route-metadata-converter.js +51 -0
- package/lib/browser/router/route-metadata-converter.js.map +1 -0
- package/lib/browser/router/route-metadata-provider.d.ts +10 -0
- package/lib/browser/router/route-metadata-provider.d.ts.map +1 -0
- package/lib/browser/router/route-metadata-provider.js +49 -0
- package/lib/browser/router/route-metadata-provider.js.map +1 -0
- package/lib/browser/router/router-protocol.d.ts +24 -0
- package/lib/browser/router/router-protocol.d.ts.map +1 -0
- package/lib/browser/router/router-protocol.js +9 -0
- package/lib/browser/router/router-protocol.js.map +1 -0
- package/lib/browser/router/router.d.ts +3 -0
- package/lib/browser/router/router.d.ts.map +1 -0
- package/lib/browser/router/router.js +53 -0
- package/lib/browser/router/router.js.map +1 -0
- package/lib/browser/shell/index.d.ts +2 -0
- package/lib/browser/shell/index.d.ts.map +1 -0
- package/lib/browser/shell/index.js +18 -0
- package/lib/browser/shell/index.js.map +1 -0
- package/lib/browser/shell/shell.d.ts +7 -0
- package/lib/browser/shell/shell.d.ts.map +1 -0
- package/lib/browser/shell/shell.js +31 -0
- package/lib/browser/shell/shell.js.map +1 -0
- package/lib/browser/slot/index.d.ts +2 -0
- package/lib/browser/slot/index.d.ts.map +1 -0
- package/lib/browser/slot/index.js +18 -0
- package/lib/browser/slot/index.js.map +1 -0
- package/lib/browser/slot/slot.d.ts +4 -0
- package/lib/browser/slot/slot.d.ts.map +1 -0
- package/lib/browser/slot/slot.js +20 -0
- package/lib/browser/slot/slot.js.map +1 -0
- package/lib/browser/widget/index.d.ts +2 -0
- package/lib/browser/widget/index.d.ts.map +1 -0
- package/lib/browser/widget/index.js +18 -0
- package/lib/browser/widget/index.js.map +1 -0
- package/lib/browser/widget/widget-factory.d.ts +6 -0
- package/lib/browser/widget/widget-factory.d.ts.map +1 -0
- package/lib/browser/widget/widget-factory.js +23 -0
- package/lib/browser/widget/widget-factory.js.map +1 -0
- package/lib/hooks/webpack.d.ts +4 -0
- package/lib/hooks/webpack.d.ts.map +1 -0
- package/lib/hooks/webpack.js +166 -0
- package/lib/hooks/webpack.js.map +1 -0
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.d.ts.map +1 -0
- package/lib/package.spec.js +4 -0
- package/lib/package.spec.js.map +1 -0
- package/package.json +65 -0
- package/src/browser/annotation/app.ts +10 -0
- package/src/browser/annotation/context.ts +10 -0
- package/src/browser/annotation/default-layout.ts +10 -0
- package/src/browser/annotation/icon.ts +10 -0
- package/src/browser/annotation/index.ts +8 -0
- package/src/browser/annotation/react-component.ts +9 -0
- package/src/browser/annotation/route.ts +19 -0
- package/src/browser/annotation/router.ts +10 -0
- package/src/browser/annotation/view.ts +8 -0
- package/src/browser/app/app-protocol.ts +1 -0
- package/src/browser/app/app.tsx +25 -0
- package/src/browser/app/index.ts +2 -0
- package/src/browser/context/context-protocol.ts +8 -0
- package/src/browser/context/context-provider.ts +21 -0
- package/src/browser/context/context.tsx +16 -0
- package/src/browser/context/index.ts +3 -0
- package/src/browser/icon/icon-protocol.ts +9 -0
- package/src/browser/icon/icon.tsx +19 -0
- package/src/browser/icon/index.ts +1 -0
- package/src/browser/index.ts +11 -0
- package/src/browser/layout/index.ts +2 -0
- package/src/browser/layout/layout-protocol.ts +1 -0
- package/src/browser/layout/layout.tsx +10 -0
- package/src/browser/locale/index.ts +2 -0
- package/src/browser/locale/locale-context.tsx +30 -0
- package/src/browser/locale/locale-protocol.ts +1 -0
- package/src/browser/module.ts +4 -0
- package/src/browser/resolver/index.ts +2 -0
- package/src/browser/resolver/path-resolver.ts +13 -0
- package/src/browser/resolver/resolver-protocol.ts +5 -0
- package/src/browser/router/index.ts +5 -0
- package/src/browser/router/route-metadata-converter-provider.ts +19 -0
- package/src/browser/router/route-metadata-converter.ts +34 -0
- package/src/browser/router/route-metadata-provider.tsx +39 -0
- package/src/browser/router/router-protocol.ts +28 -0
- package/src/browser/router/router.tsx +44 -0
- package/src/browser/shell/index.ts +1 -0
- package/src/browser/shell/shell.tsx +16 -0
- package/src/browser/slot/index.ts +1 -0
- package/src/browser/slot/slot.tsx +18 -0
- package/src/browser/widget/index.ts +1 -0
- package/src/browser/widget/widget-factory.ts +13 -0
- package/src/hooks/webpack.ts +243 -0
- package/src/package.spec.ts +4 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RouteMetadataProvider, RouteMetadata, RouteMetadataConverterProvider } from './router-protocol';
|
|
2
|
+
export declare class RouteMetadataProviderImpl implements RouteMetadataProvider {
|
|
3
|
+
protected prioritized: RouteMetadata[];
|
|
4
|
+
protected readonly routeMetadatas: RouteMetadata[];
|
|
5
|
+
protected readonly routeMetadataConverterProvider: RouteMetadataConverterProvider;
|
|
6
|
+
provide(): RouteMetadata[];
|
|
7
|
+
protected parseRouteMetadatas(): RouteMetadata[];
|
|
8
|
+
protected sort(list: RouteMetadata[]): RouteMetadata[];
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=route-metadata-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-metadata-provider.d.ts","sourceRoot":"","sources":["../../../src/browser/router/route-metadata-provider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,8BAA8B,EAAkB,MAAM,mBAAmB,CAAC;AAEzH,qBACa,yBAA0B,YAAW,qBAAqB;IAEnE,SAAS,CAAC,WAAW,EAAE,aAAa,EAAE,CAAC;IAGvC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,aAAa,EAAE,CAAC;IAGnD,SAAS,CAAC,QAAQ,CAAC,8BAA8B,EAAE,8BAA8B,CAAC;IAElF,OAAO,IAAI,aAAa,EAAE;IAO1B,SAAS,CAAC,mBAAmB,IAAI,aAAa,EAAE;IAchD,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,EAAE;CAGvC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RouteMetadataProviderImpl = void 0;
|
|
13
|
+
const core_1 = require("@celljs/core");
|
|
14
|
+
const router_protocol_1 = require("./router-protocol");
|
|
15
|
+
let RouteMetadataProviderImpl = class RouteMetadataProviderImpl {
|
|
16
|
+
provide() {
|
|
17
|
+
if (!this.prioritized) {
|
|
18
|
+
this.prioritized = this.parseRouteMetadatas();
|
|
19
|
+
}
|
|
20
|
+
return this.prioritized;
|
|
21
|
+
}
|
|
22
|
+
parseRouteMetadatas() {
|
|
23
|
+
const list = [];
|
|
24
|
+
for (const routeMetadata of this.routeMetadatas) {
|
|
25
|
+
let parsed = routeMetadata;
|
|
26
|
+
for (const converter of this.routeMetadataConverterProvider.provide()) {
|
|
27
|
+
parsed = converter.convert(parsed);
|
|
28
|
+
}
|
|
29
|
+
list.push(parsed);
|
|
30
|
+
}
|
|
31
|
+
return this.sort(list);
|
|
32
|
+
}
|
|
33
|
+
sort(list) {
|
|
34
|
+
return core_1.Prioritizeable.prioritizeAllSync(list).map(c => c.value);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, core_1.Autowired)(router_protocol_1.ROUTE_METADATA),
|
|
39
|
+
__metadata("design:type", Array)
|
|
40
|
+
], RouteMetadataProviderImpl.prototype, "routeMetadatas", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, core_1.Autowired)(router_protocol_1.RouteMetadataConverterProvider),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], RouteMetadataProviderImpl.prototype, "routeMetadataConverterProvider", void 0);
|
|
45
|
+
RouteMetadataProviderImpl = __decorate([
|
|
46
|
+
(0, core_1.Component)(router_protocol_1.RouteMetadataProvider)
|
|
47
|
+
], RouteMetadataProviderImpl);
|
|
48
|
+
exports.RouteMetadataProviderImpl = RouteMetadataProviderImpl;
|
|
49
|
+
//# sourceMappingURL=route-metadata-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-metadata-provider.js","sourceRoot":"","sources":["../../../src/browser/router/route-metadata-provider.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAoE;AACpE,uDAAyH;AAGlH,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAUlC,OAAO;QACH,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;SACjD;QACD,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAES,mBAAmB;QACzB,MAAM,IAAI,GAAoB,EAAE,CAAC;QACjC,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,cAAc,EAAE;YAC7C,IAAI,MAAM,GAAG,aAAa,CAAC;YAC3B,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,8BAA8B,CAAC,OAAO,EAAE,EAAE;gBACnE,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;aACtC;YACD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACrB;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE3B,CAAC;IAES,IAAI,CAAC,IAAqB;QAChC,OAAO,qBAAc,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACpE,CAAC;CACJ,CAAA;AA9BG;IAAC,IAAA,gBAAS,EAAC,gCAAc,CAAC;;iEACyB;AAEnD;IAAC,IAAA,gBAAS,EAAC,gDAA8B,CAAC;;iFACwC;AARzE,yBAAyB;IADrC,IAAA,gBAAS,EAAC,uCAAqB,CAAC;GACpB,yBAAyB,CAkCrC;AAlCY,8DAAyB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const ROUTER: unique symbol;
|
|
2
|
+
export declare const ROUTE_METADATA: unique symbol;
|
|
3
|
+
export declare const RouteMetadataProvider: unique symbol;
|
|
4
|
+
export declare const RouteMetadataConverter: unique symbol;
|
|
5
|
+
export declare const RouteMetadataConverterProvider: unique symbol;
|
|
6
|
+
export interface RouteMetadata {
|
|
7
|
+
caseSensitive?: boolean;
|
|
8
|
+
index?: boolean;
|
|
9
|
+
path?: string;
|
|
10
|
+
component?: React.ComponentType;
|
|
11
|
+
layout?: React.ComponentType;
|
|
12
|
+
priority?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface RouteMetadataConverter {
|
|
15
|
+
readonly priority: number;
|
|
16
|
+
convert(metadata: RouteMetadata): RouteMetadata;
|
|
17
|
+
}
|
|
18
|
+
export interface RouteMetadataConverterProvider {
|
|
19
|
+
provide(): RouteMetadataConverter[];
|
|
20
|
+
}
|
|
21
|
+
export interface RouteMetadataProvider {
|
|
22
|
+
provide(): RouteMetadata[];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=router-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router-protocol.d.ts","sourceRoot":"","sources":["../../../src/browser/router/router-protocol.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,eAAmB,CAAC;AACvC,eAAO,MAAM,cAAc,eAA2B,CAAC;AAEvD,eAAO,MAAM,qBAAqB,eAAkC,CAAC;AACrE,eAAO,MAAM,sBAAsB,eAAmC,CAAC;AACvE,eAAO,MAAM,8BAA8B,eAA2C,CAAC;AAEvF,MAAM,WAAW,aAAa;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,QAAQ,EAAE,aAAa,GAAG,aAAa,CAAC;CACnD;AAED,MAAM,WAAW,8BAA8B;IAC3C,OAAO,IAAI,sBAAsB,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,qBAAqB;IAClC,OAAO,IAAI,aAAa,EAAE,CAAC;CAC9B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RouteMetadataConverterProvider = exports.RouteMetadataConverter = exports.RouteMetadataProvider = exports.ROUTE_METADATA = exports.ROUTER = void 0;
|
|
4
|
+
exports.ROUTER = Symbol('Router');
|
|
5
|
+
exports.ROUTE_METADATA = Symbol('ROUTE_METADATA');
|
|
6
|
+
exports.RouteMetadataProvider = Symbol('RouteMetadataProvider');
|
|
7
|
+
exports.RouteMetadataConverter = Symbol('RouteMetadataConverter');
|
|
8
|
+
exports.RouteMetadataConverterProvider = Symbol('RouteMetadataConverterProvider');
|
|
9
|
+
//# sourceMappingURL=router-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router-protocol.js","sourceRoot":"","sources":["../../../src/browser/router/router-protocol.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAE1C,QAAA,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AACxD,QAAA,sBAAsB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAC1D,QAAA,8BAA8B,GAAG,MAAM,CAAC,gCAAgC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/browser/router/router.tsx"],"names":[],"mappings":"AA2CA,MAAM,CAAC,OAAO;CAAS"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const React = require("react");
|
|
10
|
+
const router_protocol_1 = require("./router-protocol");
|
|
11
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
12
|
+
const annotation_1 = require("../annotation");
|
|
13
|
+
const core_1 = require("@celljs/core");
|
|
14
|
+
const routerMap = {
|
|
15
|
+
browser: react_router_dom_1.BrowserRouter,
|
|
16
|
+
hash: react_router_dom_1.HashRouter
|
|
17
|
+
};
|
|
18
|
+
const RouteComponent = () => {
|
|
19
|
+
const element = (0, react_router_dom_1.useRoutes)(buildRoutes());
|
|
20
|
+
return element;
|
|
21
|
+
};
|
|
22
|
+
const RouterComponent = () => {
|
|
23
|
+
const routerType = core_1.ConfigUtil.get('cell.react.router.type');
|
|
24
|
+
return React.createElement(routerMap[routerType], {}, React.createElement(RouteComponent));
|
|
25
|
+
};
|
|
26
|
+
const buildRoutes = () => {
|
|
27
|
+
const routeMetadataProvider = core_1.ContainerUtil.get(router_protocol_1.RouteMetadataProvider);
|
|
28
|
+
return routeMetadataProvider.provide().map(metadata => {
|
|
29
|
+
// eslint-disable-next-line no-null/no-null
|
|
30
|
+
let element;
|
|
31
|
+
if (metadata.component) {
|
|
32
|
+
if (metadata.layout) {
|
|
33
|
+
element = React.createElement(metadata.layout, {}, React.createElement(metadata.component));
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
element = React.createElement(metadata.component);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
path: metadata.path,
|
|
41
|
+
index: metadata.index,
|
|
42
|
+
caseSensitive: metadata.caseSensitive,
|
|
43
|
+
element
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
let default_1 = class {
|
|
48
|
+
};
|
|
49
|
+
default_1 = __decorate([
|
|
50
|
+
(0, annotation_1.Router)(RouterComponent, false)
|
|
51
|
+
], default_1);
|
|
52
|
+
exports.default = default_1;
|
|
53
|
+
//# sourceMappingURL=router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../src/browser/router/router.tsx"],"names":[],"mappings":";;;;;;;;AAAA,+BAA+B;AAC/B,uDAA0D;AAC1D,uDAAqF;AACrF,8CAAuC;AACvC,uCAAyD;AAEzD,MAAM,SAAS,GAAG;IACd,OAAO,EAAE,gCAAa;IACtB,IAAI,EAAE,6BAAU;CACnB,CAAC;AAEF,MAAM,cAAc,GAAG,GAAG,EAAE;IACxB,MAAM,OAAO,GAAG,IAAA,4BAAS,EAAC,WAAW,EAAE,CAAC,CAAC;IACzC,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,GAAG,EAAE;IACzB,MAAM,UAAU,GAAG,iBAAU,CAAC,GAAG,CAAqB,wBAAwB,CAAC,CAAC;IAChF,OAAO,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC;AAC/F,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,GAAkB,EAAE;IACpC,MAAM,qBAAqB,GAAG,oBAAa,CAAC,GAAG,CAAwB,uCAAqB,CAAC,CAAC;IAC9F,OAAO,qBAAqB,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;QAClD,2CAA2C;QAC3C,IAAI,OAA+B,CAAC;QACpC,IAAI,QAAQ,CAAC,SAAS,EAAE;YACpB,IAAI,QAAQ,CAAC,MAAM,EAAE;gBACjB,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;aAC/F;iBAAM;gBACH,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;aACrD;SACJ;QACD,OAAO;YACH,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,aAAa,EAAE,QAAQ,CAAC,aAAa;YACrC,OAAO;SACV,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAGa,gBAAA;CAAQ,CAAA;AAAR;IADd,IAAA,mBAAM,EAAC,eAAe,EAAE,KAAK,CAAC;aACR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/shell/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./shell"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/browser/shell/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ApplicationShell } from '@celljs/core/lib/browser';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare class Shell implements ApplicationShell {
|
|
4
|
+
protected readonly app: React.ComponentType;
|
|
5
|
+
attach(host: HTMLElement): void;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/browser/shell/shell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,qBACa,KAAM,YAAW,gBAAgB;IAG1C,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5C,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;CAGlC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Shell = void 0;
|
|
13
|
+
const browser_1 = require("@celljs/core/lib/browser");
|
|
14
|
+
const core_1 = require("@celljs/core");
|
|
15
|
+
const client_1 = require("react-dom/client");
|
|
16
|
+
const React = require("react");
|
|
17
|
+
const app_1 = require("../app");
|
|
18
|
+
let Shell = class Shell {
|
|
19
|
+
attach(host) {
|
|
20
|
+
(0, client_1.createRoot)(host).render(React.createElement(this.app));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, core_1.Autowired)(app_1.APP),
|
|
25
|
+
__metadata("design:type", Object)
|
|
26
|
+
], Shell.prototype, "app", void 0);
|
|
27
|
+
Shell = __decorate([
|
|
28
|
+
(0, core_1.Component)({ id: browser_1.ApplicationShell, rebind: true })
|
|
29
|
+
], Shell);
|
|
30
|
+
exports.Shell = Shell;
|
|
31
|
+
//# sourceMappingURL=shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../../src/browser/shell/shell.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAA4D;AAC5D,uCAAoD;AACpD,6CAA8C;AAC9C,+BAA+B;AAC/B,gCAA6B;AAGtB,IAAM,KAAK,GAAX,MAAM,KAAK;IAKd,MAAM,CAAC,IAAiB;QACpB,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3D,CAAC;CACJ,CAAA;AANG;IAAC,IAAA,gBAAS,EAAC,SAAG,CAAC;;kCAC6B;AAHnC,KAAK;IADjB,IAAA,gBAAS,EAAC,EAAE,EAAE,EAAE,0BAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACrC,KAAK,CAQjB;AARY,sBAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/slot/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./slot"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/browser/slot/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../../src/browser/slot/slot.tsx"],"names":[],"mappings":"AAKA,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,eAY9C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Slot = void 0;
|
|
4
|
+
const core_1 = require("@celljs/core");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const widget_1 = require("@celljs/widget");
|
|
7
|
+
const { useState, useEffect } = React;
|
|
8
|
+
function Slot({ area }) {
|
|
9
|
+
const [nodes, setNodes] = useState([]);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const load = async () => {
|
|
12
|
+
const widgetManager = core_1.ContainerUtil.get(widget_1.WidgetManager);
|
|
13
|
+
setNodes(await widgetManager.render(area));
|
|
14
|
+
};
|
|
15
|
+
load();
|
|
16
|
+
}, [area]);
|
|
17
|
+
return (React.createElement(React.Fragment, null, nodes.map(n => n)));
|
|
18
|
+
}
|
|
19
|
+
exports.Slot = Slot;
|
|
20
|
+
//# sourceMappingURL=slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.js","sourceRoot":"","sources":["../../../src/browser/slot/slot.tsx"],"names":[],"mappings":";;;AAAA,uCAA6C;AAC7C,+BAA+B;AAC/B,2CAA+C;AAC/C,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;AAEtC,SAAgB,IAAI,CAAC,EAAE,IAAI,EAAoB;IAC3C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAoB,EAAE,CAAC,CAAC;IAE1D,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE;YACpB,MAAM,aAAa,GAAG,oBAAa,CAAC,GAAG,CAAiC,sBAAa,CAAC,CAAC;YACvF,QAAQ,CAAC,MAAM,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC;QACF,IAAI,EAAE,CAAC;IACX,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,CAAC,0CAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAI,CAAC,CAAC;AACtC,CAAC;AAZD,oBAYC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/widget/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./widget-factory"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/browser/widget/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AbstractWidgetFactory, WidgetModel } from '@celljs/widget';
|
|
3
|
+
export declare class DecoratorWidgetFactory extends AbstractWidgetFactory<React.ReactNode> {
|
|
4
|
+
protected doRender(widgetModel: WidgetModel): Promise<React.ReactNode>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=widget-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-factory.d.ts","sourceRoot":"","sources":["../../../src/browser/widget/widget-factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAiB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEnF,qBACa,sBAAuB,SAAQ,qBAAqB,CAAC,KAAK,CAAC,SAAS,CAAC;cAE9D,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;CAK/E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DecoratorWidgetFactory = void 0;
|
|
10
|
+
const core_1 = require("@celljs/core");
|
|
11
|
+
const React = require("react");
|
|
12
|
+
const widget_1 = require("@celljs/widget");
|
|
13
|
+
let DecoratorWidgetFactory = class DecoratorWidgetFactory extends widget_1.AbstractWidgetFactory {
|
|
14
|
+
async doRender(widgetModel) {
|
|
15
|
+
const component = widgetModel.matedata.component;
|
|
16
|
+
return React.createElement(component, Object.assign({ key: widgetModel.id }, widgetModel.props));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
DecoratorWidgetFactory = __decorate([
|
|
20
|
+
(0, core_1.Component)(widget_1.WidgetFactory)
|
|
21
|
+
], DecoratorWidgetFactory);
|
|
22
|
+
exports.DecoratorWidgetFactory = DecoratorWidgetFactory;
|
|
23
|
+
//# sourceMappingURL=widget-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-factory.js","sourceRoot":"","sources":["../../../src/browser/widget/widget-factory.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAyC;AACzC,+BAA+B;AAC/B,2CAAmF;AAG5E,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,8BAAsC;IAEpE,KAAK,CAAC,QAAQ,CAAC,WAAwB;QAC7C,MAAM,SAAS,GAAG,WAAW,CAAC,QAAS,CAAC,SAAS,CAAC;QAClD,OAAO,KAAK,CAAC,aAAa,CAAC,SAAS,kBAAK,GAAG,EAAE,WAAW,CAAC,EAAE,IAAM,WAAW,CAAC,KAAK,EAAG,CAAC;IAC3F,CAAC;CAEJ,CAAA;AAPY,sBAAsB;IADlC,IAAA,gBAAS,EAAC,sBAAa,CAAC;GACZ,sBAAsB,CAOlC;AAPY,wDAAsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../../src/hooks/webpack.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwB,MAAM,kDAAkD,CAAC;kCAoBzE,cAAc;AAA7C,wBA4NE"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fs = require("fs-extra");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const context_protocol_1 = require("@celljs/cli-service/lib/context/context-protocol");
|
|
6
|
+
const config_util_1 = require("@celljs/cli-common/lib/utils/config-util");
|
|
7
|
+
const findExisting = (context, files) => {
|
|
8
|
+
for (const file of files) {
|
|
9
|
+
if (fs.existsSync(path.join(context, file))) {
|
|
10
|
+
return file;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
exports.default = async (context) => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const { configurations, cfg, dev } = context;
|
|
17
|
+
const webpackConfig = context_protocol_1.ConfigurationContext.getFrontendConfiguration(configurations);
|
|
18
|
+
if (webpackConfig) {
|
|
19
|
+
const appRootDir = process.cwd();
|
|
20
|
+
const shadowMode = false;
|
|
21
|
+
const rootReactOptions = (_b = (_a = config_util_1.ConfigUtil.getFrontendCellConfig(cfg)) === null || _a === void 0 ? void 0 : _a.react) !== null && _b !== void 0 ? _b : {};
|
|
22
|
+
const defaultSassLoaderOptions = {
|
|
23
|
+
implementation: require('sass')
|
|
24
|
+
};
|
|
25
|
+
const css = rootReactOptions.css || {};
|
|
26
|
+
const { extract = !dev, sourceMap = false, loaderOptions = {} } = css;
|
|
27
|
+
let { requireModuleExtension } = css;
|
|
28
|
+
if (typeof requireModuleExtension === 'undefined') {
|
|
29
|
+
if (loaderOptions.css && loaderOptions.css.modules) {
|
|
30
|
+
throw new Error('`css.requireModuleExtension` is required when custom css modules options provided');
|
|
31
|
+
}
|
|
32
|
+
requireModuleExtension = true;
|
|
33
|
+
}
|
|
34
|
+
const { filenameHashing = true, productionSourceMap = true } = rootReactOptions;
|
|
35
|
+
const shouldExtract = extract !== false && !shadowMode;
|
|
36
|
+
const filename = `css/[name]${filenameHashing ? '.[contenthash:8]' : ''}.css`;
|
|
37
|
+
const cssPublicPath = './';
|
|
38
|
+
const extractOptions = Object.assign({
|
|
39
|
+
filename,
|
|
40
|
+
chunkFilename: filename,
|
|
41
|
+
}, extract && typeof extract === 'object' ? extract : {});
|
|
42
|
+
const hasPostCSSConfig = !!(loaderOptions.postcss ||
|
|
43
|
+
findExisting(appRootDir, [
|
|
44
|
+
'.postcssrc',
|
|
45
|
+
'.postcssrc.js',
|
|
46
|
+
'postcss.config.js',
|
|
47
|
+
'.postcssrc.yaml',
|
|
48
|
+
'.postcssrc.json',
|
|
49
|
+
]));
|
|
50
|
+
if (!hasPostCSSConfig) {
|
|
51
|
+
loaderOptions.postcss = {
|
|
52
|
+
postcssOptions: {
|
|
53
|
+
plugins: [require('autoprefixer')],
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// if building for production but not extracting CSS, we need to minimize
|
|
58
|
+
// the embbeded inline CSS as they will not be going through the optimizing
|
|
59
|
+
// plugin.
|
|
60
|
+
const needInlineMinification = !dev && !shouldExtract;
|
|
61
|
+
const cssnanoOptions = {
|
|
62
|
+
preset: [
|
|
63
|
+
'default',
|
|
64
|
+
{
|
|
65
|
+
mergeLonghand: false,
|
|
66
|
+
cssDeclarationSorter: false,
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
if (productionSourceMap && sourceMap) {
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
cssnanoOptions.map = { inline: false };
|
|
73
|
+
}
|
|
74
|
+
// @ts-ignore
|
|
75
|
+
function createCSSRule(lang, test, loader, options = {}) {
|
|
76
|
+
const baseRule = webpackConfig.module.rule(lang).test(test);
|
|
77
|
+
// rules for *.module.* files
|
|
78
|
+
const extModulesRule = baseRule
|
|
79
|
+
.oneOf('normal-modules')
|
|
80
|
+
.test(/\.module\.\w+$/);
|
|
81
|
+
applyLoaders(extModulesRule, true);
|
|
82
|
+
// rules for normal CSS imports
|
|
83
|
+
const normalRule = baseRule.oneOf('normal');
|
|
84
|
+
applyLoaders(normalRule, !requireModuleExtension);
|
|
85
|
+
function applyLoaders(rule, isCssModule) {
|
|
86
|
+
if (shouldExtract) {
|
|
87
|
+
rule.use('extract-css-loader')
|
|
88
|
+
.loader(require('mini-css-extract-plugin').loader)
|
|
89
|
+
.options({
|
|
90
|
+
publicPath: cssPublicPath,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
rule.use('style-loader')
|
|
95
|
+
.loader(require.resolve('style-loader'))
|
|
96
|
+
.options({
|
|
97
|
+
injectType: 'singletonStyleTag'
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
const cssLoaderOptions = Object.assign({
|
|
101
|
+
sourceMap,
|
|
102
|
+
importLoaders: 1 + // stylePostLoader injected by vue-loader
|
|
103
|
+
1 + // postcss-loader
|
|
104
|
+
(needInlineMinification ? 1 : 0),
|
|
105
|
+
}, loaderOptions.css);
|
|
106
|
+
if (isCssModule) {
|
|
107
|
+
cssLoaderOptions.modules = Object.assign({ localIdentName: '[name]_[local]_[hash:base64:5]' }, cssLoaderOptions.modules);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
delete cssLoaderOptions.modules;
|
|
111
|
+
}
|
|
112
|
+
rule.use('css-loader')
|
|
113
|
+
.loader(require.resolve('css-loader'))
|
|
114
|
+
.options(cssLoaderOptions);
|
|
115
|
+
if (needInlineMinification) {
|
|
116
|
+
rule.use('cssnano')
|
|
117
|
+
.loader(require.resolve('postcss-loader'))
|
|
118
|
+
.options({
|
|
119
|
+
sourceMap,
|
|
120
|
+
plugins: [require('cssnano')(cssnanoOptions)],
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
rule.use('postcss-loader')
|
|
124
|
+
.loader(require.resolve('postcss-loader'))
|
|
125
|
+
.options(Object.assign({ sourceMap }, loaderOptions.postcss));
|
|
126
|
+
if (loader) {
|
|
127
|
+
let resolvedLoader;
|
|
128
|
+
try {
|
|
129
|
+
resolvedLoader = require.resolve(loader);
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
resolvedLoader = loader;
|
|
133
|
+
}
|
|
134
|
+
rule.use(loader)
|
|
135
|
+
.loader(resolvedLoader)
|
|
136
|
+
.options(Object.assign({ sourceMap }, options));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
createCSSRule('css', /\.css$/);
|
|
141
|
+
createCSSRule('postcss', /\.p(ost)?css$/);
|
|
142
|
+
createCSSRule('scss', /\.scss$/, 'sass-loader', Object.assign({}, defaultSassLoaderOptions, loaderOptions.scss || loaderOptions.sass));
|
|
143
|
+
createCSSRule('sass', /\.sass$/, 'sass-loader', Object.assign({}, defaultSassLoaderOptions, loaderOptions.sass, {
|
|
144
|
+
sassOptions: Object.assign({}, loaderOptions.sass &&
|
|
145
|
+
loaderOptions.sass.sassOptions, {
|
|
146
|
+
indentedSyntax: true,
|
|
147
|
+
}),
|
|
148
|
+
}));
|
|
149
|
+
createCSSRule('less', /\.less$/, 'less-loader', loaderOptions.less);
|
|
150
|
+
createCSSRule('stylus', /\.styl(us)?$/, 'stylus-loader', Object.assign({
|
|
151
|
+
preferPathResolver: 'webpack',
|
|
152
|
+
}, loaderOptions.stylus));
|
|
153
|
+
// inject CSS extraction plugin
|
|
154
|
+
if (shouldExtract) {
|
|
155
|
+
webpackConfig
|
|
156
|
+
.plugin('extract-css')
|
|
157
|
+
.use(require('mini-css-extract-plugin'), [extractOptions]);
|
|
158
|
+
// minify extracted CSS
|
|
159
|
+
webpackConfig
|
|
160
|
+
.optimization
|
|
161
|
+
.minimizer('optimize-css')
|
|
162
|
+
.use(require('css-minimizer-webpack-plugin'));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
//# sourceMappingURL=webpack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpack.js","sourceRoot":"","sources":["../../src/hooks/webpack.ts"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,6BAA6B;AAC7B,uFAAwG;AACxG,0EAAsE;AAWtE,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,KAAe,EAAE,EAAE;IACtD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE;YACzC,OAAO,IAAI,CAAC;SACf;KACJ;AACL,CAAC,CAAC;AAEF,kBAAe,KAAK,EAAE,OAAuB,EAAE,EAAE;;IAC7C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AI,CAAC,WAAW,EAC9B;gBACI,cAAc,EAAE,IAAI;aACvB,CACJ;SACJ,CACJ,CACJ,CAAC;QACF,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;QACpE,aAAa,CACT,QAAQ,EACR,cAAc,EACd,eAAe,EACf,MAAM,CAAC,MAAM,CACT;YACI,kBAAkB,EAAE,SAAS;SAChC,EACD,aAAa,CAAC,MAAM,CACvB,CACJ,CAAC;QAEF,+BAA+B;QAC/B,IAAI,aAAa,EAAE;YACf,aAAa;iBACR,MAAM,CAAC,aAAa,CAAC;iBACrB,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;YAE/D,uBAAuB;YACvB,aAAa;iBACJ,YAAY;iBACR,SAAS,CAAC,cAAc,CAAC;iBACrB,GAAG,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC,CAAC;SACjE;KACJ;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=package.spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.spec.d.ts","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":"AAAA,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAE3B,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC"}
|