@operato/shell 0.3.7

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 (62) hide show
  1. package/.editorconfig +29 -0
  2. package/.storybook/main.js +3 -0
  3. package/.storybook/server.mjs +8 -0
  4. package/@types/global/index.d.ts +1 -0
  5. package/CHANGELOG.md +235 -0
  6. package/LICENSE +21 -0
  7. package/README.md +75 -0
  8. package/demo/index.html +33 -0
  9. package/dist/src/actions/app.d.ts +11 -0
  10. package/dist/src/actions/app.js +12 -0
  11. package/dist/src/actions/app.js.map +1 -0
  12. package/dist/src/actions/index.d.ts +2 -0
  13. package/dist/src/actions/index.js +3 -0
  14. package/dist/src/actions/index.js.map +1 -0
  15. package/dist/src/actions/route.d.ts +26 -0
  16. package/dist/src/actions/route.js +76 -0
  17. package/dist/src/actions/route.js.map +1 -0
  18. package/dist/src/app/app-style.d.ts +1 -0
  19. package/dist/src/app/app-style.js +68 -0
  20. package/dist/src/app/app-style.js.map +1 -0
  21. package/dist/src/app/app.d.ts +1 -0
  22. package/dist/src/app/app.js +192 -0
  23. package/dist/src/app/app.js.map +1 -0
  24. package/dist/src/app/pages/page-404.d.ts +1 -0
  25. package/dist/src/app/pages/page-404.js +52 -0
  26. package/dist/src/app/pages/page-404.js.map +1 -0
  27. package/dist/src/app/pages/page-view.d.ts +16 -0
  28. package/dist/src/app/pages/page-view.js +131 -0
  29. package/dist/src/app/pages/page-view.js.map +1 -0
  30. package/dist/src/entries/public/home.d.ts +17 -0
  31. package/dist/src/entries/public/home.js +87 -0
  32. package/dist/src/entries/public/home.js.map +1 -0
  33. package/dist/src/index.d.ts +0 -0
  34. package/dist/src/index.js +2 -0
  35. package/dist/src/index.js.map +1 -0
  36. package/dist/src/reducers/app.d.ts +36 -0
  37. package/dist/src/reducers/app.js +36 -0
  38. package/dist/src/reducers/app.js.map +1 -0
  39. package/dist/src/reducers/route.d.ts +16 -0
  40. package/dist/src/reducers/route.js +57 -0
  41. package/dist/src/reducers/route.js.map +1 -0
  42. package/dist/src/store.d.ts +4 -0
  43. package/dist/src/store.js +16 -0
  44. package/dist/src/store.js.map +1 -0
  45. package/dist/tsconfig.tsbuildinfo +1 -0
  46. package/package.json +78 -0
  47. package/src/actions/app.ts +23 -0
  48. package/src/actions/index.ts +2 -0
  49. package/src/actions/route.ts +94 -0
  50. package/src/app/app-style.ts +68 -0
  51. package/src/app/app.ts +205 -0
  52. package/src/app/pages/page-404.ts +56 -0
  53. package/src/app/pages/page-view.ts +142 -0
  54. package/src/entries/public/home.ts +95 -0
  55. package/src/index.ts +0 -0
  56. package/src/module-importer.import +0 -0
  57. package/src/reducers/app.ts +48 -0
  58. package/src/reducers/route.ts +77 -0
  59. package/src/store.ts +26 -0
  60. package/tsconfig.json +23 -0
  61. package/web-dev-server.config.mjs +27 -0
  62. package/web-test-runner.config.mjs +41 -0
package/.editorconfig ADDED
@@ -0,0 +1,29 @@
1
+ # EditorConfig helps developers define and maintain consistent
2
+ # coding styles between different editors and IDEs
3
+ # editorconfig.org
4
+
5
+ root = true
6
+
7
+
8
+ [*]
9
+
10
+ # Change these settings to your own preference
11
+ indent_style = space
12
+ indent_size = 2
13
+
14
+ # We recommend you to keep these unchanged
15
+ end_of_line = lf
16
+ charset = utf-8
17
+ trim_trailing_whitespace = true
18
+ insert_final_newline = true
19
+
20
+ [*.md]
21
+ trim_trailing_whitespace = false
22
+
23
+ [*.json]
24
+ indent_size = 2
25
+
26
+ [*.{html,js,md}]
27
+ block_comment_start = /**
28
+ block_comment = *
29
+ block_comment_end = */
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ stories: ['../dist/stories/**/*.stories.{js,md,mdx}'],
3
+ };
@@ -0,0 +1,8 @@
1
+ import { storybookPlugin } from '@web/dev-server-storybook';
2
+ import baseConfig from '../web-dev-server.config.mjs';
3
+
4
+ export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
5
+ ...baseConfig,
6
+ open: '/',
7
+ plugins: [storybookPlugin({ type: 'web-components' }), ...baseConfig.plugins],
8
+ });
@@ -0,0 +1 @@
1
+ declare module '*.import'
package/CHANGELOG.md ADDED
@@ -0,0 +1,235 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ### [0.3.7](https://github.com/hatiolab/operato/compare/v0.3.6...v0.3.7) (2022-01-09)
7
+
8
+ **Note:** Version bump only for package @operato/shell
9
+
10
+
11
+
12
+
13
+
14
+ ### [0.3.6](https://github.com/hatiolab/operato/compare/v0.3.5...v0.3.6) (2022-01-09)
15
+
16
+ **Note:** Version bump only for package @operato/shell
17
+
18
+
19
+
20
+
21
+
22
+ ### [0.3.5](https://github.com/hatiolab/operato/compare/v0.3.4...v0.3.5) (2022-01-09)
23
+
24
+
25
+ ### :rocket: New Features
26
+
27
+ * data-grist filter-form support queryFilters property ([e477ede](https://github.com/hatiolab/operato/commit/e477ede184dac7bc6c40d4aab73c2f8156edaef6))
28
+
29
+
30
+
31
+ ### [0.3.4](https://github.com/hatiolab/operato/compare/v0.3.3...v0.3.4) (2022-01-03)
32
+
33
+ **Note:** Version bump only for package @operato/shell
34
+
35
+ ### [0.3.3](https://github.com/hatiolab/operato/compare/v0.3.2...v0.3.3) (2022-01-03)
36
+
37
+ **Note:** Version bump only for package @operato/shell
38
+
39
+ ### [0.3.2](https://github.com/hatiolab/operato/compare/v0.3.1...v0.3.2) (2022-01-03)
40
+
41
+ **Note:** Version bump only for package @operato/shell
42
+
43
+ ### [0.3.1](https://github.com/hatiolab/operato/compare/v0.3.0...v0.3.1) (2021-12-31)
44
+
45
+ **Note:** Version bump only for package @operato/shell
46
+
47
+ ## [0.3.0](https://github.com/hatiolab/operato/compare/v0.2.52...v0.3.0) (2021-12-31)
48
+
49
+ ### :bug: Bug Fix
50
+
51
+ - grist card-gutter-menu shell style ([d0b97f5](https://github.com/hatiolab/operato/commit/d0b97f5483f93d95df058facc673a6fdd30e897b))
52
+ - shell style ([2372729](https://github.com/hatiolab/operato/commit/23727297c8fe98267846bc3d6595238cb1f9e76b))
53
+
54
+ ### :rocket: New Features
55
+
56
+ - add tsconfig option useDefineForClassFields ([6291438](https://github.com/hatiolab/operato/commit/6291438571eee0f095064e7d2ada1c620832e092))
57
+
58
+ ### [0.2.52](https://github.com/hatiolab/operato/compare/v0.2.51...v0.2.52) (2021-12-21)
59
+
60
+ ### :bug: Bug Fix
61
+
62
+ - upgrade dependencies ([3fde5e7](https://github.com/hatiolab/operato/commit/3fde5e7182bb4b502103bcb70de2f1bfab2bc1ff))
63
+
64
+ ### [0.2.51](https://github.com/hatiolab/operato/compare/v0.2.50...v0.2.51) (2021-12-16)
65
+
66
+ **Note:** Version bump only for package @operato/shell
67
+
68
+ ### [0.2.50](https://github.com/hatiolab/operato/compare/v0.2.49...v0.2.50) (2021-12-16)
69
+
70
+ **Note:** Version bump only for package @operato/shell
71
+
72
+ ### [0.2.49](https://github.com/hatiolab/operato/compare/v0.2.48...v0.2.49) (2021-12-14)
73
+
74
+ **Note:** Version bump only for package @operato/shell
75
+
76
+ ### [0.2.48](https://github.com/hatiolab/operato/compare/v0.2.47...v0.2.48) (2021-12-14)
77
+
78
+ **Note:** Version bump only for package @operato/shell
79
+
80
+ ### [0.2.47](https://github.com/hatiolab/operato/compare/v0.2.46...v0.2.47) (2021-12-13)
81
+
82
+ **Note:** Version bump only for package @operato/shell
83
+
84
+ ### [0.2.46](https://github.com/hatiolab/operato/compare/v0.2.45...v0.2.46) (2021-12-12)
85
+
86
+ **Note:** Version bump only for package @operato/shell
87
+
88
+ ### [0.2.45](https://github.com/hatiolab/operato/compare/v0.2.44...v0.2.45) (2021-12-11)
89
+
90
+ **Note:** Version bump only for package @operato/shell
91
+
92
+ ### [0.2.44](https://github.com/hatiolab/operato/compare/v0.2.43...v0.2.44) (2021-12-09)
93
+
94
+ ### :bug: Bug Fix
95
+
96
+ - filter style ([65eb5ec](https://github.com/hatiolab/operato/commit/65eb5ec87645719b6b797d6592a9436a6cffe569))
97
+
98
+ ### [0.2.43](https://github.com/hatiolab/operato/compare/v0.2.42...v0.2.43) (2021-12-08)
99
+
100
+ **Note:** Version bump only for package @operato/shell
101
+
102
+ ### [0.2.42](https://github.com/hatiolab/operato/compare/v0.2.41...v0.2.42) (2021-12-07)
103
+
104
+ **Note:** Version bump only for package @operato/shell
105
+
106
+ ### [0.2.41](https://github.com/hatiolab/operato/compare/v0.2.40...v0.2.41) (2021-12-07)
107
+
108
+ ### :bug: Bug Fix
109
+
110
+ - shell and input style ([11c5b3e](https://github.com/hatiolab/operato/commit/11c5b3e4bf3f08d18673ada585e50a69b9c88b5b))
111
+ - shell style ([43ee008](https://github.com/hatiolab/operato/commit/43ee008afbbd817bb002d2e3c420044f939c9415))
112
+
113
+ ### [0.2.38](https://github.com/hatiolab/operato/compare/v0.2.37...v0.2.38) (2021-12-07)
114
+
115
+ **Note:** Version bump only for package @operato/shell
116
+
117
+ ### [0.2.36](https://github.com/hatiolab/operato/compare/v0.2.35...v0.2.36) (2021-12-06)
118
+
119
+ ### :bug: Bug Fix
120
+
121
+ - apply class name prefix Ox for operato/shell ([d528848](https://github.com/hatiolab/operato/commit/d5288486ea0e1bec84fff3c5b6bac696eb701e5d))
122
+ - operato/input to support formfield ([21b4d46](https://github.com/hatiolab/operato/commit/21b4d46d750ba833c571b5caeed27eebd8aa03ca))
123
+ - operato/input to support formfield ([544bf92](https://github.com/hatiolab/operato/commit/544bf928946d878aa967f33b20efdf90eb8e82f5))
124
+ - operato/ox-shell-list rewritten ([f78b3e9](https://github.com/hatiolab/operato/commit/f78b3e9623faac5ea653442ced653173d630d9e6))
125
+ - operato/shell, input sample ([116b037](https://github.com/hatiolab/operato/commit/116b0371446cb24d8863c2bdea876b97f6e11dfd))
126
+ - operato/shell, input sample ([31fb99f](https://github.com/hatiolab/operato/commit/31fb99fc4e37a26c38826dd3554f92ded0632e82))
127
+
128
+ ### :rocket: New Features
129
+
130
+ - adding filter options for data-grist ([3620e8b](https://github.com/hatiolab/operato/commit/3620e8b5c39e7e66f8e7ab39b2ae7200f7f7afb5))
131
+
132
+ ### [0.2.35](https://github.com/hatiolab/operato/compare/v0.2.34...v0.2.35) (2021-12-03)
133
+
134
+ **Note:** Version bump only for package @operato/shell
135
+
136
+ ### [0.2.34](https://github.com/hatiolab/operato/compare/v0.2.33...v0.2.34) (2021-12-03)
137
+
138
+ **Note:** Version bump only for package @operato/shell
139
+
140
+ ### [0.2.33](https://github.com/hatiolab/operato/compare/v0.2.32...v0.2.33) (2021-12-03)
141
+
142
+ **Note:** Version bump only for package @operato/shell
143
+
144
+ **Note:** Version bump only for package @operato/shell
145
+
146
+ ### [0.2.32](https://github.com/hatiolab/operato/compare/v0.2.31...v0.2.32) (2021-12-03)
147
+
148
+ **Note:** Version bump only for package @operato/shell
149
+
150
+ ### [0.2.31](https://github.com/hatiolab/operato/compare/v0.2.30...v0.2.31) (2021-12-03)
151
+
152
+ **Note:** Version bump only for package @operato/shell
153
+
154
+ ### [0.2.30](https://github.com/hatiolab/operato/compare/v0.2.29...v0.2.30) (2021-12-01)
155
+
156
+ **Note:** Version bump only for package @operato/shell
157
+
158
+ ### [0.2.27](https://github.com/hatiolab/operato/compare/v0.2.26...v0.2.27) (2021-11-29)
159
+
160
+ ### :rocket: New Features
161
+
162
+ - move in lottie-player ([a542700](https://github.com/hatiolab/operato/commit/a542700bddb4960a65580e1ee14bbaae8493b6d3))
163
+
164
+ ### [0.2.26](https://github.com/hatiolab/operato/compare/v0.2.25...v0.2.26) (2021-11-24)
165
+
166
+ **Note:** Version bump only for package @operato/shell
167
+
168
+ ### [0.2.25](https://github.com/hatiolab/operato/compare/v0.2.24...v0.2.25) (2021-11-24)
169
+
170
+ **Note:** Version bump only for package @operato/shell
171
+
172
+ ### [0.2.15](https://github.com/hatiolab/operato/compare/v0.2.14...v0.2.15) (2021-11-21)
173
+
174
+ ### :bug: Bug Fix
175
+
176
+ - replace keycode to key for KeyboardEvent ([742d85a](https://github.com/hatiolab/operato/commit/742d85a104ea29dcaccc8f5ff1f42c527a2ac2af))
177
+
178
+ ### [0.2.10](https://github.com/hatiolab/operato/compare/v0.2.9...v0.2.10) (2021-11-15)
179
+
180
+ ### :bug: Bug Fix
181
+
182
+ - update eslint-config for open-wc ([1130c63](https://github.com/hatiolab/operato/commit/1130c6300da89612f7e55a9b61a348266bea0b96))
183
+
184
+ ### [0.2.9](https://github.com/hatiolab/operato/compare/v0.2.8...v0.2.9) (2021-11-06)
185
+
186
+ **Note:** Version bump only for package @operato/shell
187
+
188
+ ### [0.2.8](https://github.com/hatiolab/operato/compare/v0.2.7...v0.2.8) (2021-11-05)
189
+
190
+ ### :bug: Bug Fix
191
+
192
+ - change package name 'property-editor' => 'input' ([3c9436a](https://github.com/hatiolab/operato/commit/3c9436aa6a10eff0196e0a0725b52bb2d0a9f7b8))
193
+ - data-grist sample ([a636bac](https://github.com/hatiolab/operato/commit/a636bac9048d22397f7b41a5b8b51fb19216157d))
194
+ - mini-shell => shell ([8167443](https://github.com/hatiolab/operato/commit/8167443724a16fee278b6bc59e163da7afa2dd9b))
195
+
196
+ ### [0.2.7](https://github.com/hatiolab/operato/compare/v0.2.6...v0.2.7) (2021-11-04)
197
+
198
+ ### :bug: Bug Fix
199
+
200
+ - build for 0.2.7 ([8f935ac](https://github.com/hatiolab/operato/commit/8f935aceab84707511bf073cea0b3f6e60b3f401))
201
+
202
+ ### [0.2.6](https://github.com/hatiolab/operato/compare/v0.2.5...v0.2.6) (2021-11-04)
203
+
204
+ ### :bug: Bug Fix
205
+
206
+ - mini-shell menu triggers ([07b3a50](https://github.com/hatiolab/operato/commit/07b3a50e68008bac18869b71edfb9c6825d7360b))
207
+ - shell key-event ([7ce3c2d](https://github.com/hatiolab/operato/commit/7ce3c2dece3970606033992415ca83e78391197c))
208
+
209
+ ### [0.2.5](https://github.com/hatiolab/operato/compare/v0.2.4...v0.2.5) (2021-11-04)
210
+
211
+ ### :bug: Bug Fix
212
+
213
+ - give all property-editors prefix ox- ([9740fea](https://github.com/hatiolab/operato/commit/9740fea3a00ffb430a6c3823398afd527dda8349))
214
+
215
+ ### [0.2.3](https://github.com/hatiolab/operato/compare/v0.2.2...v0.2.3) (2021-11-02)
216
+
217
+ **Note:** Version bump only for package @operato/mini-shell
218
+
219
+ ### [0.2.2](https://github.com/hatiolab/operato/compare/v0.2.1...v0.2.2) (2021-11-02)
220
+
221
+ **Note:** Version bump only for package @operato/mini-shell
222
+
223
+ ### [0.2.1](https://github.com/hatiolab/operato/compare/v0.2.0...v0.2.1) (2021-11-02)
224
+
225
+ **Note:** Version bump only for package @operato/mini-shell
226
+
227
+ ## [0.2.0](https://github.com/hatiolab/operato/compare/v0.1.19...v0.2.0) (2021-11-02)
228
+
229
+ ### :bug: Bug Fix
230
+
231
+ - mini-shell index.ts ([7ad36bc](https://github.com/hatiolab/operato/commit/7ad36bc39bfde14c74be3bea6644460b746d554f))
232
+
233
+ ### [0.1.19](https://github.com/hatiolab/operato/compare/v0.1.18...v0.1.19) (2021-11-02)
234
+
235
+ **Note:** Version bump only for package @operato/mini-shell
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) hatiolab.com
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # \<mini-shell>
2
+
3
+ This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm i mini-shell
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```html
14
+ <script type="module">
15
+ import 'mini-shell/mini-shell.js'
16
+ </script>
17
+
18
+ <mini-shell></mini-shell>
19
+ ```
20
+
21
+ ## Linting and formatting
22
+
23
+ To scan the project for linting and formatting errors, run
24
+
25
+ ```bash
26
+ npm run lint
27
+ ```
28
+
29
+ To automatically fix linting and formatting errors, run
30
+
31
+ ```bash
32
+ npm run format
33
+ ```
34
+
35
+ ## Testing with Web Test Runner
36
+
37
+ To execute a single test run:
38
+
39
+ ```bash
40
+ npm run test
41
+ ```
42
+
43
+ To run the tests in interactive watch mode run:
44
+
45
+ ```bash
46
+ npm run test:watch
47
+ ```
48
+
49
+ ## Demoing with Storybook
50
+
51
+ To run a local instance of Storybook for your component, run
52
+
53
+ ```bash
54
+ npm run storybook
55
+ ```
56
+
57
+ To build a production version of Storybook, run
58
+
59
+ ```bash
60
+ npm run storybook:build
61
+ ```
62
+
63
+ ## Tooling configs
64
+
65
+ For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
66
+
67
+ If you customize the configuration a lot, you can consider moving them to individual files.
68
+
69
+ ## Local Demo with `web-dev-server`
70
+
71
+ ```bash
72
+ npm start
73
+ ```
74
+
75
+ To run a local development server that serves the basic demo located in `demo/index.html`
@@ -0,0 +1,33 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <style>
6
+ body {
7
+ background: #fafafa;
8
+ --ox-checkbox-size: 12px;
9
+ }
10
+
11
+ #demo {
12
+ position: relative;
13
+ height: 300px;
14
+ background-color: lightgray;
15
+ vertical-align: middle;
16
+ }
17
+ </style>
18
+ <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
19
+ <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
20
+ </head>
21
+ <body>
22
+ <div id="demo"></div>
23
+
24
+ <script type="module">
25
+ import { html, render } from 'lit'
26
+ import '@material/mwc-icon'
27
+
28
+ const parent = document.querySelector('#demo')
29
+
30
+ render(html``, parent)
31
+ </script>
32
+ </body>
33
+ </html>
@@ -0,0 +1,11 @@
1
+ export declare const UPDATE_MODULES = "UPDATE_MODULES";
2
+ export declare const UPDATE_BASE_URL = "UPDATE_BASE_URL";
3
+ export declare const UPDATE_CONTEXT_PATH = "UPDATE_CONTEXT_PATH";
4
+ export declare const SET_DOMAINS = "SET-DOMAINS";
5
+ export declare const updateDomains: (domains: {
6
+ name: string;
7
+ subdomain: string;
8
+ }[], domain: {
9
+ name: string;
10
+ subdomain: string;
11
+ }) => (dispatch: any) => void;
@@ -0,0 +1,12 @@
1
+ export const UPDATE_MODULES = 'UPDATE_MODULES';
2
+ export const UPDATE_BASE_URL = 'UPDATE_BASE_URL';
3
+ export const UPDATE_CONTEXT_PATH = 'UPDATE_CONTEXT_PATH';
4
+ export const SET_DOMAINS = 'SET-DOMAINS';
5
+ export const updateDomains = (domains, domain) => (dispatch) => {
6
+ dispatch({
7
+ type: SET_DOMAINS,
8
+ domains,
9
+ domain
10
+ });
11
+ };
12
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/actions/app.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAA;AAC9C,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAA;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAA;AACxD,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA;AAExC,MAAM,CAAC,MAAM,aAAa,GACxB,CACE,OAGG,EACH,MAGC,EACD,EAAE,CACJ,CAAC,QAAa,EAAE,EAAE;IAChB,QAAQ,CAAC;QACP,IAAI,EAAE,WAAW;QACjB,OAAO;QACP,MAAM;KACP,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["export const UPDATE_MODULES = 'UPDATE_MODULES'\nexport const UPDATE_BASE_URL = 'UPDATE_BASE_URL'\nexport const UPDATE_CONTEXT_PATH = 'UPDATE_CONTEXT_PATH'\nexport const SET_DOMAINS = 'SET-DOMAINS'\n\nexport const updateDomains =\n (\n domains: {\n name: string\n subdomain: string\n }[],\n domain: {\n name: string\n subdomain: string\n }\n ) =>\n (dispatch: any) => {\n dispatch({\n type: SET_DOMAINS,\n domains,\n domain\n })\n }\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './app';
2
+ export * from './route';
@@ -0,0 +1,3 @@
1
+ export * from './app';
2
+ export * from './route';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA","sourcesContent":["export * from './app'\nexport * from './route'\n"]}
@@ -0,0 +1,26 @@
1
+ export declare const UPDATE_PAGE = "UPDATE_PAGE";
2
+ export declare const UPDATE_CONTEXT = "UPDATE_CONTEXT";
3
+ export declare const UPDATE_ACTIVE_PAGE = "UPDATE_ACTIVE_PAGE";
4
+ export declare const REGISTER_NAVIGATION_CALLBACK = "REGISTER_NAVIGATION_CALLBACK";
5
+ export declare const UNREGISTER_NAVIGATION_CALLBACK = "UNREGISTER_NAVIGATION_CALLBACK";
6
+ export declare const HOMEPAGE = "";
7
+ /**
8
+ * 페이지를 이동하는 방법으로는 다음 두가지가 있다.
9
+ * 1. page link를 사용하는 방법 <a href='page'>goto page</a>
10
+ * 이 방법은 route(page)와 동일하다.
11
+ * 2. navigate('page')를 사용하는 방법
12
+ *
13
+ * @param string page
14
+ */
15
+ export declare const navigate: (location: string, replace: string) => void;
16
+ export declare const navigateWithSilence: ({ pathname: path, search, params }: {
17
+ pathname: string;
18
+ search?: string | undefined;
19
+ params?: {
20
+ [key: string]: any;
21
+ } | undefined;
22
+ }) => (dispatch: any) => void;
23
+ export declare const loadPage: (page: string, id: string, params: {
24
+ [key: string]: any;
25
+ }) => (dispatch: any) => void;
26
+ export declare const route: (url: string) => void;
@@ -0,0 +1,76 @@
1
+ import { getPathInfo } from '@operato/utils';
2
+ import { store } from '../store';
3
+ export const UPDATE_PAGE = 'UPDATE_PAGE';
4
+ export const UPDATE_CONTEXT = 'UPDATE_CONTEXT';
5
+ export const UPDATE_ACTIVE_PAGE = 'UPDATE_ACTIVE_PAGE';
6
+ export const REGISTER_NAVIGATION_CALLBACK = 'REGISTER_NAVIGATION_CALLBACK';
7
+ export const UNREGISTER_NAVIGATION_CALLBACK = 'UNREGISTER_NAVIGATION_CALLBACK';
8
+ export const HOMEPAGE = '';
9
+ /**
10
+ * 페이지를 이동하는 방법으로는 다음 두가지가 있다.
11
+ * 1. page link를 사용하는 방법 <a href='page'>goto page</a>
12
+ * 이 방법은 route(page)와 동일하다.
13
+ * 2. navigate('page')를 사용하는 방법
14
+ *
15
+ * @param string page
16
+ */
17
+ export const navigate = (location, replace) => {
18
+ if (replace)
19
+ history.replaceState(history.state, '', location);
20
+ else
21
+ history.pushState({}, '', location);
22
+ window.dispatchEvent(new Event('popstate'));
23
+ };
24
+ export const navigateWithSilence = ({ pathname: path, search, params }) => (dispatch) => {
25
+ const { path: pathname } = getPathInfo(path);
26
+ const reg = /\/([^\/]+)\/*([^\/]*)/;
27
+ const decodePath = decodeURIComponent(pathname);
28
+ const matchReturn = decodePath.match(reg) || [];
29
+ const page = matchReturn[1] || HOMEPAGE;
30
+ const id = matchReturn[2];
31
+ // Any other info you might want to extract from the path (like page type),
32
+ // you can do here
33
+ dispatch(loadPage(page, id, params || new URLSearchParams(search)));
34
+ };
35
+ const _preLoadPage = (page) => {
36
+ /*
37
+ * _preLoadPage 에서는 page를 load하기 전처리를 수행한다.
38
+ * 예를 들면, page dynamic import 또는 page re-routing
39
+ */
40
+ var state = store.getState();
41
+ /* override 기능을 위해서 dependency 관계의 역순으로 route를 실행한다. */
42
+ var modules = state.app.modules;
43
+ if (modules) {
44
+ for (let i = modules.length - 1; i >= 0; i--) {
45
+ let factoryModule = modules[i];
46
+ let _page = factoryModule.route && factoryModule.route(page);
47
+ if (_page) {
48
+ return _page;
49
+ }
50
+ }
51
+ }
52
+ };
53
+ export const loadPage = (page, id, params) => (dispatch) => {
54
+ var newPage = _preLoadPage(page);
55
+ if (page !== newPage && newPage.indexOf('/') == 0) {
56
+ dispatch(navigateWithSilence({
57
+ pathname: newPage,
58
+ params
59
+ }));
60
+ return;
61
+ }
62
+ dispatch({
63
+ type: UPDATE_PAGE,
64
+ page: newPage,
65
+ resourceId: id,
66
+ params
67
+ });
68
+ };
69
+ export const route = (url) => {
70
+ const link = document.createElement('a');
71
+ link.setAttribute('href', url);
72
+ document.body.appendChild(link);
73
+ link.click();
74
+ document.body.removeChild(link);
75
+ };
76
+ //# sourceMappingURL=route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.js","sourceRoot":"","sources":["../../../src/actions/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEhC,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAA;AAC9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAA;AAEtD,MAAM,CAAC,MAAM,4BAA4B,GA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I,CAAC,CAAA;IAC/B,IAAI,CAAC,KAAK,EAAE,CAAA;IACZ,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC,CAAA","sourcesContent":["import { getPathInfo } from '@operato/utils'\n\nimport { store } from '../store'\n\nexport const UPDATE_PAGE = 'UPDATE_PAGE'\nexport const UPDATE_CONTEXT = 'UPDATE_CONTEXT'\nexport const UPDATE_ACTIVE_PAGE = 'UPDATE_ACTIVE_PAGE'\n\nexport const REGISTER_NAVIGATION_CALLBACK = 'REGISTER_NAVIGATION_CALLBACK'\nexport const UNREGISTER_NAVIGATION_CALLBACK = 'UNREGISTER_NAVIGATION_CALLBACK'\n\nexport const HOMEPAGE = ''\n\n/**\n * 페이지를 이동하는 방법으로는 다음 두가지가 있다.\n * 1. page link를 사용하는 방법 <a href='page'>goto page</a>\n * 이 방법은 route(page)와 동일하다.\n * 2. navigate('page')를 사용하는 방법\n *\n * @param string page\n */\nexport const navigate = (location: string, replace: string) => {\n if (replace) history.replaceState(history.state, '', location)\n else history.pushState({}, '', location)\n\n window.dispatchEvent(new Event('popstate'))\n}\n\nexport const navigateWithSilence =\n ({ pathname: path, search, params }: { pathname: string; search?: string; params?: { [key: string]: any } }) =>\n (dispatch: any) => {\n const { path: pathname } = getPathInfo(path)\n\n const reg = /\\/([^\\/]+)\\/*([^\\/]*)/\n const decodePath = decodeURIComponent(pathname!)\n const matchReturn = decodePath.match(reg) || []\n const page = matchReturn[1] || HOMEPAGE\n const id = matchReturn[2]\n\n // Any other info you might want to extract from the path (like page type),\n // you can do here\n dispatch(loadPage(page, id, params || new URLSearchParams(search)))\n }\n\nconst _preLoadPage = (page: any) => {\n /*\n * _preLoadPage 에서는 page를 load하기 전처리를 수행한다.\n * 예를 들면, page dynamic import 또는 page re-routing\n */\n var state: any = store.getState()\n\n /* override 기능을 위해서 dependency 관계의 역순으로 route를 실행한다. */\n var modules = state.app.modules\n if (modules) {\n for (let i = modules.length - 1; i >= 0; i--) {\n let factoryModule = modules[i]\n let _page = factoryModule.route && factoryModule.route(page)\n if (_page) {\n return _page\n }\n }\n }\n}\n\nexport const loadPage = (page: string, id: string, params: { [key: string]: any }) => (dispatch: any) => {\n var newPage = _preLoadPage(page)\n\n if (page !== newPage && newPage.indexOf('/') == 0) {\n dispatch(\n navigateWithSilence({\n pathname: newPage,\n params\n })\n )\n return\n }\n\n dispatch({\n type: UPDATE_PAGE,\n page: newPage,\n resourceId: id,\n params\n })\n}\n\nexport const route = (url: string) => {\n const link = document.createElement('a')\n\n link.setAttribute('href', url)\n\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link)\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare const AppStyle: import("lit").CSSResult;
@@ -0,0 +1,68 @@
1
+ import { css } from 'lit';
2
+ export const AppStyle = css `
3
+ :host {
4
+ display: grid;
5
+
6
+ grid-template-rows: var(--app-grid-template-rows, auto 1fr auto);
7
+ grid-template-columns: var(--app-grid-template-columns, auto 1fr auto);
8
+ grid-template-areas: var(--app-grid-template-area, 'header header header' 'nav main aside' 'nav footer aside');
9
+ grid-gap: var(--app-grid-gap, 0em);
10
+
11
+ width: 100vw;
12
+ height: 100vh;
13
+ }
14
+
15
+ header-bar {
16
+ grid-area: header;
17
+ }
18
+
19
+ nav-bar {
20
+ grid-area: nav;
21
+ }
22
+
23
+ main {
24
+ grid-area: main;
25
+
26
+ overflow: hidden;
27
+
28
+ display: flex;
29
+ flex-direction: row;
30
+ }
31
+
32
+ aside-bar {
33
+ grid-area: aside;
34
+ }
35
+
36
+ footer-bar {
37
+ grid-area: footer;
38
+ }
39
+
40
+ main * {
41
+ flex: 1;
42
+ }
43
+
44
+ main *:not([active]) {
45
+ display: none;
46
+ }
47
+
48
+ [hidden] {
49
+ display: none;
50
+ }
51
+
52
+ snack-bar {
53
+ z-index: 1000;
54
+ }
55
+
56
+ /* Wide layout */
57
+ @media (min-width: 460px) {
58
+ }
59
+
60
+ @media print {
61
+ :host {
62
+ width: 100%;
63
+ height: 100%;
64
+ min-height: 100vh;
65
+ }
66
+ }
67
+ `;
68
+ //# sourceMappingURL=app-style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-style.js","sourceRoot":"","sources":["../../../src/app/app-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiE1B,CAAA","sourcesContent":["import { css } from 'lit'\n\nexport const AppStyle = css`\n :host {\n display: grid;\n\n grid-template-rows: var(--app-grid-template-rows, auto 1fr auto);\n grid-template-columns: var(--app-grid-template-columns, auto 1fr auto);\n grid-template-areas: var(--app-grid-template-area, 'header header header' 'nav main aside' 'nav footer aside');\n grid-gap: var(--app-grid-gap, 0em);\n\n width: 100vw;\n height: 100vh;\n }\n\n header-bar {\n grid-area: header;\n }\n\n nav-bar {\n grid-area: nav;\n }\n\n main {\n grid-area: main;\n\n overflow: hidden;\n\n display: flex;\n flex-direction: row;\n }\n\n aside-bar {\n grid-area: aside;\n }\n\n footer-bar {\n grid-area: footer;\n }\n\n main * {\n flex: 1;\n }\n\n main *:not([active]) {\n display: none;\n }\n\n [hidden] {\n display: none;\n }\n\n snack-bar {\n z-index: 1000;\n }\n\n /* Wide layout */\n @media (min-width: 460px) {\n }\n\n @media print {\n :host {\n width: 100%;\n height: 100%;\n min-height: 100vh;\n }\n }\n`\n"]}
@@ -0,0 +1 @@
1
+ export {};