@operato/shell 1.0.6 → 1.0.14

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/package.json +10 -7
  3. package/src/actions/const.ts +8 -0
  4. package/src/actions/index.ts +1 -0
  5. package/src/actions/route.ts +1 -9
  6. package/src/app/app.ts +1 -2
  7. package/src/app/pages/page-view.ts +1 -1
  8. package/src/object-store.ts +173 -0
  9. package/src/reducers/route.ts +1 -1
  10. package/src/store.ts +2 -2
  11. package/dist/src/actions/app.d.ts +0 -11
  12. package/dist/src/actions/app.js +0 -12
  13. package/dist/src/actions/app.js.map +0 -1
  14. package/dist/src/actions/index.d.ts +0 -2
  15. package/dist/src/actions/index.js +0 -3
  16. package/dist/src/actions/index.js.map +0 -1
  17. package/dist/src/actions/route.d.ts +0 -26
  18. package/dist/src/actions/route.js +0 -82
  19. package/dist/src/actions/route.js.map +0 -1
  20. package/dist/src/app/app-style.d.ts +0 -1
  21. package/dist/src/app/app-style.js +0 -69
  22. package/dist/src/app/app-style.js.map +0 -1
  23. package/dist/src/app/app.d.ts +0 -1
  24. package/dist/src/app/app.js +0 -194
  25. package/dist/src/app/app.js.map +0 -1
  26. package/dist/src/app/pages/page-404.d.ts +0 -8
  27. package/dist/src/app/pages/page-404.js +0 -57
  28. package/dist/src/app/pages/page-404.js.map +0 -1
  29. package/dist/src/app/pages/page-view.d.ts +0 -16
  30. package/dist/src/app/pages/page-view.js +0 -131
  31. package/dist/src/app/pages/page-view.js.map +0 -1
  32. package/dist/src/entries/public/home.d.ts +0 -17
  33. package/dist/src/entries/public/home.js +0 -87
  34. package/dist/src/entries/public/home.js.map +0 -1
  35. package/dist/src/index.d.ts +0 -3
  36. package/dist/src/index.js.map +0 -1
  37. package/dist/src/reducers/app.d.ts +0 -36
  38. package/dist/src/reducers/app.js +0 -36
  39. package/dist/src/reducers/app.js.map +0 -1
  40. package/dist/src/reducers/route.d.ts +0 -16
  41. package/dist/src/reducers/route.js +0 -57
  42. package/dist/src/reducers/route.js.map +0 -1
  43. package/dist/src/store.d.ts +0 -6
  44. package/dist/src/store.js +0 -15
  45. package/dist/src/store.js.map +0 -1
  46. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,194 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { html, LitElement } from 'lit';
3
- import { customElement, state } from 'lit/decorators.js';
4
- import { connect } from 'pwa-helpers/connect-mixin.js';
5
- import { installRouter } from 'pwa-helpers/router.js';
6
- import { ScrollbarStyles } from '@operato/styles';
7
- import { getPathInfo } from '@operato/utils';
8
- import { UPDATE_CONTEXT_PATH, UPDATE_MODULES } from '../actions/app';
9
- import { navigateWithSilence, UPDATE_ACTIVE_PAGE } from '../actions/route';
10
- import { store } from '../store';
11
- import { AppStyle } from './app-style';
12
- let ThingsApp = class ThingsApp extends connect(store)(LitElement) {
13
- constructor() {
14
- super();
15
- this._pages = {};
16
- this._callbacks = [];
17
- this._modules = [];
18
- this._moduleInitialized = false;
19
- }
20
- render() {
21
- var params = this._params || {};
22
- var fullbleed = (this._context && this._context.fullbleed) || (params.fullbleed && params.fullbleed == 'Y');
23
- var widebleed = (this._context && this._context.widebleed) || (params.widebleed && params.widebleed == 'Y');
24
- return html `
25
- <ox-header-bar ?fullbleed=${fullbleed}></ox-header-bar>
26
-
27
- <ox-nav-bar ?fullbleed=${fullbleed || widebleed}></ox-nav-bar>
28
-
29
- <main></main>
30
-
31
- <ox-aside-bar ?fullbleed=${fullbleed || widebleed}></ox-aside-bar>
32
-
33
- <ox-footer-bar ?fullbleed=${fullbleed}></ox-footer-bar>
34
-
35
- <ox-snack-bar></ox-snack-bar>
36
- `;
37
- }
38
- connectedCallback() {
39
- super.connectedCallback();
40
- /* 모듈 임포트를 동적으로 처리한다. */
41
- import(
42
- /* webpackPrefetch: true */
43
- /* webpackPreload: true */
44
- /* webpackChunkName: "modules" */
45
- '../module-importer.import').then(module => {
46
- var modules = module.modules;
47
- /* lifecycle - bootstrapping */
48
- this.dispatchEvent(new Event('lifecycle-bootstrap-begin'));
49
- modules.forEach((m, idx) => {
50
- try {
51
- m.bootstrap && m.bootstrap();
52
- // console.info(`[${idx} BOOTSTRAPED - ${m.name}]`)
53
- }
54
- catch (e) {
55
- console.error(`[${idx} BOOTSTRAP ERROR -${m.name}]`, e);
56
- }
57
- });
58
- this.dispatchEvent(new Event('lifecycle-bootstrap-finish'));
59
- /* shouldUpdate를 활성화한다. */
60
- this._moduleInitialized = true;
61
- /* modules를 store에 dispatch 함으로써, update를 invoke 시킨다. */
62
- store.dispatch({
63
- type: UPDATE_MODULES,
64
- modules
65
- });
66
- installRouter((location, e) => {
67
- var { contextPath } = getPathInfo(location.pathname);
68
- if (this._contextPath !== contextPath) {
69
- store.dispatch({
70
- type: UPDATE_CONTEXT_PATH,
71
- contextPath
72
- });
73
- }
74
- store.dispatch(navigateWithSilence(location));
75
- this._callbacks &&
76
- this._callbacks.forEach(callback => {
77
- try {
78
- callback.call(this, location, e);
79
- }
80
- catch (ex) {
81
- console.error(ex);
82
- }
83
- });
84
- });
85
- });
86
- this.setBase();
87
- }
88
- routeToPage() {
89
- let activePages = this.renderRoot.querySelectorAll('main > .page[active]');
90
- activePages.forEach(page => {
91
- page.removeAttribute('active');
92
- });
93
- this._activePage = this.renderRoot.querySelector(`main > .page[data-page=${this._page}]`);
94
- if (!this._activePage) {
95
- /* 해당 route에 연결된 page가 없는 경우에 main 섹션에 해당 element를 추가해준다. */
96
- var tagname = this._pages[this._page];
97
- if (tagname) {
98
- var main = this.renderRoot.querySelector('main');
99
- var el = document.createElement(tagname);
100
- el.setAttribute('class', 'page');
101
- el.setAttribute('data-page', this._page);
102
- main === null || main === void 0 ? void 0 : main.appendChild(el);
103
- this._activePage = el;
104
- }
105
- }
106
- if (this._activePage) {
107
- this._activePage.setAttribute('active', true);
108
- this._activePage.setAttribute('context-path', this._contextPath);
109
- this._activePage.lifecycle = {
110
- ...(this._activePage.lifecycle || {}),
111
- active: true,
112
- params: this._params,
113
- resourceId: this._resourceId,
114
- page: this._page
115
- };
116
- }
117
- store.dispatch({
118
- type: UPDATE_ACTIVE_PAGE,
119
- activePage: this._activePage
120
- });
121
- }
122
- async updated(changes) {
123
- if (changes.has('_modules')) {
124
- this._readyPageList();
125
- }
126
- if (changes.has('_page') || changes.has('_resourceId') || changes.has('_params')) {
127
- this.routeToPage();
128
- }
129
- if (changes.has('_contextPath')) {
130
- this.setBase();
131
- }
132
- }
133
- shouldUpdate() {
134
- return this._moduleInitialized;
135
- }
136
- stateChanged(state) {
137
- this._page = state.route.page;
138
- this._params = state.route.params;
139
- this._resourceId = state.route.resourceId;
140
- this._callbacks = state.route.callbacks;
141
- this._context = state.route.context;
142
- this._modules = state.app.modules;
143
- this._contextPath = state.app.contextPath;
144
- }
145
- _readyPageList() {
146
- var reversedModules = [...this._modules].reverse();
147
- this._pages = {};
148
- /* 모듈 참조 순서 역순으로 page를 추가한다. (for overidable) */
149
- reversedModules.forEach(m => {
150
- m.routes &&
151
- m.routes.forEach((route) => {
152
- if (!this._pages[route.page]) {
153
- this._pages[route.page] = route.tagname;
154
- }
155
- });
156
- });
157
- }
158
- setBase() {
159
- var base = document.querySelector('base');
160
- base === null || base === void 0 ? void 0 : base.setAttribute('href', this._contextPath ? `${this._contextPath}/` : '/');
161
- }
162
- };
163
- ThingsApp.styles = [ScrollbarStyles, AppStyle];
164
- __decorate([
165
- state()
166
- ], ThingsApp.prototype, "_contextPath", void 0);
167
- __decorate([
168
- state()
169
- ], ThingsApp.prototype, "_page", void 0);
170
- __decorate([
171
- state()
172
- ], ThingsApp.prototype, "_pages", void 0);
173
- __decorate([
174
- state()
175
- ], ThingsApp.prototype, "_resourceId", void 0);
176
- __decorate([
177
- state()
178
- ], ThingsApp.prototype, "_params", void 0);
179
- __decorate([
180
- state()
181
- ], ThingsApp.prototype, "_callbacks", void 0);
182
- __decorate([
183
- state()
184
- ], ThingsApp.prototype, "_activePage", void 0);
185
- __decorate([
186
- state()
187
- ], ThingsApp.prototype, "_context", void 0);
188
- __decorate([
189
- state()
190
- ], ThingsApp.prototype, "_modules", void 0);
191
- ThingsApp = __decorate([
192
- customElement('things-app')
193
- ], ThingsApp);
194
- //# sourceMappingURL=app.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/app/app.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAGtC,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IAmChD;QACE,KAAK,EAAE,CAAA;QA/BA,WAAM,GAA+B,EAAE,CAAA;QAGvC,eAAU,GAAe,EAAE,CAAA;QAG3B,aAAQ,GAAe,EAAE,CAAA;QAElC,uBAAkB,GAAG,KAAK,CAAA;IAwB1B,CAAC;IAtBD,MAAM;QACJ,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAA;QAC/B,IAAI,SAAS,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS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AA;qBACxC;gBACH,CAAC,CAAC,CAAA;QACN,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO;QACL,IAAI,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QACzC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IAC/E,CAAC;CACF,CAAA;AA5LQ,gBAAM,GAAG,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;AAElC;IAAR,KAAK,EAAE;+CAAsB;AACrB;IAAR,KAAK,EAAE;wCAAe;AACd;IAAR,KAAK,EAAE;yCAAwC;AACvC;IAAR,KAAK,EAAE;8CAAqB;AACpB;IAAR,KAAK,EAAE;0CAAc;AACb;IAAR,KAAK,EAAE;6CAA4B;AAC3B;IAAR,KAAK,EAAE;8CAAiB;AAChB;IAAR,KAAK,EAAE;2CAAc;AACb;IAAR,KAAK,EAAE;2CAA0B;AAX9B,SAAS;IADd,aAAa,CAAC,YAAY,CAAC;GACtB,SAAS,CA6Ld","sourcesContent":["import { html, LitElement, PropertyValues } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\nimport { installRouter } from 'pwa-helpers/router.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\nimport { getPathInfo } from '@operato/utils'\n\nimport { UPDATE_CONTEXT_PATH, UPDATE_MODULES } from '../actions/app'\nimport { navigateWithSilence, UPDATE_ACTIVE_PAGE } from '../actions/route'\nimport { store } from '../store'\nimport { AppStyle } from './app-style'\n\n@customElement('things-app')\nclass ThingsApp extends connect(store)(LitElement) {\n static styles = [ScrollbarStyles, AppStyle]\n\n @state() _contextPath?: string\n @state() _page?: string\n @state() _pages: { [path: string]: string } = {}\n @state() _resourceId?: string\n @state() _params?: any\n @state() _callbacks: Array<any> = []\n @state() _activePage: any\n @state() _context: any\n @state() _modules: Array<any> = []\n\n _moduleInitialized = false\n\n render() {\n var params = this._params || {}\n var fullbleed = (this._context && this._context.fullbleed) || (params.fullbleed && params.fullbleed == 'Y')\n var widebleed = (this._context && this._context.widebleed) || (params.widebleed && params.widebleed == 'Y')\n\n return html`\n <ox-header-bar ?fullbleed=${fullbleed}></ox-header-bar>\n\n <ox-nav-bar ?fullbleed=${fullbleed || widebleed}></ox-nav-bar>\n\n <main></main>\n\n <ox-aside-bar ?fullbleed=${fullbleed || widebleed}></ox-aside-bar>\n\n <ox-footer-bar ?fullbleed=${fullbleed}></ox-footer-bar>\n\n <ox-snack-bar></ox-snack-bar>\n `\n }\n\n constructor() {\n super()\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n /* 모듈 임포트를 동적으로 처리한다. */\n import(\n /* webpackPrefetch: true */\n /* webpackPreload: true */\n /* webpackChunkName: \"modules\" */\n '../module-importer.import'\n ).then(module => {\n var modules: {\n name: string\n bootstrap: any\n }[] = module.modules\n\n /* lifecycle - bootstrapping */\n this.dispatchEvent(new Event('lifecycle-bootstrap-begin'))\n modules.forEach((m, idx) => {\n try {\n m.bootstrap && m.bootstrap()\n // console.info(`[${idx} BOOTSTRAPED - ${m.name}]`)\n } catch (e) {\n console.error(`[${idx} BOOTSTRAP ERROR -${m.name}]`, e)\n }\n })\n this.dispatchEvent(new Event('lifecycle-bootstrap-finish'))\n\n /* shouldUpdate를 활성화한다. */\n this._moduleInitialized = true\n\n /* modules를 store에 dispatch 함으로써, update를 invoke 시킨다. */\n store.dispatch({\n type: UPDATE_MODULES,\n modules\n })\n\n installRouter((location, e) => {\n var { contextPath } = getPathInfo(location.pathname)\n\n if (this._contextPath !== contextPath) {\n store.dispatch({\n type: UPDATE_CONTEXT_PATH,\n contextPath\n })\n }\n\n store.dispatch(navigateWithSilence(location) as any)\n this._callbacks &&\n this._callbacks.forEach(callback => {\n try {\n callback.call(this, location, e)\n } catch (ex) {\n console.error(ex)\n }\n })\n })\n })\n\n this.setBase()\n }\n\n routeToPage() {\n let activePages = this.renderRoot.querySelectorAll('main > .page[active]')\n activePages.forEach(page => {\n page.removeAttribute('active')\n })\n\n this._activePage = this.renderRoot.querySelector(`main > .page[data-page=${this._page}]`)\n\n if (!this._activePage) {\n /* 해당 route에 연결된 page가 없는 경우에 main 섹션에 해당 element를 추가해준다. */\n var tagname = this._pages[this._page!]\n if (tagname) {\n var main = this.renderRoot.querySelector('main')\n\n var el = document.createElement(tagname)\n el.setAttribute('class', 'page')\n el.setAttribute('data-page', this._page!)\n\n main?.appendChild(el)\n\n this._activePage = el\n }\n }\n\n if (this._activePage) {\n this._activePage.setAttribute('active', true)\n this._activePage.setAttribute('context-path', this._contextPath)\n this._activePage.lifecycle = {\n ...(this._activePage.lifecycle || {}),\n active: true,\n params: this._params,\n resourceId: this._resourceId,\n page: this._page\n }\n }\n\n store.dispatch({\n type: UPDATE_ACTIVE_PAGE,\n activePage: this._activePage\n })\n }\n\n async updated(changes: PropertyValues<this>) {\n if (changes.has('_modules')) {\n this._readyPageList()\n }\n\n if (changes.has('_page') || changes.has('_resourceId') || changes.has('_params')) {\n this.routeToPage()\n }\n\n if (changes.has('_contextPath')) {\n this.setBase()\n }\n }\n\n shouldUpdate() {\n return this._moduleInitialized\n }\n\n stateChanged(state: any) {\n this._page = state.route.page\n this._params = state.route.params\n this._resourceId = state.route.resourceId\n this._callbacks = state.route.callbacks\n this._context = state.route.context\n this._modules = state.app.modules\n this._contextPath = state.app.contextPath\n }\n\n _readyPageList() {\n var reversedModules = [...this._modules].reverse()\n this._pages = {}\n\n /* 모듈 참조 순서 역순으로 page를 추가한다. (for overidable) */\n reversedModules.forEach(m => {\n m.routes &&\n m.routes.forEach((route: any) => {\n if (!this._pages[route.page]) {\n this._pages[route.page] = route.tagname\n }\n })\n })\n }\n\n setBase() {\n var base = document.querySelector('base')\n base?.setAttribute('href', this._contextPath ? `${this._contextPath}/` : '/')\n }\n}\n"]}
@@ -1,8 +0,0 @@
1
- import { PageView } from './page-view';
2
- export declare class Page404 extends PageView {
3
- static styles: import("lit").CSSResult;
4
- get context(): {
5
- title: string;
6
- };
7
- render(): import("lit-html").TemplateResult<1>;
8
- }
@@ -1,57 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { css, html } from 'lit';
3
- import { customElement } from 'lit/decorators.js';
4
- import { PageView } from './page-view';
5
- let Page404 = class Page404 extends PageView {
6
- get context() {
7
- return {
8
- title: 'Page Not Found'
9
- };
10
- }
11
- render() {
12
- return html `
13
- <section>
14
- <mwc-icon>error_outline</mwc-icon>
15
- <h2>page not found!</h2>
16
- The page you requested cannot be found.
17
- </section>
18
- `;
19
- }
20
- };
21
- Page404.styles = css `
22
- :host {
23
- display: block;
24
- box-sizing: border-box;
25
- background-color: var(--main-section-background-color);
26
- --padding-wide: 15%;
27
- }
28
- section {
29
- padding: var(--padding-wide) 0 0 0;
30
- text-align: center;
31
- color: var(--secondary-color);
32
- }
33
- mwc-icon {
34
- --mdc-icon-size: 120px;
35
- color: var(--status-danger-color);
36
- text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.1);
37
- }
38
- h2 {
39
- margin: 0 auto;
40
- font-size: 2.5em;
41
- text-transform: capitalize;
42
- }
43
- @media only screen and (max-width: 460px) {
44
- mwc-icon {
45
- padding-top: 25%;
46
- --mdc-icon-size: 90px;
47
- }
48
- h2 {
49
- font-size: 2em;
50
- }
51
- }
52
- `;
53
- Page404 = __decorate([
54
- customElement('page-404')
55
- ], Page404);
56
- export { Page404 };
57
- //# sourceMappingURL=page-404.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-404.js","sourceRoot":"","sources":["../../../../src/app/pages/page-404.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAGtC,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,QAAQ;IAkCnC,IAAI,OAAO;QACT,OAAO;YACL,KAAK,EAAE,gBAAgB;SACxB,CAAA;IACH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;KAMV,CAAA;IACH,CAAC;CACF,CAAA;AAhDQ,cAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BlB,CAAA;AAhCU,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAiDnB;SAjDY,OAAO","sourcesContent":["import { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { PageView } from './page-view'\n\n@customElement('page-404')\nexport class Page404 extends PageView {\n static styles = css`\n :host {\n display: block;\n box-sizing: border-box;\n background-color: var(--main-section-background-color);\n --padding-wide: 15%;\n }\n section {\n padding: var(--padding-wide) 0 0 0;\n text-align: center;\n color: var(--secondary-color);\n }\n mwc-icon {\n --mdc-icon-size: 120px;\n color: var(--status-danger-color);\n text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.1);\n }\n h2 {\n margin: 0 auto;\n font-size: 2.5em;\n text-transform: capitalize;\n }\n @media only screen and (max-width: 460px) {\n mwc-icon {\n padding-top: 25%;\n --mdc-icon-size: 90px;\n }\n h2 {\n font-size: 2em;\n }\n }\n `\n\n get context() {\n return {\n title: 'Page Not Found'\n }\n }\n\n render() {\n return html`\n <section>\n <mwc-icon>error_outline</mwc-icon>\n <h2>page not found!</h2>\n The page you requested cannot be found.\n </section>\n `\n }\n}\n"]}
@@ -1,16 +0,0 @@
1
- import { LitElement, PropertyValues } from 'lit';
2
- export declare class PageView extends LitElement {
3
- shouldUpdate(changes: PropertyValues<this>): boolean;
4
- active: boolean;
5
- lifecycle: any;
6
- contextPath?: string;
7
- _oldLifecycleInfo$: any;
8
- pageUpdate(changes?: any, force?: boolean): Promise<void>;
9
- pageReset(): Promise<void>;
10
- pageDispose(): Promise<void>;
11
- pageInitialized(pageInfo: any): void;
12
- pageUpdated(changes: any, after: any, before: any): void;
13
- pageDisposed(pageInfo: any): void;
14
- updateContext(override?: any): void;
15
- get context(): {};
16
- }
@@ -1,131 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { LitElement } from 'lit';
3
- import { property } from 'lit/decorators.js';
4
- import isEqual from 'lodash-es/isEqual';
5
- import { UPDATE_CONTEXT } from '../../actions/route';
6
- import { store } from '../../store';
7
- function diff(after, before) {
8
- var changed = false;
9
- var changes = {};
10
- Object.getOwnPropertyNames(after).forEach(function (key) {
11
- let before_val = before[key];
12
- let after_val = after[key];
13
- if (!isEqual(before_val, after_val)) {
14
- changes[key] = after_val;
15
- changed = true;
16
- }
17
- });
18
- return changed && changes;
19
- }
20
- export class PageView extends LitElement {
21
- constructor() {
22
- super(...arguments);
23
- this.active = false;
24
- }
25
- // Only render this page if it's actually visible.
26
- shouldUpdate(changes) {
27
- var active = String(this.active) == 'true';
28
- var { active: oldActive = false } = this._oldLifecycleInfo$ || {};
29
- /*
30
- * page lifecycle
31
- * case 1. page가 새로 activate 되었다.
32
- * case 2. page가 active 상태에서 lifecycle 정보가 바뀌었다.
33
- **/
34
- if (active) {
35
- this.pageUpdate({
36
- active
37
- });
38
- }
39
- else if (oldActive) {
40
- this.pageUpdate({
41
- active
42
- });
43
- }
44
- return active;
45
- }
46
- /* lifecycle */
47
- async pageUpdate(changes = {}, force = false) {
48
- var before = this._oldLifecycleInfo$ || {};
49
- var after = {
50
- ...before,
51
- ...this.lifecycle,
52
- contextPath: this.contextPath,
53
- ...changes
54
- };
55
- if (!('initialized' in changes) && after.active && !before.initialized) {
56
- after.initialized = true;
57
- }
58
- if (force) {
59
- after.updated = Date.now();
60
- }
61
- var changed = diff(after, before);
62
- if (!changed) {
63
- return;
64
- }
65
- this._oldLifecycleInfo$ = after;
66
- /* page의 이미 초기화된 상태에서 contextPath가 바뀐다면, 무조건 page가 리셋되어야 한다. */
67
- if (before.initialized && changed.contextPath) {
68
- await this.pageReset();
69
- return;
70
- }
71
- if (changed.initialized) {
72
- await this.pageInitialized(after);
73
- }
74
- if ('initialized' in changed) {
75
- if (changed.initialized) {
76
- /*
77
- * 방금 초기화된 경우라면, 엘리먼트들이 만들어지지 않았을 가능성이 있으므로,
78
- * 다음 animationFrame에서 pageUpdated 콜백을 호출한다.
79
- */
80
- requestAnimationFrame(async () => {
81
- await this.pageUpdated(changed, after, before);
82
- /* active page인 경우에는, page Context 갱신도 필요할 것이다. */
83
- after.active && this.updateContext();
84
- });
85
- }
86
- else {
87
- await this.pageDisposed(after);
88
- }
89
- }
90
- else {
91
- await this.pageUpdated(changed, after, before);
92
- /* active page인 경우에는, page Context 갱신도 필요할 것이다. */
93
- after.active && this.updateContext();
94
- }
95
- }
96
- async pageReset() {
97
- var { initialized } = this._oldLifecycleInfo$ || {};
98
- if (initialized) {
99
- await this.pageDispose();
100
- await this.pageUpdate({}, true);
101
- }
102
- }
103
- async pageDispose() {
104
- await this.pageUpdate({
105
- initialized: false
106
- });
107
- }
108
- pageInitialized(pageInfo) { }
109
- pageUpdated(changes, after, before) { }
110
- pageDisposed(pageInfo) { }
111
- /* context */
112
- updateContext(override) {
113
- store.dispatch({
114
- type: UPDATE_CONTEXT,
115
- context: override ? { ...this.context, ...override } : this.context
116
- });
117
- }
118
- get context() {
119
- return {};
120
- }
121
- }
122
- __decorate([
123
- property({ type: Boolean })
124
- ], PageView.prototype, "active", void 0);
125
- __decorate([
126
- property({ type: Object })
127
- ], PageView.prototype, "lifecycle", void 0);
128
- __decorate([
129
- property({ type: String, attribute: 'context-path' })
130
- ], PageView.prototype, "contextPath", void 0);
131
- //# sourceMappingURL=page-view.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-view.js","sourceRoot":"","sources":["../../../../src/app/pages/page-view.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,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EAAE,CAAC;6CAAqB","sourcesContent":["import { LitElement, PropertyValues } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport isEqual from 'lodash-es/isEqual'\n\nimport { UPDATE_CONTEXT } from '../../actions/route'\nimport { store } from '../../store'\n\nfunction diff(after: any, before: any): any {\n var changed = false\n var changes: { [key: string]: any } = {}\n\n Object.getOwnPropertyNames(after).forEach(function (key) {\n let before_val = before[key]\n let after_val = after[key]\n\n if (!isEqual(before_val, after_val)) {\n changes[key] = after_val\n changed = true\n }\n })\n\n return changed && changes\n}\n\nexport class PageView extends LitElement {\n // Only render this page if it's actually visible.\n shouldUpdate(changes: PropertyValues<this>) {\n var active = String(this.active) == 'true'\n var { active: oldActive = false } = this._oldLifecycleInfo$ || {}\n\n /*\n * page lifecycle\n * case 1. page가 새로 activate 되었다.\n * case 2. page가 active 상태에서 lifecycle 정보가 바뀌었다.\n **/\n if (active) {\n this.pageUpdate({\n active\n })\n } else if (oldActive) {\n this.pageUpdate({\n active\n })\n }\n\n return active\n }\n\n @property({ type: Boolean }) active: boolean = false\n @property({ type: Object }) lifecycle: any\n @property({ type: String, attribute: 'context-path' }) contextPath?: string\n\n _oldLifecycleInfo$: any\n\n /* lifecycle */\n async pageUpdate(changes: any = {}, force: boolean = false) {\n var before = this._oldLifecycleInfo$ || {}\n\n var after = {\n ...before,\n ...this.lifecycle,\n contextPath: this.contextPath,\n ...changes\n }\n\n if (!('initialized' in changes) && after.active && !before.initialized) {\n after.initialized = true\n }\n\n if (force) {\n after.updated = Date.now()\n }\n\n var changed = diff(after, before)\n if (!changed) {\n return\n }\n\n this._oldLifecycleInfo$ = after\n\n /* page의 이미 초기화된 상태에서 contextPath가 바뀐다면, 무조건 page가 리셋되어야 한다. */\n if (before.initialized && changed.contextPath) {\n await this.pageReset()\n return\n }\n\n if (changed.initialized) {\n await this.pageInitialized(after)\n }\n\n if ('initialized' in changed) {\n if (changed.initialized) {\n /*\n * 방금 초기화된 경우라면, 엘리먼트들이 만들어지지 않았을 가능성이 있으므로,\n * 다음 animationFrame에서 pageUpdated 콜백을 호출한다.\n */\n requestAnimationFrame(async () => {\n await this.pageUpdated(changed, after, before)\n /* active page인 경우에는, page Context 갱신도 필요할 것이다. */\n after.active && this.updateContext()\n })\n } else {\n await this.pageDisposed(after)\n }\n } else {\n await this.pageUpdated(changed, after, before)\n /* active page인 경우에는, page Context 갱신도 필요할 것이다. */\n after.active && this.updateContext()\n }\n }\n\n async pageReset() {\n var { initialized } = this._oldLifecycleInfo$ || {}\n\n if (initialized) {\n await this.pageDispose()\n await this.pageUpdate({}, true)\n }\n }\n\n async pageDispose() {\n await this.pageUpdate({\n initialized: false\n })\n }\n\n pageInitialized(pageInfo: any) {}\n pageUpdated(changes: any, after: any, before: any) {}\n pageDisposed(pageInfo: any) {}\n\n /* context */\n updateContext(override?: any) {\n store.dispatch({\n type: UPDATE_CONTEXT,\n context: override ? { ...this.context, ...override } : this.context\n })\n }\n\n get context() {\n return {}\n }\n}\n"]}
@@ -1,17 +0,0 @@
1
- import '@material/mwc-icon-button';
2
- import '@material/mwc-button';
3
- import { LitElement } from 'lit';
4
- export declare class HomePage extends LitElement {
5
- static styles: import("lit").CSSResult;
6
- _applicationMeta?: {
7
- icon: string;
8
- title: string;
9
- description: string;
10
- };
11
- render(): import("lit-html").TemplateResult<1>;
12
- get applicationMeta(): {
13
- icon: string;
14
- title: string;
15
- description: string;
16
- };
17
- }
@@ -1,87 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import '@material/mwc-icon-button';
3
- import '@material/mwc-button';
4
- import { css, html, LitElement } from 'lit';
5
- import { customElement } from 'lit/decorators.js';
6
- let HomePage = class HomePage extends LitElement {
7
- render() {
8
- var { icon, title, description } = this.applicationMeta;
9
- return html `
10
- <mwc-icon-button home icon="home" @click=${() => (window.location.href = '/')}></mwc-icon-button>
11
-
12
- <div message>
13
- <strong>${title}</strong>
14
- ${description}
15
- <img src="/assets/images/home.png" />
16
- </div>
17
- `;
18
- }
19
- get applicationMeta() {
20
- if (!this._applicationMeta) {
21
- var iconLink = document.querySelector('link[rel="application-icon"]');
22
- var titleMeta = document.querySelector('meta[name="application-name"]');
23
- var descriptionMeta = document.querySelector('meta[name="application-description"]');
24
- this._applicationMeta = {
25
- icon: iconLink === null || iconLink === void 0 ? void 0 : iconLink.href,
26
- title: titleMeta ? titleMeta.content : 'Things Factory',
27
- description: descriptionMeta ? descriptionMeta.content : 'Reimagining Software'
28
- };
29
- }
30
- return this._applicationMeta;
31
- }
32
- };
33
- HomePage.styles = css `
34
- :host {
35
- background-color: var(--main-section-background-color);
36
-
37
- display: block;
38
- position: relative;
39
-
40
- --mdc-theme-primary: white;
41
- }
42
-
43
- [home] {
44
- position: absolute;
45
- left: 20px;
46
- top: 20px;
47
- font-size: 2em;
48
- color: white;
49
- }
50
-
51
- [message] {
52
- background-color: rgba(50, 66, 97, 0.8);
53
- padding: 60px 50px 0 50px;
54
- color: #fff;
55
- text-align: center;
56
- font-size: 20px;
57
- }
58
- [message] strong {
59
- display: block;
60
- font-size: 2.5rem;
61
- }
62
- [message] img {
63
- width: 450px;
64
- max-width: 90%;
65
- display: block;
66
- margin: auto;
67
- margin-top: 20px;
68
- }
69
-
70
- @media screen and (max-width: 480px) {
71
- [message] {
72
- padding: 60px 30px 0 30px;
73
- color: #fff;
74
- text-align: center;
75
- font-size: 15px;
76
- }
77
-
78
- [message] strong {
79
- font-size: 1.6rem;
80
- }
81
- }
82
- `;
83
- HomePage = __decorate([
84
- customElement('home-page')
85
- ], HomePage);
86
- export { HomePage };
87
- //# sourceMappingURL=home.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"home.js","sourceRoot":"","sources":["../../../../src/entries/public/home.ts"],"names":[],"mappings":";AAAA,OAAO,2BAA2B,CAAA;AAClC,OAAO,sBAAsB,CAAA;AAE7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGjD,IAAa,QAAQ,GAArB,MAAa,QAAS,SAAQ,UAAU;IA0DtC,MAAM;QACJ,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,eAAe,CAAA;QAEvD,OAAO,IAAI,CAAA;iDACkC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAC;;;kBAGjE,KAAK;UACb,WAAW;;;KAGhB,CAAA;IACH,CAAC;IAED,IAAI,eAAe;QACjB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC1B,IAAI,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,8BAA8B,CAAoB,CAAA;YACxF,IAAI,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,+BAA+B,CAAoB,CAAA;YAC1F,IAAI,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC,sCAAsC,CAAoB,CAAA;YAEvG,IAAI,CAAC,gBAAgB,GAAG;gBACtB,IAAI,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI;gBACpB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB;gBACvD,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB;aAChF,CAAA;SACF;QAED,OAAO,IAAI,CAAC,gBAAgB,CAAA;IAC9B,CAAC;CACF,CAAA;AAtFQ,eAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDlB,CAAA;AAlDU,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAuFpB;SAvFY,QAAQ","sourcesContent":["import '@material/mwc-icon-button'\nimport '@material/mwc-button'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('home-page')\nexport class HomePage extends LitElement {\n static styles = css`\n :host {\n background-color: var(--main-section-background-color);\n\n display: block;\n position: relative;\n\n --mdc-theme-primary: white;\n }\n\n [home] {\n position: absolute;\n left: 20px;\n top: 20px;\n font-size: 2em;\n color: white;\n }\n\n [message] {\n background-color: rgba(50, 66, 97, 0.8);\n padding: 60px 50px 0 50px;\n color: #fff;\n text-align: center;\n font-size: 20px;\n }\n [message] strong {\n display: block;\n font-size: 2.5rem;\n }\n [message] img {\n width: 450px;\n max-width: 90%;\n display: block;\n margin: auto;\n margin-top: 20px;\n }\n\n @media screen and (max-width: 480px) {\n [message] {\n padding: 60px 30px 0 30px;\n color: #fff;\n text-align: center;\n font-size: 15px;\n }\n\n [message] strong {\n font-size: 1.6rem;\n }\n }\n `\n\n _applicationMeta?: {\n icon: string\n title: string\n description: string\n }\n\n render() {\n var { icon, title, description } = this.applicationMeta\n\n return html`\n <mwc-icon-button home icon=\"home\" @click=${() => (window.location.href = '/')}></mwc-icon-button>\n\n <div message>\n <strong>${title}</strong>\n ${description}\n <img src=\"/assets/images/home.png\" />\n </div>\n `\n }\n\n get applicationMeta() {\n if (!this._applicationMeta) {\n var iconLink = document.querySelector('link[rel=\"application-icon\"]') as HTMLLinkElement\n var titleMeta = document.querySelector('meta[name=\"application-name\"]') as HTMLMetaElement\n var descriptionMeta = document.querySelector('meta[name=\"application-description\"]') as HTMLMetaElement\n\n this._applicationMeta = {\n icon: iconLink?.href,\n title: titleMeta ? titleMeta.content : 'Things Factory',\n description: descriptionMeta ? descriptionMeta.content : 'Reimagining Software'\n }\n }\n\n return this._applicationMeta\n }\n}\n"]}
@@ -1,3 +0,0 @@
1
- export * from './store';
2
- export * from './actions';
3
- export * from './app/pages/page-view';
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,uBAAuB,CAAA;AACrC,2HAA2H","sourcesContent":["export * from './store'\nexport * from './actions'\nexport * from './app/pages/page-view'\n// export * from './app/app' /* @operato/shell couldn't be used because the app has to handle A at the time of bundling. */\n"]}
@@ -1,36 +0,0 @@
1
- declare const app: (state: {
2
- baseUrl: string;
3
- contextPath: string;
4
- domains: {
5
- name: string;
6
- subdomain: string;
7
- }[];
8
- } | undefined, action: any) => {
9
- modules: any;
10
- baseUrl: string;
11
- contextPath: string;
12
- domains: {
13
- name: string;
14
- subdomain: string;
15
- }[];
16
- } | {
17
- baseUrl: any;
18
- contextPath: string;
19
- domains: {
20
- name: string;
21
- subdomain: string;
22
- }[];
23
- } | {
24
- contextPath: any;
25
- baseUrl: string;
26
- domains: {
27
- name: string;
28
- subdomain: string;
29
- }[];
30
- } | {
31
- domains: any;
32
- domain: any;
33
- baseUrl: string;
34
- contextPath: string;
35
- };
36
- export default app;
@@ -1,36 +0,0 @@
1
- import { getPathInfo } from '@operato/utils';
2
- import { SET_DOMAINS, UPDATE_BASE_URL, UPDATE_CONTEXT_PATH, UPDATE_MODULES } from '../actions/app.js';
3
- const INITIAL_STATE = {
4
- baseUrl: location.origin,
5
- contextPath: getPathInfo(location.pathname).contextPath,
6
- domains: []
7
- };
8
- const app = (state = INITIAL_STATE, action) => {
9
- switch (action.type) {
10
- case UPDATE_MODULES:
11
- return {
12
- ...state,
13
- modules: action.modules
14
- };
15
- case UPDATE_BASE_URL:
16
- return {
17
- ...state,
18
- baseUrl: action.baseUrl
19
- };
20
- case UPDATE_CONTEXT_PATH:
21
- return {
22
- ...state,
23
- contextPath: action.contextPath
24
- };
25
- case SET_DOMAINS:
26
- return {
27
- ...state,
28
- domains: action.domains,
29
- domain: action.domain
30
- };
31
- default:
32
- return state;
33
- }
34
- };
35
- export default app;
36
- //# sourceMappingURL=app.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/reducers/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAErG,MAAM,aAAa,GAOf;IACF,OAAO,EAAE,QAAQ,CAAC,MAAM;IACxB,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW;IACvD,OAAO,EAAE,EAAE;CACZ,CAAA;AAED,MAAM,GAAG,GAAG,CAAC,KAAK,GAAG,aAAa,EAAE,MAAW,EAAE,EAAE;IACjD,QAAQ,MAAM,CAAC,IAAI,EAAE;QACnB,KAAK,cAAc;YACjB,OAAO;gBACL,GAAG,KAAK;gBACR,OAAO,EAAE,MAAM,CAAC,OAAO;aACxB,CAAA;QACH,KAAK,eAAe;YAClB,OAAO;gBACL,GAAG,KAAK;gBACR,OAAO,EAAE,MAAM,CAAC,OAAO;aACxB,CAAA;QACH,KAAK,mBAAmB;YACtB,OAAO;gBACL,GAAG,KAAK;gBACR,WAAW,EAAE,MAAM,CAAC,WAAW;aAChC,CAAA;QAEH,KAAK,WAAW;YACd,OAAO;gBACL,GAAG,KAAK;gBACR,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAA;QAEH;YACE,OAAO,KAAK,CAAA;KACf;AACH,CAAC,CAAA;AAED,eAAe,GAAG,CAAA","sourcesContent":["import { getPathInfo } from '@operato/utils'\n\nimport { SET_DOMAINS, UPDATE_BASE_URL, UPDATE_CONTEXT_PATH, UPDATE_MODULES } from '../actions/app.js'\n\nconst INITIAL_STATE: {\n baseUrl: string\n contextPath: string\n domains: {\n name: string\n subdomain: string\n }[]\n} = {\n baseUrl: location.origin,\n contextPath: getPathInfo(location.pathname).contextPath,\n domains: []\n}\n\nconst app = (state = INITIAL_STATE, action: any) => {\n switch (action.type) {\n case UPDATE_MODULES:\n return {\n ...state,\n modules: action.modules\n }\n case UPDATE_BASE_URL:\n return {\n ...state,\n baseUrl: action.baseUrl\n }\n case UPDATE_CONTEXT_PATH:\n return {\n ...state,\n contextPath: action.contextPath\n }\n\n case SET_DOMAINS:\n return {\n ...state,\n domains: action.domains,\n domain: action.domain\n }\n\n default:\n return state\n }\n}\n\nexport default app\n"]}